Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # used for latex->dvips->ps2pdf
- ERROR="Too few arguments : no file name specified"
- [[ $# -eq 0 ]] && echo $ERROR && exit # no args? ... print error and exit
- if [ $# -eq 2 ]
- then
- # latex this many times
- for (( c=1; c<=$2; c++ ))
- do
- latex $1.tex
- done
- # makeindex, if appropriate
- #grep -F makeindex $1.tex && makeindex $1 && echo "making index..."
- egrep '^\\printindex' $1.tex && makeindex $1 && echo "making index..."
- dvips $1.dvi -o $1.ps
- ps2pdf $1.ps
- #pstopdf $1.ps
- echo
- echo LaTeX ran $2 times
- echo
- exit
- fi
- # check that the file exists
- if [ -f $1.tex ]
- then
- # if it exists then latex it twice, [makeindex], dvips, then ps2pdf
- latex $1.tex
- latex $1.tex
- # makeindex, if appropriate
- #grep -F makeindex $1.tex && makeindex $1 && echo "making index..."
- egrep '^\\printindex' $1.tex && makeindex $1 && echo "making index..."
- dvips $1.dvi -o $1.ps
- #pstopdf $1.ps
- ps2pdf $1.ps
- else
- # otherwise give this output line with a list of available tex files
- echo the file doesnt exist butthead! Choose one of these:
- ls *.tex
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement