[texhax] EPS for latex/dvips and PDF for pdflatex

Hartmut Henkel henkel at vh-s.de
Fri Jun 13 11:38:37 CEST 2003


This is more a matter for make/a Makefile, which does this automatic for
you; e. g. convert all xfig files in some directory into .ps, .eps, and
.pdf:

all:    alleps allps allpdf

alleps: $(patsubst %.fig,%.eps,$(wildcard *.fig))

allps:  $(patsubst %.fig,%.ps,$(wildcard *.fig))

allpdf: $(patsubst %.fig,%.pdf,$(wildcard *.fig)) \
        $(patsubst %.eps,%.pdf,$(wildcard *.eps))

%.eps:  %.fig
        fig2dev -Leps $< > $@

%.ps:   %.fig
        fig2dev -Lps -z A4 -c $< > $@

%.pdf:  %.eps
        epstopdf $<

%.pdf:  %.ps
        epstopdf $<

Beware: The indentation MUST be done by TABs! If you only need .eps ->
.pdf conversion, you can strip this down...

Greetings Hartmut


On Fri, 13 Jun 2003, zsdc wrote:

> I wrote a little shell script, update-epdfs, which converts every *.eps
> files to .pdf with epstopdf unless the pdf files are already newer than
> eps. You might find it useful:
>
> #!/bin/sh
> # 2003-06-13T09:50:02+0200
> # update-epdfs by zsdc at wp.pl
> # converts eps to pdf files in the working directory using epstopdf
> for e in *.eps; do
>     [ ! -e $e ] && echo No *.eps files. && exit
>     p=`echo $e | sed s/eps$/pdf/`
>     [ $p -nt $e ] && echo $p is up to date. && continue
>     echo -n "$p epstopdf... "
>     epstopdf $e -o=$p >/dev/null 2>&1 && echo Done. || (echo ERROR. &&
> rm $p)
> done
>
> It's kind of Unix-centric, I guess. If anyone who can't run it would
> like, I can translate it to Perl and post it here as well.


------------------------------------------------------------------------
Hartmut Henkel, von Hoerner & Sulger GmbH, Schwetzingen, Germany
------------------------------------------------------------------------


More information about the texhax mailing list