[OS X TeX] EPS to PDF--en masse?

Maarten Sneep maarten.sneep at xs4all.nl
Mon Jun 7 00:27:53 CEST 2004


On 7 jun 2004, at 0:15, Thomas Braun wrote:

> I was using a csh batch for such a task some years ago (see below). 
> You need ghostscript for that (contributed by the i-installer). Copy 
> the patch-file lines in a texteditor and save it in the directory with 
> the epsfiles e.g. as allpdf.
>
> I hope this helps and keeps the quality. I had mixed experiences with 
> ghostscript (or the eps files produced by some programs).

pstopdf is meant for multipage ps files, not for eps files. the 
epstopdf script is meant for eps files. Another advantage is that it 
will figure out what to name the result, based on the original input.

I have a few other comments on your script, especially now that the 
default shell is bash, and no longer (t)csh:

> #/bin/csh

Start a (shell) script with #!/path/to/interpreter, and the shell will 
automagically find the right interpreter. Your script currently relies 
on being executed from csh, i.e. it will not work on the current 
default installation (the exclamation mark is important).

> set WORKFILE
> #
> foreach FILE ( *.eps )
>      set WORKFILE=`\ls $FILE | cut -d\. -f1`
>      echo "*****Converting "$FILE
>      ps2pdf $WORKFILE.eps $WORKFILE.pdf
> end
> echo "done"

An updated version:

#!/bin/csh

foreach f (*.eps)
     echo "converting: $f"
     epstopdf $f
end
echo "done"

-----------------------------------------------------
Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the macostex-archives mailing list