-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile-pres.sh
executable file
·122 lines (116 loc) · 3.13 KB
/
compile-pres.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
# A script to compile the PhD Thesis - Krishna Kumar
# 24-01-2016: Updated to use xelatex Demitris G. Anastasiou
# 04-06-2017: Convert to compile presentations templates
# Distributed under GPLv2.0 License
#compile="compile";
xelatex="xelatex";
xelatexf="xelatexf";
clean="clean";
if test -z "$2"
then
if [ $1 = $clean ]; then
echo "Cleaning please wait ..."
rm -f *~
rm -rf *.aux
rm -rf *.bbl
rm -rf *.blg
rm -rf *.d
rm -rf *.fls
rm -rf *.ilg
rm -rf *.ind
rm -rf *.toc*
rm -rf *.lot*
rm -rf *.lof*
rm -rf *.log
rm -rf *.idx
rm -rf *.out*
rm -rf *.nlo
rm -rf *.nls
rm -rf *.bcf
rm -rf *.bib
rm -rf *.fdb_latexmk
rm -rf *.nav
rm -rf *.run.xml
rm -rf *.snm
rm -rf *.xwm
rm -rf $filename.pdf
rm -rf $filename.ps
rm -rf $filename.dvi
rm -rf *#*
echo "Cleaning complete!"
exit
else
echo "Shell script for compiling the PhD Thesis"
echo "Usage: sh ./compile-thesis.sh [OPTIONS] [filename]"
# echo "[option] compile: Compiles the PhD Thesis"
echo "[option] xelatex: Compile the PhD thesis using xelatex"
echo "[option] xelatexf: Compile xelatex and biber, full copilation"
echo "[option] clean: removes temporary files no filename required"
exit
fi
fi
filename=$2;
if [ $1 = $clean ]; then
echo "Cleaning please wait ..."
rm -f *~
rm -rf *.aux
rm -rf *.bbl
rm -rf *.blg
rm -rf *.d
rm -rf *.fls
rm -rf *.ilg
rm -rf *.ind
rm -rf *.toc*
rm -rf *.lot*
rm -rf *.lof*
rm -rf *.log
rm -rf *.idx
rm -rf *.out*
rm -rf *.nlo
rm -rf *.nls
rm -rf *.bcf
rm -rf *.bib
rm -rf *.fdb_latexmk
rm -rf *.nav
rm -rf *.run.xml
rm -rf *.snm
rm -rf *.xwm
rm -rf $filename.pdf
rm -rf $filename.ps
rm -rf $filename.dvi
rm -rf *#*
echo "Cleaning complete!"
exit
elif [ $1 = $xelatexf ]; then
echo "Compiling your PhD Thesis...please wait...!"
latexmk -xelatex $filename.tex # <<-- NEW compilation after 26 May 17
biber $filname.aux
latexmk -xelatex -g $filename.tex
echo "Success!"
echo "LAST RUN" $(date)
exit
elif [ $1 = $xelatex ]; then
echo "Compiling your PhD Thesis...please wait...!"
# latexmk -xelatex $filename.tex # <<-- NEW compilation after 26 May 17
# biber $filname.aux
# latexmk -xelatex -g $filename.tex
xelatex $filename.tex
echo "Success!"
echo "LAST RUN:" $(date)
exit
else
echo "Shell script for compiling the PhD Thesis"
echo "Usage: sh ./compile-thesis.sh [OPTIONS] [filename]"
# echo "[option] compile: Compiles the PhD Thesis"
echo "[option] xelatex: Compile the PhD thesis using xelatex"
echo "[option] xelatexf: Compile xelatex and biber, full copilation"
echo "[option] clean: removes temporary files no filename required"
exit
fi
# reduce size of pdf file... sometimes work
# gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r80 -sOutputFile=phd_pres_low.pdf phd_pres.pdf
if test -z "$3"
then
exit
fi