Sunday, December 3, 2006

How to make pdflatex work with graphicx package

Once you have finished typesetting your brilliant paper with a bunch of precious artistic figures in eps files, most probably you want to create a pdf out of it. Sadly, it's not a straight forward process. If you use graphicx package, pdflatex will throw an error or produce a pdf with no figures in it.

You can still get a pdf by either by:
Generating a dvi file and then using dvipdfm to convert it to a pdf.

or
Using epstopdf to convert your figures from eps to pdf. Then you can use pdflatex.
For pdflatex to work, use

\includegraphics{figurefile}

instead of

\includegraphics{figurefile.eps}

Both latex and pdflatex will pick their own files.

To convert all eps files in current directory, use:

for f in *.eps; do epstopdf $f; done


For more details, check http://fiachra.ucd.ie/~gavin/docs/pdflatex_images.html

No comments: