-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (34 loc) · 1.25 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
35
36
37
38
39
40
41
42
43
44
45
46
47
SHELL := /bin/bash
# get the basename of the containing directory
# this will be used to name othe output document
BUILD_DIR := $(shell basename $(abspath $(dir $(lastword $(MAKEFILE_LIST)))))
all: ${BUILD_DIR}-draft.pdf
view:
atom ${BUILD_DIR}.pdf
${BUILD_DIR}.pdf: main.tex
latexmk -pdf -silent \
-jobname=${BUILD_DIR} \
-pdflatex="pdflatex -interaction=nonstopmode" main.tex
${BUILD_DIR}-draft.pdf: main.tex
latexmk -pdf -silent \
-jobname=${BUILD_DIR}-draft \
-pdflatex="pdflatex -interaction=nonstopmode" draft.tex
${BUILD_DIR}.tex: main.tex
./latexpand main.tex > ${BUILD_DIR}.tex
${BUILD_DIR}-draft.tex: main.tex
./latexpand draft.tex > ${BUILD_DIR}-draft.tex
ps-graphics:
shopt -s globstar; for pdf in **/*.pdf; do echo "$${pdf}"; cd "$$(dirname "$${pdf}")"; pdf2ps "$$(basename "$${pdf}")"; cd -; done
clean:
rm -f ${BUILD_DIR}.pdf
rm -f ${BUILD_DIR}.tex
rm -f ${BUILD_DIR}-draft.pdf
rm -f ${BUILD_DIR}-draft.tex
sview:
xdg-open ${BUILD_DIR}-draft.pdf 2>/dev/null
full: ${BUILD_DIR}-draft.pdf ${BUILD_DIR}.pdf ${BUILD_DIR}-draft.tex ${BUILD_DIR}.tex
cleaner:
latexmk -CA
# remove auxillary files, excepting .tex and .bib files
find . -type f -name ${BUILD_DIR}"*" ! -name '*.tex' ! -name '*.bib' -delete
fresh: cleaner all