#!/bin/sh

rm -rf tmp
mkdir tmp

latexfilewithdir=inputs/example.tex
latexfile=`echo $latexfilewithdir | sed -e 's@^.*/@@'`
pdffile=`echo $latexfile | sed -e 's/[.]tex/.pdf/'`
epsfile=`echo $latexfile | sed -e 's/[.]tex/.eps/'`
povinc=`echo $latexfile | sed -e 's/[.]tex/.object/'`

cp $latexfilewithdir tmp/

cd tmp

pdflatex $latexfile

pstoedit -dt -pta -f ps -psarg  " -r2400x2400 " $pdffile >$epsfile

../bin/eps2pov $epsfile >$povinc

mv $povinc ..

cd ..

#rm -rf tmp

exit
