/usr/bin/eqn2eps is in mgp 1.13a+upstream20090219-7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #!/bin/sh
#
# The script is originary contributed by
# Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
# modified by Youjiro UO to support of eqn format formula
# modifictaions by Christoph Dalitz:
# - caching mechanism added
# - support for eqn/eps files in different directory
#
# 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
# in case a different directory is given:
datadir="`dirname $tmp`"
if [ ! -z "$datadir" ]
then
tmp="`basename $tmp`"
cd "$datadir"
fi
# target eqn file and temporary new file
eqn=$tmp.eqn
eqnnew=$tmp.eqn.new
# write new eqn file
echo '.EQN' > $eqnnew
echo '.EQ' >> $eqnnew
cat >> $eqnnew
echo '.EN' >> $eqnnew
# exit when no change
test -e $tmp.eps && test -e $eqn && diff $eqn $eqnnew >/dev/null 2>&1 && {
/bin/rm -f $eqnnew
exit 0; }
# otherwise process eqn file
mv $eqnnew $eqn
groff -e $eqn > $tmp.ps
ps2epsi $tmp.ps $tmp.eps
/bin/rm -f $tmp.ps
|