[pdftex] Automatic .eps to .pdf conversion

Hartmut Henkel hartmut_henkel at gmx.de
Thu Jun 14 19:50:28 CEST 2001


> Message: 14
> Date: Thu, 14 Jun 2001 09:20:58 -0500
> From: Peter =?iso-8859-1?Q?Schr=F6der?= <ps at cs.caltech.edu>
> Organization: Caltech Multi-Res Modeling Group
> To: Heiko Oberdiek <oberdiek at ruf.uni-freiburg.de>
> CC: Martin =?iso-8859-1?Q?Schr=F6der?= <ms at artcom-gmbh.de>, pdftex at tug.org
> Subject: Re: [pdftex] MediaBox?
>
> ...
> One last question: is there a simple rule I can set up to automatically
> invoke eps to pdf conversion iff(!) my latex file is compiled with
> pdflatex (and no conversion when it is compiled with regular latex)? I
> don't want hand invoked perl scripts in there. That is too error prone.
>
> Peter

Try make, see the example Makefile below. It produces both x.ps and x.pdf,
generating .eps from .fig and .pdf from .eps if required. The number of
runs is kept minimum but sufficient for correct tableofcontents etc.

(All leading blanks must converted to TABs.)

.PRECIOUS: %.dvi
all:    x.ps x.pdf
x.dvi:  x.tex a.eps b.eps c.eps
x.pdf:  x.tex a.pdf b.pdf c.pdf

%.dvi:  %.tex
        $(SHELL) -c ' \
          touch $(<:.tex=.log); \
          if ! grep -q "This is TeX" $(<:.tex=.log); then \
            rm -f $(<:.tex=.aux); \
            rm -f $(<:.tex=.toc); \
            rm -f $(<:.tex=.lof); \
            rm -f $(<:.tex=.lot); \
            rm -f $(<:.tex=.out); \
            latex $<; fi;'
        $(SHELL) -c ' \
          latex $<; \
          while grep -c "Warning.*Rerun" $(<:.tex=.log); \
            do latex $<; done;'

%.pdf:  %.tex
        $(SHELL) -c ' \
          touch $(<:.tex=.log); \
          if ! grep -q "This is pdfTeX" $(<:.tex=.log); then \
            rm -f $(<:.tex=.aux); \
            rm -f $(<:.tex=.toc); \
            rm -f $(<:.tex=.lof); \
            rm -f $(<:.tex=.lot); \
            rm -f $(<:.tex=.out); \
            pdflatex $<; fi;'
        $(SHELL) -c ' \
          pdflatex $<; \
          while grep -c "Warning.*Rerun" $(<:.tex=.log); \
            do pdflatex $<; done;'

%.ps:   %.dvi
        dvips $<

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

%.pdf:  %.eps
        epstopdf $< > $@


Greetings Hartmut


------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
D-68723 Oftersheim, Germany
E-Mail: hartmut_henkel at gmx.de
http://www.circuitwizard.de
------------------------------------------------------------------------




More information about the pdftex mailing list