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.eps

to receive the EPS file which I wanted to include in LaTeX. Running TeXShop with pdflatex for typesetting on a file containing


however returns the error

! LaTeX Error: Unknown graphics extension: .eps.

This can be resolved by adding


which allows to convert eps images to pdf for use with pdflatex. This works perfect. 😎

118 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 trying to make epstopdf work but without any success… I’m beginning to be depressed.
    I get the following error:
    ! Package pdftex.def Error: File `state_correlation_diagram-eps-converted-to.pd
    f’ not found.

    Please can you help me?

    Thanks in advance.

      1. Thanks for answering. It is actually in the same folder. Besides, even with the absolute path it doesn’t work.

    1. that did it !
      {epstopdf} was not sufficient,
      with pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)

      THX a lot !!

      1. Have to revise my positive answer : on my MikTeX on Win7 neither 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 victory), but blanks instead of figures in the final output.

        Thanks a lot in advance if you have any further suggestions.
        (e.g. what to do as to get & install the epstopdf executable).

        PS: converting by hand is not an option, too many figures (in several papers I continue to receive as editor).
        On linux I might be able to write a script (but no clue on the epstopdf command line options ?) but I currently have only access to a Win7 box 🙁 !

        1. For MikTex Win7 didn’t work at the beggining, then I put both of the packages (\usepackage{epstopdf} \usepackage{epsfig}) AT THE END of the list of packages. That solved the problem, try ti!.

  2. Thank you sooo much…It really works…after two hours struggled finally I got it from your link. thank you soo much

  3. Hi,
    I got this warning in Kile, please help me to fix it

    epstopdf warning: “Shell escape feature is not enabled.”


      1. Hi Dirk Raffel,

        Thanks a lot for your help.
        After fixing that error, I got other one “! Package pdftex.def Error: File ` Figures/va.pdf’ not found.
        I used linux with texlive and also Miktex windows, but not successful.

        Please help me about this.

        Thank you.

  4. It still does not work, ( I have added the two packages). Is is possible that the reason is that I compile with Latex=>PDF directly?

  5. Thanks.

    However, I am experiencing a problem. For certain graphics in .eps format the epstopdf produces a .pdf that contains no image (just a blank pdf page).



    start chain=going right,
    diagram item/.style={
    on chain,
    \node [
    diagram item,
    ] {\includegraphics{cloud}}; <—-this work. If swapped for another image it fails.


    Could you help?

  6. I had the same problem. At first hand the package epstopdf solve the problem, but as I use \psfrag to add some text on the figure these labels will not appear on it.
    I read that the using package “graphicx” and “epsfig” should solve the question and I’ve tried them, but no success: the error message “!LaTeX Error: Unknown graphics extension: .eps”.
    By the way I’m using TeXworks v. 0.4.4 r1003 MikTeX 2.9 64-bit.

  7. \documentclass{article}

    I am quite new to latex. This is what I have written in latex to add image.But i got ! Package pdftex.def Error: File `new-eps-converted-to.pdf’ not found.
    This error…Please help me about this

  8. same :'( Error =
    Package epstopdf Info: Source file:
    (epstopdf) date: 2006-11-09 16:07:30
    (epstopdf) size: 124412 bytes
    (epstopdf) Output file:
    (epstopdf) Command:
    (epstopdf) \includegraphics on input line 15.
    runsystem(epstopdf –outfile=crest-eps-converted-to.pdf crest.eps)…disabled.
    Package epstopdf Info: Result file: .
    ! Package pdftex.def Error: File `crest-eps-converted-to.pdf’ not found.


    any help would be much appreciated!

  9. To all the people 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 solution is to write the file name without the extension EPS, in this case you should only write:


  10. Hi,
    I am using LEd I have tried all the explanations above which have allowed the file to convert with warnings but not errors as if the file is going to work out.
    Example:LaTeX /b/c12/cWarning:/b/c0/c Reference `twofactions’ on page 12 undefined on input line 205.

    When I open the pdf file, I have all white boxes with the words {name}eps-coverted-to-pdf. No graphic appears though and I am wondering if I need to resize it or if there is another package I need to be aware of.

    Please help and thank you!

    1. I am also using LEd and found that I could not use eps files and the error message reads as “I could not locate the file with any of these extensions: .png,.pdf … JBIG2,.JB2” . So what I did is I included \usepackage{graphicx}
      \usepackage{epsfig} in the preamble in this order. It works. But once I don’t mention it in this order it does not works, I don’t know why. Hope it helps.

  11. The three commands below should be sufficient to graphics with .eps extension in TexMaker.

  12. the problem is: using \usepackage{graphicx}
    enables to use .eps files, but \psfragscan doesn’t find the letters in the plot anymore, so fonts ar not replaced anymore.
    any ideas?

  13. Im trying to include eps file . Im getting a blank box. I tried all the ways given above, I m getting
    class amsproc warning: when the draft option is used, the \includegraphics commamd will print blank place holder boxes for the graphics.

  14. Do you know how can I insert a ps file in my latex? It gives me the same error ! LaTeX Error: Unknown graphics extension: .ps.

  15. Guys, good evening. I am in hurry, cause i have to finish my thesis till 13 of October so i need some help. I have some plots from Grece and i want to insert them in Latex. I dont know how to make them .eps files. Can someone help me please?

    Thanks a lot!

  16. Hi,
    I used epstopdf and epsfig. But still unable to build a PDF with containing figures. Figure legends are coming in the buil pdf.
    Only error:
    No graphics package `graphic{s,x}’ loaded.

    Please help me.

Leave a Reply