# Include EPS files in LaTeX

Recently I wanted to include a directed graph in a LaTeX doc­u­ment. I was run­ning dot on the graph file
 \$ dot -Tps2 nfa.dot > nfa.eps 
to receive the EPS file which I wanted to include in LaTeX. Run­ning TeXShop with pdfla­tex for type­set­ting on a file con­tain­ing
 \begin{figure}[!htb] \centering \includegraphics[scale=.7]{nfa.eps} \caption{Digraph.} \label{fig:digraph} \end{figure} 
how­ever returns the error
 ! LaTeX Error: Unknown graphics extension: .eps. 

This can be resolved by adding
 \usepackage{epstopdf} 
which allows to con­vert eps images to pdf for use with pdfla­tex. This works per­fect.

## 90 thoughts on “Include EPS files in LaTeX”

1. I’m quite new on latex and I need to include eps files for a report. I’m try­ing to make epstopdf work but with­out any suc­cess… I’m begin­ning to be depressed.
I get the fol­low­ing error:
! Pack­age pdftex.def Error: File ‘state_correlation_diagram-eps-converted-to.pd
f’ not found.

Please can you help me?

Antoine

• Are you sure the path to your pdf file is correct?

2. Thank you! I really spent a lot of time to fig­ure this out.
This really helped.

• that did it !
{epstopdf} was not suf­fi­cient,
with pdf­TeX, Ver­sion 3.1415926–1.40.10 (TeX Live 2009/Debian)

THX a lot !!

• Have to revise my pos­i­tive answer : on my Mik­TeX on Win7 nei­ther of the two do work.
(Maybe epstopdf would, but it can’t find the executable.)

IIRC, on my Debian box it finally also did NOT work — there were no more error messages(that’s why I cried vic­tory), but blanks instead of fig­ures in the final output.

Thanks a lot in advance if you have any fur­ther sug­ges­tions.
(e.g. what to do as to get & install the epstopdf executable).

PS: con­vert­ing by hand is not an option, too many fig­ures (in sev­eral papers I con­tinue to receive as edi­tor).
On linux I might be able to write a script (but no clue on the epstopdf com­mand line options ?) but I cur­rently have only access to a Win7 box !

• For Mik­Tex Win7 didn’t work at the beg­gin­ing, then I put both of the pack­ages (\usepackage{epstopdf} \usepackage{epsfig}) AT THE END of the list of pack­ages. That solved the prob­lem, try ti!.

3. Thank you sooo much…It really works…after two hours strug­gled finally I got it from your link. thank you soo much

4. Hi,
I got this warn­ing in Kile, please help me to fix it

epstopdf warn­ing: “Shell escape fea­ture is not enabled.”

Thanks.
Bal

5. Thanks, saved a lot time

6. thanks to you.but i face a prob­lem, i can not see the page num­ber at bot­tom cor­rectly. pls help me to solve the problem.

7. It still does not work, ( I have added the two pack­ages). Is is pos­si­ble that the rea­son is that I com­pile with Latex=>PDF directly?

8. Thanks.

How­ever, I am expe­ri­enc­ing a prob­lem. For cer­tain graph­ics in .eps for­mat the epstopdf pro­duces a .pdf that con­tains no image (just a blank pdf page).

Exam­ple:

\documentclass[landscape]{article}

\usepackage{tikz}
\usetikzlibrary{chains}
\usepackage{epstopdf}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[
start chain=going right,
dia­gram item/.style={
on chain,
join
}
]
\node [
dia­gram item,
label=center:Internet
] {\includegraphics{cloud}}; <—-this work. If swapped for another image it fails.

\end{tikzpicture}
\end{document}

Could you help?

9. I had the same prob­lem. At first hand the pack­age epstopdf solve the prob­lem, but as I use \psfrag to add some text on the fig­ure these labels will not appear on it.
I read that the using pack­age “graph­icx” and “eps­fig” should solve the ques­tion and I’ve tried them, but no suc­cess: the error mes­sage “!LaTeX Error: Unknown graph­ics exten­sion: .eps”.
By the way I’m using TeX­works v. 0.4.4 r1003 Mik­TeX 2.9 64-bit.

10. \documentclass{article}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!htb]
\cen­ter­ing
\includegraphics{new.eps}
\caption{Digraph.}
\label{fig:digraph}
\end{figure}
\end{document}

I am quite new to latex. This is what I have writ­ten in latex to add image.But i got ! Pack­age pdftex.def Error: File ‘new-eps-converted-to.pdf’ not found.

11. same :’( Error =
(./title.tex
Pack­age epstopdf Info: Source file:
(epstopdf) date: 2006-11-09 16:07:30
(epstopdf) size: 124412 bytes
(epstopdf) Out­put file:
(epstopdf) Com­mand:
(epstopdf) \include­graph­ics on input line 15.
runsystem(epstopdf –outfile=crest-eps-converted-to.pdf crest.eps)…disabled.
Pack­age epstopdf Info: Result file: .
! Pack­age pdftex.def Error: File ‘crest-eps-converted-to.pdf’ not found.

with:
\usepackage{subfigure,epsfig,amstext,floatfig,alltt,fancyhdr,setspace,amsmath}
\usepackage{epstopdf,epsfig}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{ifsym}
\usepackage[toc]{glossaries}

any help would be much appreciated!

12. To all the peo­ple that have this problem:

Pack­age pdftex.def Error: File ‘some_file_converted.pdf’ not found.

even if they are using all the required libraries, the solu­tion is to write the file name with­out the exten­sion EPS, in this case you should only write:

\includegraphics{some_file_converted}

13. Thank you! I really spent a lot of time to fig­ure this out.
This really helped.