-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.69 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
.PHONY: help clean cleanall pdf tex tex2pdf
PDFLATEX=xelatex
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/source
OUTPUTDIR=$(BASEDIR)/output
STYLEDIR=$(BASEDIR)/style
help:
@echo ' '
@echo 'Usage: '
@echo ' make pdf generate a PDF file '
@echo ' make tex generate a Latex file '
@echo ' '
@echo 'get local templates with: pandoc -D latex/html/etc '
@echo 'or generic ones from: https://github.com/jgm/pandoc-templates '
clean:
rm "$(OUTPUTDIR)"/thesis.{aux,log,out,toc,lof}
cleanall:
rm "$(OUTPUTDIR)"/thesis.{aux,log,out,toc,lof,tex,pdf}
pdf:
pandoc --verbose \
--include-in-header="$(STYLEDIR)"/preamble.tex \
metadata.yaml "$(INPUTDIR)"/*.md \
--template="$(STYLEDIR)/template.tex" \
-V documentclass=report \
-V fontsize=12pt -V papersize:a4 -V classoption:twoside \
--filter pandoc-crossref \
--filter pandoc-citeproc \
--pdf-engine="$(PDFLATEX)" \
-o $(OUTPUTDIR)/thesis.pdf
tex:
pandoc --verbose --wrap=none \
--include-in-header="$(STYLEDIR)"/preamble.tex \
metadata.yaml "$(INPUTDIR)"/*.md \
--template="$(STYLEDIR)/template.tex" \
-V documentclass=report \
-V fontsize=12pt -V papersize:a4 -V classoption:twoside \
--filter pandoc-crossref \
--filter pandoc-citeproc \
-s -o $(OUTPUTDIR)/thesis.tex
tex2pdf:
"$(PDFLATEX)" -output-directory="$(OUTPUTDIR)" thesis.tex
"$(PDFLATEX)" -output-directory="$(OUTPUTDIR)" thesis.tex
rm "$(OUTPUTDIR)"/thesis.{aux,log,out,toc,lof}