-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (61 loc) · 2.46 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
exclude=*.ps *.brf *.acr *.alg *.acn *.ist *.lof *.lot *~ *.gls *.glsdefs *.aux *.nlo *.glo *.bbl \
*.blg *.log *.out *.bak* *.toc *.glg *.ind *.nls *.idx *.ilg *.xd
define newline
endef
tempfilespath=$(PWD)/.tmp
tempfilescmd=-output-directory=$(tempfilespath)
define printtex
\\documentclass[a4paper]{article} \\usepackage{geometry} \\usepackage{pdfpages} \\includepdfset{pages=-,nup=2x3,frame,noautoscale=false,delta=5mm 5mm,pagecommand={\\thispagestyle{plain}}} \\geometry{vscale=.75,hscale=.925} \\usepackage{parskip} \\begin{document} \\includepdf[scale=.9]{.tmp/main.pdf} \\end{document}
endef
all:
mkdir -p $(tempfilespath)/text
# ntlconfigdoc.sh
make full
final:
mkdir -p $(tempfilespath)/text
# ntlconfigdoc.sh final
make full
full:
make clean
mkdir -p $(tempfilespath)/text
pdflatex $(tempfilescmd) --jobname=main -interaction=nonstopmode "$(def)\input{main.tex}"
# makeindex main.idx
# makeindex main.nlo -s nomencl.ist -o main.nls
cp text/references.bib $(tempfilespath)/text/references.bib
# ln -sf ../din $(tempfilespath)/din
cd $(tempfilespath);bibtex "main.aux"
sed -i 's/\\\\#/\\#/g' $(tempfilespath)/main.bbl
sed -i 's/\\\\%/\\%/g' $(tempfilespath)/main.bbl
sed -i 's/\\\\_/\\_/g' $(tempfilespath)/main.bbl
pdflatex $(tempfilescmd) --jobname=main -interaction=nonstopmode "$(def)\input{main.tex}"
# cd $(tempfilespath);makeglossaries main
# pdflatex $(tempfilescmd) -synctex=1 -interaction=nonstopmode main.tex
# cd $(tempfilespath);makeglossaries main
pdflatex $(tempfilescmd) --jobname=main -synctex=1 -interaction=nonstopmode "$(def)\input{main.tex}"
devmain:
make def="\def\modedev{}" main
main:
mkdir -p $(tempfilespath)/text
pdflatex $(tempfilescmd) -synctex=1 -interaction=nonstopmode "$(def)\input{main.tex}"
# rm -fr **/*.gls **/*~ **/*.aux **/*.bbl **/*.nlo **/*.glo \
**/*.blg **/*.log **/*.out **/*.bak* **/*.toc
# rm -fr $(exclude)
printslides:
make def="\def\modeprint{}" full
pdflatex $(tempfilescmd) --jobname=printslides -interaction=nonstopmode $(printtex)
mv "$(tempfilespath)/printslides.pdf" "$(tempfilespath)/main.pdf"
update:
make clean
git add .
ifneq ($(strip $(c)),)
git commit -am "$(c)"
else
git commit -a
endif
git push -u origin master
# @nohup ntlbkp.sh >/dev/null 2>&1 &
clean:
rm -fr $(tempfilespath)
rm -fr **/*.lof **/*.lot **/*~ **/*.aux **/*.dvi \
**/*.bbl **/*.blg **/*.log **/*.out **/*.bak* **/*.toc **/*.nlo **/*.glo
rm -fr $(exclude) main.pdf *.synctex.gz main.dvi main.xdy main.upa