# Converting eps to pdf

Now that there is a way to sync a pdf file and tex file in both direc­tions, the only remain­ing rea­son to use dvi files is when the graph­ics are in eps format.

How­ever, that prob­lem has also been solved for those using Mik­TeX 2.8 or TeXLive 2009. In Mik­TeX 2.8, sim­ply include the pack­age epstopdf along with graphicx. (As noted in the com­ments below, even this step is not nec­es­sary in TeXLive 2009.) Then when you use pdfla­tex, the eps files will be auto­mat­i­cally con­verted to pdf at com­pile time. (The con­ver­sion only hap­pens the first time you process the file, and is skipped if there is already a pdf file with the same name.)

For exam­ple:

 \documentclass{article} \usepackage{graphicx,epstopdf} \begin{document} \includegraphics[width=\textwidth]{fig1} \end{document}

Then even though the only graph­ics file avail­able is fig1.eps, this will still be processed ok using pdfla­tex or pdf­tex­ify. On the first pass, a new file called fig1-eps-coverted-to.pdf is cre­ated and inserted at the appro­pri­ate place. See the doc­u­men­ta­tion for more options and details.

Thanks to Joseph Wright for bring­ing this to my attention.

Dvi is dead. Long live pdf.

### Related Posts:

• http://www.texdev.net/ Joseph Wright

The dif­fer­ence between TeX Live 2009 and MiK­TeX 2.8 is how they han­dle things if you don’t load epstopdf. TeX Live 2009 “includes” it in graphic(s/x), so that you can include EPS graph­ics even with­out load­ing epstopdf. Cur­rently, MiK­TeX doesn’t do that: you still have to explic­itly load it.

What both sys­tems do now do is have a restricted ver­sion of \write18 enabled by default. So epstodpf (and a few other things, such as run­ning Bib­TeX auto­mat­i­cally) work with­out need­ing to enable \write18 for everything.

• http://robjhyndman.com Rob J Hyndman

Thanks for the clar­i­fi­ca­tion. I’ve edited the post accordingly.

• Aleks Aris

I did this. It doesn’t work on Mik­TeX 2.8.
The latex file com­piles and I see a blank fig­ure in the place where the fig­ure should be. What’s wrong?

• Aleks Aris

I also tried using the pack­age epspdf­con­ver­sion and that didn’t work, too.

• http://robjhyndman.com Rob J Hyndman

Aleks. It is impos­si­ble for me to tell what’s wrong. Look in your log file and see if there are errors. It works for me and for hun­dreds of other users. I sug­gest you send ques­tions to http://​tex​.stack​ex​change​.com.

• http://www.davidjmoore.com David Moore
• gin

Well, epstopdf does not embed fonts into pdf by default. Is there a neat option in latex to make epstopdf embed fonts?

• Abby

Hi is there a way to make epstopdf update an already cre­ated pdf? i.e say I make changes to the .eps file, how do I get it so that it will gen­er­ate an updated pdf file?
Thanks!

• http://robjhyndman.com Rob J Hyndman

Delete the exist­ing pdf file.

• matt

you can add the file exten­sion at the end of the file name

documentclass{article}
usepackage{graphicx,epstopdf}
begin{document}
includegraphics[width=textwidth]{fig1.eps}
end{document}

like that.

It will upgrade the image every time you cre­ate your file.