dissertation-4-dissertation/compile-thesis.sh

88 lines
1.6 KiB
Bash
Raw Permalink Normal View History

2013-11-15 23:38:17 +00:00
#!/bin/bash
# A script to compile the PhD Thesis - Krishna Kumar
# Distributed under GPLv2.0 License
2013-11-16 00:45:21 +00:00
compile="compile";
clean="clean";
2013-11-20 00:55:21 +00:00
if test -z "$2"
2013-11-16 00:45:21 +00:00
then
2013-11-20 00:55:21 +00:00
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
2014-04-14 23:59:53 +01:00
echo "Shell script for compiling the PhD Thesis"
2013-11-20 00:55:21 +00:00
echo "Usage: sh ./compile-thesis.sh [OPTIONS] [filename]"
echo "[option] compile: Compiles the PhD Thesis"
echo "[option] clean: removes temporary files no filename required"
2013-11-16 00:45:21 +00:00
exit
fi
2013-11-20 00:55:21 +00:00
fi
filename=$2;
2013-11-16 00:45:21 +00:00
if [ $1 = $clean ]; then
echo "Cleaning please wait ..."
rm -f *~
2013-11-20 00:55:21 +00:00
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 *#*
2013-11-16 00:45:21 +00:00
echo "Cleaning complete!"
exit
elif [ $1 = $compile ]; then
echo "Compiling your PhD Thesis...please wait...!"
2013-11-20 00:55:21 +00:00
pdflatex -interaction=nonstopmode $filename.tex
2013-11-26 18:18:30 +00:00
bibtex $filename.aux
makeindex $filename.aux
makeindex $filename.idx
2013-11-20 00:55:21 +00:00
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
2013-11-16 00:45:21 +00:00
echo "Success!"
exit
fi
2013-11-20 00:55:21 +00:00
if test -z "$3"
2013-11-16 00:45:21 +00:00
then
exit
fi