default-paper/Makefile
2022-07-28 10:45:55 +02:00

35 lines
1.3 KiB
Makefile

.PHONY: main.pdf clean redo test_git versioned
main.pdf: main.tex main.bib
latexmk -pdfxe main.tex # use xelatex to build pdf
clean:
latexmk -c
x=`biber --cache` && if [ -d "$x" ]; then $(RM) $x; fi
$(RM) *.out *.aux *.log *.bbl *.blg *~ *.toc *.idx *.eps dummy *.fls *.fdb_latexmk *.bcf *.run.xml *.xdv
$(RM) $(patsubst %.tex, %.ps, $(wildcard *.tex))
$(RM) $(patsubst %.tex, %.dvi, $(wildcard *.tex))
$(RM) $(patsubst %.tex, %.pdf, $(wildcard *.tex))
redo: clean main.pdf
test_git:
if [ -z "$$(git status --untracked-files=no --porcelain)" ]; then exit 0; else echo -e "\nERROR: working directory not clean. commit changes before running versioned build"; exit 1; fi
# TODO check if we are also synced to at least one remote
versioned: test_git clean main.pdf
cp main.pdf "main-$$(date -u +'%Y-%m-%dT%H:%M:%SZ')-$$(git rev-parse --short HEAD).pdf"
# TODO latexdiff
# latexdiff-vc --pdf main.tex -r 123456 -r abcdef
# common typos check. find words, but ignore latex comment and macros
CT=grep -inr --include \*.tex "$${TYPO}" | grep -v ":%" | grep -v "newacronym" | grep -i --color=always "$${TYPO}"; exit 0
check-common-typos:
TYPO="application" && ${CT}
TYPO="run-time" && ${CT}
TYPO="behaviour" && ${CT}
TYPO="ground-truth" && ${CT}
TYPO="groundtruth" && ${CT}
TYPO="seperator" && ${CT}