-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_paper.sh
More file actions
executable file
·36 lines (34 loc) · 1.13 KB
/
generate_paper.sh
File metadata and controls
executable file
·36 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/zsh
# Shell script to convert source files into a MS-Word
# document. Most of the heavy lifting done by pandoc:
# https://pandoc.org
# Last tested with v3.1.
#
# Equation, Figure, and Table numbering/cross references
# handled by pandoc-crossref:
# https://lierdakil.github.io/pandoc-crossref/#citeproc-and-pandoc-crossref
# Last tested with v0.3.15.1.
# Cleanup markdown before passing to pandoc
# - missing italics for genes and QS systems
# - unicode glyphs to markdown subscripts
# - GitHub-friendly subscripts/superscripts to real markdown
cat paper.md | sed \
-e 's/ lasB/ _lasB_/g' \
-e 's/ lasI/ _lasI_/g' \
-e 's/ lasR/ _lasR_/g' \
-e 's/ rhlI/ _rhlI_/g' \
-e 's/ rhlR/ _rhlR_/g' \
-e 's/ las/ _las_/g' \
-e 's/ rhl/ _rhl_/g' \
-e 's/C₄‑HSL/C~4~‑HSL/g' \
-e 's/3‑oxo‑C₁₂‑HSL/3‑oxo‑C~12~‑HSL/g' \
-e 's/<\/\{0,1\}sub>/~/g' \
-e 's/<\/\{0,1\}sup>/^/g' \
| pandoc \
--from markdown \
--filter pandoc-crossref \
--citeproc \
--csl plos-biology.csl \
--bibliography "Bibliography (BibTeX).bib" \
--reference-doc=reference.docx \
--output "paper.docx"