-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (27 loc) · 1.04 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
MAIN=main
OUTDIR=out
MODE=errorstopmode
OKWORDS=okwords.txt
BADWORDS=badwords.txt
FIG_DIR=./figures
pdf: outdir
pdflatex --output-directory $(OUTDIR) $(MAIN).tex
TEXMFOUTPUT=$(OUTDIR) bibtex $(OUTDIR)/$(MAIN)
pdflatex --output-directory $(OUTDIR) $(MAIN).tex
pdflatex --output-directory $(OUTDIR) $(MAIN).tex
all: outdir
latexmk -shell-escape -xelatex -bibtex -outdir=$(OUTDIR) -auxdir=$(OUTDIR) $(MAIN).tex
pv: outdir
latexmk -shell-escape -xelatex -bibtex -pvc -interaction=$(MODE) -outdir=$(OUTDIR) -auxdir=$(OUTDIR) $(MAIN).tex
spellcheck: outdir
@test -e $(OKWORDS) || touch $(OKWORDS)
@find . -type f -name "*.tex" -exec hunspell -t -l -p $(OKWORDS) {} \; | sort -f | uniq > $(BADWORDS)
@cat $(BADWORDS)
submit: clean pdf outdir
@latexpand --expand-bbl $(OUTDIR)/$(MAIN).bbl $(MAIN).tex -o submitted/all-in-one.tex
@$(foreach fig, $(shell grep "includegraphics" submitted/all-in-one.tex | cut -d \{ -f 2 | cut -d \} -f 1), /bin/cp -rfv $(FIG_DIR)/$(fig) submitted/;)
outdir:
mkdir -p $(OUTDIR)
.PHONY: clean outdir
clean:
rm -rf $(OUTDIR)/*