#!/usr/bin/perl
#a simple script to convert a file with epic and eepic
#commands into an eps file.  The eps file can then be 
#converted to a pdf file,  or to a png file.
#example with my.tex, which has the epic commands:
#tex2eps my.tex
#epstopdf my.eps
#convert -density 300x300 my.eps my.png
$infile=shift @ARGV;
$stuff='\documentclass{article}
%\usepackage{atmosdyn}
\usepackage{epic,eepic,color}
\usepackage{graphicx}
\textwidth=6.5in
\oddsidemargin=0in
\evensidemargin=0in
\textheight=9.0in
\pagestyle{empty}
\begin{document}
\input{'.$infile.'}
\end{document}';
open TEMP,">temp.tex";
print TEMP $stuff;
close TEMP;
system("latex temp.tex");
system("dvips -o temp.ps temp.dvi");
system("ps2eps -f temp.ps");
$eps=$infile;
$eps=~s/\.tex$//;
$eps=$eps.'.eps'; 
system("mv temp.eps $eps");
print "$eps is ready for you!\n";

