-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (37 loc) · 1.25 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pandoc_opt=-Fpandoc-crossref -Fpandoc-citeproc
.DELETE_ON_ERROR:
.SECONDARY:
all: tigmint.html tigmint.pdf
docx: tigmint.docx
clean:
rm -f tigmint.html tigmint.pdf tigmint-supp.html tigmint-supp.pdf
# Download the citation style language (CSL).
tigmint.csl:
curl -o $@ https://www.zotero.org/styles/biomed-central
# Render Markdown to HTML using Pandoc.
%.html: %.md
pandoc $(pandoc_opt) -s --mathjax -o $@ $<
# Render Markdown to PDF using Pandoc.
%.pdf: %.md
pandoc $(pandoc_opt) -o $@ $<
# Render Markdown to DOCX using Pandoc.
%.docx: %.md
pandoc -o $@ $<
# Convert Markdown to LaTeX using Pandoc.
%.tex: %.md
pandoc $(pandoc_opt) --wrap=none -o $@ $<
# Generate Table of Contents for supplemental material only
tigmint-supp.pdf: tigmint-supp.md
pandoc $(pandoc_opt) --toc -o $@ $<
# Fetch BibTex records from a list of DOI.
%.doi.bib: %.doi
brew cite $$(<$<) | sort >$@
# Concatentate the citations with and without DOI.
%.bib: %.doi.bib %.nodoi.bib
sort $^ | sed 's~http://dx.doi.org~https://doi.org~' >$@
tigmint.docx: tigmint.bib tigmint.csl
tigmint.html: tigmint.bib tigmint.csl
tigmint.pdf: tigmint.bib tigmint.csl
tigmint-supp.docx: tigmint.bib tigmint.csl
tigmint-supp.html: tigmint.bib tigmint.csl
tigmint-supp.pdf: tigmint.bib tigmint.csl