forked from bmschmidt/CV-pandoc-healy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·33 lines (25 loc) · 992 Bytes
/
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
all: long_CV.pdf short_CV.pdf
#pdf: clean $(PDFS)
#html: clean $(HTML)
%_CV.pdf: %_CV.tex
xelatex $*_CV
biber $*_CV
xelatex $*_CV
xelatex $*_CV
yaml_CV.md: curriculum_vitae.yaml
# Pandoc can't actually read YAML, just YAML blocks in
# Markdown. So I give it a document that's just a YAML block,
# while still editing a straight YAML file which has a bunch of advantages.
echo "---" > $@
cat $< >> $@
echo "..." >> $@
%_CV.tex: template_for_%_CV.tex yaml_CV.md
# Pandoc does the initial compilation to tex; we then latex handle the actual bibliography
# and pdf creation.
pandoc --template=$< -t latex yaml_CV.md > $@
# Citekeys get screwed up by pandoc which escapes the underscores.
# Years should have en-dashes, which damned if I'm going to do it
# on my own.
perl -pi -e 'if ($$_=~/cite\{/) {s/\\_/_/g}; s/(\d{4})-([Pp]resent|\d{4})/$$1--$$2/g' $@;
clean:
rm -f *CV.aux *CV.bcf *CV.log *CV.out *CV.run.xml *CV.pdf short_CV.tex long_CV.tex *CV.bbl *CV.blg *yaml_CV.md