-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompilerClean
More file actions
executable file
·46 lines (42 loc) · 1.25 KB
/
compilerClean
File metadata and controls
executable file
·46 lines (42 loc) · 1.25 KB
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
#!/bin/sh
### Test usage; if incorrect, output correct usage and exit
if [ "$#" -gt 1 -o "$#" -eq 0 ]; then
echo "Compilation error"
exit
fi
# Stem and extension of file
filestem=`echo $1 | cut -f1 -d.`
extension=`echo $1 | cut -f2 -d.`
### Test if file exist
if [[ ! -r $1 ]]; then
echo -e "\n File does not exist, or option mispecified \n"
exit
fi
### Test file extension
if [[ $extension != tex ]]; then
echo -e "\n Invalid input file, must be a tex-file \n"
exit
fi
latex $filestem.tex
bibtex $filestem.aux
latex $filestem.tex
bibtex $filestem.aux
bibtex $filestem.aux
latex $filestem.tex
bibtex $filestem.aux
latex $filestem.tex
latex $filestem.tex
dvips -P pdf $filestem.dvi
ps2pdf $filestem.ps
[[ -f "$filestem.bbl" ]] && rm "$filestem.bbl"
[[ -f "$filestem.out" ]] && rm "$filestem.out"
[[ -f "$filestem.aux" ]] && rm "$filestem.aux"
[[ -f "$filestem.blg" ]] && rm "$filestem.blg"
[[ -f "$filestem.nav" ]] && rm "$filestem.nav"
[[ -f "$filestem.dvi" ]] && rm "$filestem.dvi"
[[ -f "$filestem.ps" ]] && rm "$filestem.ps"
[[ -f "$filestem.log" ]] && rm "$filestem.log"
[[ -f "$filestem.toc" ]] && rm "$filestem.toc"
[[ -f "$filestem.snm" ]] && rm "$filestem.snm"
[[ -f "$filestem.vrb" ]] && rm "$filestem.vrb"
[[ -f "$filestem.out.ps" ]] && rm "$filestem.out.ps"