#! /bin/sh

# TeX/Mathematica Mathematica 1.2 -> 2.0 graphics conversion
# 12/20/91 dan@chem.bu.edu

# BINDIR set by tex-mma-install
bindir=/usr8/dan/bin

if [ $# -lt 1 ]
then
	echo Usage: $0 file1 [ file2 ... ]
	echo Convert TeX/Mathematica Mathematica 1.2 graphics to 2.0 format
	exit 1
fi

while [ "$1" != "" ]
do
	if ( grep -s "TeX/Mathematica prologue tex-mma-2.0" $1 )
	then
		echo "File $1 already converted"
	else
		echo "%!" > texmma$$.tmp
		echo "%%For TeX/Mathematica prologue tex-mma-2.0" >> texmma$$.tmp
		sed -f $bindir/tex-mma-convert.sed $1 >> texmma$$.tmp
		mv texmma$$.tmp $1
	fi
	shift
done
