#! /bin/sh
#
# The script is originary contributed by 
# Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
# 	modified by Youjiro UO to support of eqn format formura
#
# Expected usage:
#	%filter "eqn2eps.sh eqn1"
#	1 over sqrt {ax sup 2+bx+c}
#	%endfilter
#	%center, image "eqn1.eps" 0 400 400 1
#
# temporary filename (without .eps suffix)
tmp=$1

echo '.EQN' > $tmp.eqn
echo '.EQ' >> $tmp.eqn
cat >> $tmp.eqn
echo '.EN' >> $tmp.eqn
groff -e $tmp.eqn > $tmp.ps
ps2epsi $tmp.ps $tmp.eps
/bin/rm -f $tmp.eqn $tmp.ps 
