forked from kks32/phd-thesis-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
compile-thesis.sh
executable file
·119 lines (111 loc) · 2.91 KB
/
compile-thesis.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
#!/bin/bash
# A script to compile the PhD Thesis - Krishna Kumar
# Updated to use xelatex Demitris G. Anastasiou
# Distributed under GPLv2.0 License
compile="compile";
xelatex="xelatex";
clean="clean";
#mknomencl="mknomencl";
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 $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] clean: removes temporary files no filename required"
# echo "[oprion] mknomecl: run after the first run for nomeclatures"
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 $filename.pdf
rm -rf $filename.ps
rm -rf $filename.dvi
rm -rf *#*
echo "Cleaning complete!"
exit
elif [ $1 = $compile ]; then
echo "Compiling your PhD Thesis...please wait...!"
pdflatex -interaction=nonstopmode $filename.tex
bibtex $filename.aux
makeindex $filename.aux
makeindex $filename.idx
makeindex $filename.nlo -s nomencl.ist -o $filename.nls
pdflatex -interaction=nonstopmode $filename.tex
makeindex $filename.nlo -s nomencl.ist -o $filename.nls
pdflatex -interaction=nonstopmode $filename.tex
echo "Success!"
exit
elif [ $1 = $xelatex ]; then
echo "Compiling your PhD Thesis...please wait...!"
# latexmk -pdf -e '$pdflatex=q/xelatex %O %S/' $filename
# makeindex $filename.aux
# makeindex $filename.idx
# makeindex $filename.nlo -s nomencl.ist -o $filename.nls
# latexmk -pdf -e '$pdflatex=q/xelatex %O %S/' $filename # <<-- old compilation style
latexmk -xelatex $filename.tex # <<-- NEW compilation after 26 May 17
makeindex $filename.nlo -s nomencl.ist -o $filename.nls
latexmk -xelatex -g -f $filename.tex
echo "Success!"
exit
#elif [ $1 = $mknomencl ]; then
# echo "Compiling nlo files...please wait...!"
# makeindex $filename.nlo -s nomencl.ist -o $filename.nls
# echo "Success!"
# 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] clean: removes temporary files no filename required"
# echo "[option] mknomencl: run after the first run for nomeclatures"
exit
fi
if test -z "$3"
then
exit
fi