-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
52 lines (46 loc) · 1.45 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
.DEFAULT_GOAL := all
MAKE_PDFA := true
objects := institutionalised_education.pdf
all: $(objects)
%.pdf: %.md bibliography/bibliography.bib contributors.yml preamble.sty build/template.tex glossary.tex filter.py Makefile
@mkdir -p build
@mkdir -p build/svg-inkscape
@rm -f build/pdfa.xmpi
cp --update preamble.sty build/
cp --update bibliography/bibliography.bib build/
cp --update glossary.tex build/
python3 filter.py --input="${<}" --output="build/${<}" --contributors="contributors.yml"
pandoc \
--standalone \
--number-sections \
--filter pandoc-xnos \
--bibliography=bibliography.bib \
--biblatex \
--toc \
--template="build/template.tex" \
-f markdown-latex_macros \
-M pdfa-$(MAKE_PDFA)=1 \
-M date="`date "+%F"`" \
-M datexmp="`date "+%F"`" \
-M linkcolor=darkgray \
-V hyperrefoptions=pdfa \
-V colorlinks=true \
-V papersize=a4 \
-o "build/${@:.pdf=}.tex" \
"build/$<"
@sed -i '/\\author{}/d' "build/${@:.pdf=}.tex"
if grep -q "\\makeglossaries" "${<}"; then \
cd build; \
pdflatex -shell-escape --jobname="${@:.pdf=}" "${@:.pdf=}.tex"; \
makeglossaries "${@:.pdf=}"; \
fi
latexmk \
-pdflatex -shell-escape -bibtex -halt-on-error \
-jobname="${@:.pdf=}" -cd "build/${@:.pdf=}.tex"
@mv "build/${@}" "${@}"
build/template.tex: template.py
@mkdir -p build
pandoc --print-default-template=latex > "${@}"
python3 "${<}" "${@}"
clean:
rm -f $(objects)