-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (36 loc) · 1 KB
/
Makefile
File metadata and controls
52 lines (36 loc) · 1 KB
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
LATEX=pdflatex
LATEXOPT=--shell-escape
#"nonstopmode" is very verbose. batchmode is not verbose
NONSTOP=--interaction=nonstopmode
#NONSTOP=--interaction=batchmode
LATEXMK=latexmk
LATEXMKOPT=-pdf
CONTINUOUS=-pvc
MAIN=main
SOURCES=source
SLIDE=slides
all: clean-compile
clean-compile: clean compile .showerrors run
compile:
$(LATEXMK) $(LATEXMKOPT) -pdflatex="$(LATEX) $(NONSTOP) $(LATEXOPT) %O %S" $(MAIN) &> /tmp/errors
run:
xdg-open $(MAIN).pdf
.showerrors:
/usr/bin/grep --color=always -A3 "\!.*" /tmp/errors || :
.refresh:
touch .refresh
continuous: $(MAIN).tex .refresh $(SOURCES)
$(LATEXMK) $(LATEXMKOPT) $(CONTINUOUS) \
-pdflatex="$(LATEX) $(LATEXOPT) $(NONSTOP) %O %S" $(MAIN)
slide:
$(MAKE) -C $(SLIDE)
force:
touch .refresh
rm $(MAIN).pdf
$(LATEXMK) $(LATEXMKOPT) $(CONTINUOUS) \
-pdflatex="$(LATEX) $(LATEXOPT) %O %S" $(MAIN)
clean:
$(LATEXMK) -C $(MAIN)
rm -f $(MAIN).pdfsync main.pdf *~ *.tmp *.bbl *.blg *.aux *.end *.fls *.log *.out *.fdb_latexmk
debug:
$(LATEX) $(LATEXOPT) $(MAIN)