tags:

views:

1639

answers:

2

I'm trying to include an EPS figure in a document that will be compiled using pdflatex. Of course, the picture can be converted to pdf using epstopdf (which comes with the MikTeX distribution). Is there any way to do this on the fly, that is, make pdflatex do the conversion?

I'm looking for such a solution because I want to set up an easy-to-learn environment for students. Ideally, the converted picture is placed in the directory that also contains the original .eps, and the .pdf is used if available.

+1  A: 

I would recommend using latex-mk which is a nice way to have a very simple Makefile for latex construction. Of course you can have eps file converted to pdf, or fig to eps, etc, during the build process.

Currently my Makefile look like that :

NAME=report
TEXSRCS=report.tex
BIBTEXSRCS=biblio.bib
USE_PDFLATEX=true
VIEWPDF=open # cause i'm on osx, gv for most unix
XFIGDIRS=img

## For osx users :
include /opt/local/share/latex-mk/latex.gmk

## For unix users :
#include /usr/share/latex-mk/latex.gmk

When I invoke make, the first thing it does is converting some .fig into .pdf files. I'm pretty sure it would do the same with eps files.

claferri
+2  A: 

The relevant answer in the TeX FAQ points to epstopdf.sty (pdf documentation).

Jouni K. Seppänen
And if you load it like this \usepackage[update,prepend]{epstopdf} the EPS file will be automatically re-converted to PDF if it's changed.
Will Robertson