#!/bin/sh
# handle latex file for html, expects args %f %S
set -e			# die on any error
BASE=`basename $2 .tex`
IN=$2			# input file
OUT=$BASE.gif		# output file
TMP=$BASE.eps		# temporary file

[ -f "$IN" ] || exit 1	# ensure our file exists
# make sure our temp file does not already exist
if [ -f "$TMP" ]; then
   echo "$0: $TMP is in the way" 1>&2
   exit 1
fi

/usr/lib/sdc/bin/latex2eps- "$IN" "$TMP" 1>&2
/usr/lib/sdc/bin/eps2html "$TMP" "$TMP" 1>&2
rm -f "$TMP"