-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (47 loc) · 1.9 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
52
53
54
thesis_files = $(wildcard thesis_*.md)
thesis_config = $(wildcard config/thesis_*.md)
thesis_figures = $(wildcard figure/thesis_*.pdf figure/thesis_*.png figure/publication_*/*.pdf figure/publication_*/*.png)
appendix_files = $(wildcard appendix_*.md)
latex_template_files = $(wildcard template/latex/template_*.latex)
latex_appendix_template_files = $(wildcard template/latex/appendix_*.latex)
bibtex_file = bibliography.bib
all: thesis.pdf
thesis.pdf: $(thesis_config) $(thesis_files) $(thesis_figures) $(bibtex_file) template.latex appendix.latex
@pandoc $(thesis_config) $(thesis_files) \
--toc --filter pandoc-shortcaption \
--filter pandoc-crossref \
--filter pandoc-citeproc \
--bibliography $(bibtex_file) \
--csl template/citationstyle.csl \
--include-after-body appendix.latex \
--template template.latex \
--latex-engine xelatex \
-o thesis.pdf
thesis.latex: $(thesis_config) $(thesis_files) $(thesis_figures) $(bibtex_file) template.latex appendix.latex
@pandoc $(thesis_config) $(thesis_files) \
--toc --filter pandoc-shortcaption \
--filter pandoc-crossref \
--filter pandoc-citeproc \
--bibliography $(bibtex_file) \
--csl template/citationstyle.csl \
--include-after-body appendix.latex \
--template template.latex \
--latex-engine xelatex \
-o thesis.latex
template.latex: $(latex_template_files)
@cat $(latex_template_files) > template.latex
template_appendix.latex: $(latex_appendix_template_files)
@cat $(latex_appendix_template_files) > template_appendix.latex
appendix.latex: template_appendix.latex $(appendix_files)
@pandoc $(appendix_files) \
-f markdown \
-t latex \
--filter pandoc-crossref \
--filter pandoc-citeproc \
--bibliography $(bibtex_file) \
--csl template/citationstyle.csl \
--template template_appendix.latex \
--top-level-division=chapter \
-o appendix.latex
clean:
@rm -f thesis.pdf appendix.latex template.latex template_appendix.latex