# 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 the following three commands: # # sudo mv birkmult.cls /usr/share/texmf-texlive/tex/latex/base/ # sudo chmod 444 /usr/share/texmf-texlive/tex/latex/base/birkmult.cls # sudo texconfig rehash # # and then try "show file.tex" 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 ; if [ -f `basename $1 .tex`.dvi ]; then dvips -o `basename $1 .tex`.ps `basename $1 .tex`.dvi fi ; if [ -f `basename $1 .tex`.ps ]; then ps2pdf `basename $1 .tex`.ps fi ; acroread /tmp/`basename $1 .tex`.pdf ; cd $present_location ; if [ -f `basename $1 .tex`.idx ]; then /bin/rm `basename $1 .tex`.idx fi }