#!/bin/sh # texhelper: A TeX helper script for MIME and Netscape # by Greg Kuperberg, version 1.1, 4/8/95 # # Usage: Save this script as an executable file called "texhelper" # and put the lines such as the following in a mailcap file # (subject to change if tex becomes a registered Media Type): # # applications/x-tex; texhelper tex %s # applications/x-latex; texhelper latex %s if test $# -gt 1; then TYPE=$1; SOURCE=$2; else TYPE="tex"; SOURCE=$1; fi /bin/mkdir /tmp/th$$; if test $# -gt 0; then /bin/cp $SOURCE /tmp/th$$/document.tex; else /bin/cat > /tmp/th$$/document.tex; fi cd /tmp/th$$; $TYPE "\nonstopmode\input document" 2>&1 > /dev/null; if /bin/grep -s 'Label(s) may have changed' document.log; then $TYPE "\nonstopmode\input document" 2>&1 > /dev/null; fi xdvi document.dvi; cd /tmp; /bin/rm -rf th$$;