# Syntax: From the command line, in a directory containing a # LaTeX file called "file.tex," enter "show file.tex" to # create and view a PDF file. (If you get a LaTeX error # of the form "File `birkmult.cls' not found" and obtain # an unviewable PDF file, enter "cp birkmult.cls /tmp" # and try again.) show () { present_location=`pwd` ; /bin/cp $1 /tmp/$1 ; cd /tmp ; latex -interaction nonstopmode `basename $1 .tex` ; latex -interaction nonstopmode `basename $1 .tex` ; if [ -f `basename $1 .tex`.toc ]; then latex -interaction nonstopmode `basename $1 .tex` fi ; if grep "AmS-TeX error" `basename $1 .tex`.log > /dev/null ; then amstex -interaction nonstopmode `basename $1 .tex` amstex -interaction nonstopmode `basename $1 .tex` if [ -f `basename $1 .tex`.toc ]; then amstex -interaction nonstopmode `basename $1 .tex` fi fi ; if grep 'LaTeX Error: Missing \\begin{document}' `basename $1 .tex`.log > /dev/null ; then tex -interaction nonstopmode `basename $1 .tex` tex -interaction nonstopmode `basename $1 .tex` if [ -f `basename $1 .tex`.toc ]; then tex -interaction nonstopmode `basename $1 .tex` fi fi ; dvips -o `basename $1 .tex`.ps `basename $1 .tex`.dvi ; ps2pdf `basename $1 .tex`.ps ; open -a "Preview" `basename $1 .tex`.pdf ; cd $present_location ; if [ -f `basename $1 .tex`.idx ]; then /bin/rm `basename $1 .tex`.idx fi }