-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (27 loc) · 905 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
33
34
PAPER=lecture-notes
$(PAPER).pdf:
./latexrun/latexrun --bibtex-cmd biber $(PAPER).tex
.PHONY: $(PAPER).pdf
IN = $(wildcard lectures/lec*.tex)
OUT = $(subst lectures/,chapters/,$(IN))
OUT2 = $(addsuffix .pdf,$(basename $(OUT)))
.PHONY: chapters/%.pdf.run
chapters/%.pdf: lectures/%.tex
mkdir -p build
mkdir -p chapters
cp ref.bib build/ref.bib
# creates a temporary file from the _chapter.tex template that we then compile
sed s:CHAPTER.TEX:$<: <_chapter.tex >build/$*_standalone.tex
./latexrun/latexrun -o chapters/$*.pdf --bibtex-cmd biber build/$*_standalone.tex
henry:
latexmk -pdf -pvc \
-latexoption=-file-line-error \
-latexoption=-shell-escape\
-latexoption=-halt-on-error\
-latexoption=-interaction=nonstopmode \
-latexoption=-synctex=1 $(PAPER)
all: $(PAPER).pdf $(OUT2)
clean:
./latexrun/latexrun --clean-all
rm -f lecture-notes.bbl build/* chapters/*
.PHONY: clean