# Include EPS files in LaTeX

Recently I wanted to include a directed graph in a LaTeX document. I was running dot on the graph file
 $dot -Tps2 nfa.dot > nfa.eps  to receive the EPS file which I wanted to include in LaTeX. Running TeXShop with pdflatex for typesetting on a file containing  \begin{figure}[!htb] \centering \includegraphics[scale=.7]{nfa.eps} \caption{Digraph.} \label{fig:digraph} \end{figure}  however returns the error  ! LaTeX Error: Unknown graphics extension: .eps.  This can be resolved by adding  \usepackage{epstopdf}  which allows to convert eps images to pdf for use with pdflatex. This works perfect. 😎 ## 123 thoughts on “Include EPS files in LaTeX” 1. Rick says: Thanks! Short and to the point :P. 2. macias says: Thank you! You are a life savior 🙂 After about a half an hour finally a _solution_. 3. Mark says: Thanks…! Just wondering: what is going wrong here that including an .eps does not work? (I had to generate the .pdf-files for my images using a pdf-printer, since ps2pdf chocked on the .ps-file that PSP created.) Regards, – Mark 4. Erry says: Thanks a lot! Right to the point.:) 5. Corina says: Thanks! You saved me a lot of time 🙂 6. Konstantin says: Thanks! 7. Praneeth says: hi i included that package \usepackage{epstopdf} and i am using kile in suse 11 and still i am getting errror msg like these PDFLaTeX] pra.tex => pra.pdf (pdflatex) [PDFLaTeX] finished with exit status 70 pra.tex:0: Shell escape feature is not enabled. [PDFLaTeX] 0 errors, 1 warning, 0 badboxes [ViewPDF] The file /home1/user009/Desktop/giri-latex/pra.pdf does not exist; did you compile the source file? Please help me…….. 8. Richard says: Finally, someone put up a SIMPLE solution to this problem! Thanks! 9. Thanks for the tip! Only one observation: To use epstopdf you need to enable system commands via \write18 Then you need to set shell_escape to ‘t’ (true) in /etc/texmf/texmf.cnf, otherwise the epstopdf command won’t run an the pdf won’t be genarated. I had to do this under Ubuntu, the default is set to false. Another option is to run the pdflatex command with ‘-shell-escape’ 1. tnt says: pdflatex -shell-escape techfile.tex This was for me necessary too in Ubuntu. thanks for adding this =) 2. Lerato says: Thanks I needed this. It has solved my problem 10. Name says: Thank you! Thank you! Thank you! 11. Luke says: Thanks! 12. Emanuel says: (/opt/local/share/texmf-dist/tex/latex/oberdiek/epstopdf.sty Package epstopdf Warning: Graphics driver file pdftex.def’ not found. ) What does it mean??? How can I fix this? Why is it so efforts demanding the inclusion of a .eps? 13. Vu Duc Thang says: thanks ! good tipp 14. Rayman says: Definitely is a good solution indeed ! However, make sure of that fact that you need to use \usepackage{graphicx} or \usepackage[pdftex]{graphicx}, before \usepackage{epstopdf}, else you will get ‘eps’ as an un-identifiable format. 15. Irina says: Hello, I am quite new to latex environment. I am using TexShop on a Mac an recently had problems with inserting a figure: \begin{figure}[h] \centering \includegraphics[width=16cm,draft=true]{//Users/PhD/LATEX THESIS/FIGURES THESIS/FIGURES THESIS CHAPTER 2//All data coverage SLP.pdf} \caption{Data coverage (\%) ICOADS SLP for four time periods} \label{fig:fig2.1} \end{figure} The figure is inserted, everything looks fine apart of the fact that on the top of the figure you can see the file name: //Users/PhD/LATEX THESIS/FIGURES THESIS/FIGURES THESIS CHAPTER 2//All data coverage SLP.pdf I really need to get rid of it somehow, but I did not manage. 16. jig_saw says: Hi, I am trying to use the following commands to attach an eps file as a figure in my document. But the figure becomes so small in the pdf file. How this can be solved? \begin{figure} \centering \includegraphics[width=2.2in,angle=-90]{Fig1.eps}\\ \caption{A sample line graph using colors which contrast well both on screen and on a black-and-white hardcopy}\label{Fig:1} \end{figure} 17. Pritam Mukherjee says: Very precise!!! Thanx. 18. Anders says: Thanks a lot, that works perfectly, and very simple! When I added it after all the other packages it worked, and before the others it didn’t work, probably good to add i after the other graphics packages. 19. Alper says: Thanks a lot, it ran, perfect. But may i have more quality converted figures 20. Crescentio says: Thanks to Dirk Raffel and Agaelebe for make my life better 21. edrux says: tnx, really. 22. Marco says: Thanks a lot!!! 23. dddddd says: all I can is, thankyou.. 24. Christiaan says: Note for dot users: You can also generate a pdf right away, so you don’t need this convert step. This seems to work fine:$ dot -Tpdf nfa.dot > nfa.pdf

25. Ramon says:

Finalmente alguém explicou direitinho!! YEah

26. diamond says:

Fantastic. This has bugged me for some time now.

Many thanks.

27. Joost Pastoor says:

Awesome, thanks.

28. Katie says:

Yipeeeee thanks!

29. ruslan abdulla says:

great. thanks

30. Kazeem says:

Thank you so much. I was getting nervous ahead of the deadline 😀 after spending too much time on this topic.

31. Saurabh says:

I get this error when i eps images with pdflatex with epstopdf package added

Package epstopdf Warning: Shell escape feature is not enabled.
……….
………

32. Ethel says:

hello
i am having problem in including an .eps file in latex.
i wrote the code :

\begin{figure}[ht!]
\centering {\includegraphics[width=3.3in]{ocs.eps}}
\caption{OCS}
\label{fig: ocs}
\end{figure}

but its showing error:

! Argument of \Gin@iii has an extra }.

\par
l.23 …g {\includegraphics[width=3.3in]{ocs.eps}}

?

33. rajya says:

thats to the point…short but terrific…thanks for that

34. enigma says:

Thank you!

35. sman says:

thank you very much! i found this very helpful!

36. imma be says:

thanks bro!!

37. Ali says:

Nice….Thank you so much. :))))))))))

38. Fred says:

Like many have said… short and sweet! Thanks!

39. Thanks a lot. I have wanted to use eps in pdflatex for a long time.

40. Khaled says:

Thanks!!!!!!

41. Ashanthi says:

Thanks a lot!

42. stefano says:

Thank you, is there anything similar for .PS files?

Thanks!
Worked for me

44. Kristian says:

5 years. Still helping people. Thank you very much.

45. Mac says:

I’ve been using TexWorks for a while now but have never been able to make .eps images work. I think this is due to, in a large part, the fact that I cannot find WHERE to save the images so Tex knows where to get them… I apologize if this is an obvious question, but I haven’t been able to find an answer!

46. Fran says:

Thanks !!

47. The inclusion of epstopdf doesn’t seem to be needed any longer, just included graphicx and the conversion happened automatically.

48. Sanghimangi says:

Thanks a lotttttttt for ur help yaar…. It just resolved my biggest query in an easier way…