Some TeX Developments

Coding in the TeX world

EPS graphics with PDF(La)TeX

with 9 comments

One issue a lot of people find confusing with (La)TeX is the rules about which types of graphic files work with which engines. EPS files are fine when going via the DVI route, but do not work with direct PDF creation. The solution is to turn the EPS files in PDFs, and the problem goes away. However, there is then the question of how to do the conversion.

For most documents, having to convert every file by hand is not a sensible choice. The next nearest thing is the epstopdf package, which will do the same thing but from within a LaTeX run. However, it needs \write18 enabled, and this is not always desirable. More importantly, a lot of people who struggle with the graphics problem do not know how to turn on \write18 anyway. A good way around has been added to the latest version of TeX Live, which is currently in the final testing stages. TeX Live 2009 has some restricted \write18 functions enabled as standard, and also has a version of epstopdf “built in”. The result is that EPS files are automatically converted to PDF files, in a transparent manner. Of course, this only happens if the PDF does not also exist! At the moment, this feature is not in MiKTeX 2.8, so it is one reason to favour TeX Live 2009 even on Windows.

There are places where epstopdf will not help: for example, when using psfrag or pstricks. There, the best solution will either be auto-pst-pdf or pstool. Both are written by Will Robertson, and both need \write18 enabled to work. pstool is more efficient (it only re-creates graphics as needed), but for some cases on auto-pst-pdt will work. Will has documented both packages very well, so the best way to learn about them is to have a read of the documentation.

Written by Joseph Wright

September 28th, 2009 at 4:29 pm

Posted in LaTeX,LaTeX3

Tagged with , , , ,

9 Responses to 'EPS graphics with PDF(La)TeX'

Subscribe to comments with RSS or TrackBack to 'EPS graphics with PDF(La)TeX'.

  1. Cool. Will upgrade to Texlive 2009 once it’s released!


    28 Sep 09 at 5:16 pm

  2. The binaries for TeX Live 2009 are pretty stable. According to Karl Berry, all that is left to really do is translations. Expect a release in a few days, I think.

    Joseph Wright

    28 Sep 09 at 5:17 pm

  3. According to the MiKTeX 2.8 release notes it has also \wite18 partially enabled.

    Best regards

    T. Donig

    28 Sep 09 at 6:06 pm

  4. Yes, but currently MiKTeX doesn’t have the “auto-epstopdf” idea that TeX Live does. It’s a good idea for helping new users, so I’d imagine it will in time appear in MiKTeX as well.

    Joseph Wright

    28 Sep 09 at 7:05 pm

  5. […] a few seconds ago from seesmic […]

  6. […] are some websites saying that the above doesn’t work in MikTeX 2.8, but it works for […]

  7. Could someone point to an explanation of what \write18 means?

  8. Konrad,

    I’ll put a short post together in a little while: should have thought of this earlier!


    Joseph Wright

    6 Oct 09 at 9:03 pm

  9. […] recently talked about converting eps files to pdf format, and mentioned that to do it from within TeX, you need write18 enabled. However, I failed to say […]

Leave a Reply