#!/bin/sh
# handle roff file for lout, expects args %f %S
set -e			# die on any error
BASE=`basename $2 .roff`
IN=$2			# input file
OUT=$BASE.eps		# output file
TMP=$BASE.tmp		# 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
 
gtbl "$IN" | groff -Tps - > "$TMP"
ps2epsi "$TMP" "$OUT" 1>&2

echo @IncludeGraphic{ \"$OUT\" }
