-
Notifications
You must be signed in to change notification settings - Fork 2
/
compile-thesis.sh
87 lines (81 loc) · 1.64 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
#!/bin/bash
# A script to compile the PhD Thesis - Krishna Kumar
# Distributed under GPLv2.0 License
compile="compile";
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 $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] 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 $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
fi
if test -z "$3"
then
exit
fi