When I run Andrew Robert's import.tex in MikTeX I get an error message saying that the image file is not found:

! LaTeX Error: File `chick' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.21   \includegraphics{chick}


I have put the image file (in this case chick.eps) in the same folder as import.tex.

  • 4
    You are probably use pdflatex instead of latex. The former is actually recommended but doesn't support EPS graphics but only JPG, PNG and PDF. – Martin Scharrer Nov 7 '11 at 0:09
  • Also, it appears that the file downloaded form the web site is called chick1, or chick2, etc and not chick so check the name. I got the error after downloading the file and hence noticed the different name then the file is importing. – Peter Grill Nov 7 '11 at 0:18
  • Thanks Martin. The problem was indeed that I am using pdflatex (that's default in miktex's texworks). I followed the instructions here to convert the eps to a pdf during the compilation. – Sverre Nov 7 '11 at 0:38
  • Also, the pdflatex in TeX Live 2010 and 2011 can automatically convert EPS graphics to their PDF equivalent. – Mike Renfro Nov 7 '11 at 1:00
  • 1
    @MartinScharrer: No. TeX Live has a list of save programm calls. So the default shell_escape = p at texmf.cnf together with repstopdf (the restricted/save variant of epstopdf) at the shell_escape_commands (that is default too) is enough. – Schweinebacke Nov 7 '11 at 10:18

You are probably use pdflatex instead of latex. The former is actually recommended but doesn't support EPS graphics but only JPG, PNG and PDF. You should convert the EPS to PDF using e.g. epstopdf. Newer versions of pdflatex from TeX Live should do this conversion automatically by running a restricted version (for safety reasons) called repstopdf.

  • 1
    You should never use convert to convert EPS to PDF. First of all, this would convert the EPS to a bitmap (embedded to a PDF). In case of JPGs embedded to EPS, they would be decompressed and the PDF would become very large. So please use repstopdf to convert EPS into PDF. This is, what TeX Live since 2010 would do on-the-fly and out of the box, if the defaults shell_escpape = p and the entry repstopdf for variable shell_escape_commands at the default texmf.cnf are not changed. – Schweinebacke Nov 18 '11 at 8:18
  • 1
    @Schweinebacke: Sorry, too early in the morning. I didn't had a coffee yet. I meant epstopdf but wrote convert. I use the latter very often for all raster images. – Martin Scharrer Nov 18 '11 at 8:24
  • Don't be angry but I've written a more detailed answer … – Schweinebacke Nov 18 '11 at 8:58
  • In fact, I suspect it's the lack of bounding box information in the pdf which causes pdflatex to complain that the file is missing even if it is actually there. – Andre Holzner Nov 22 '15 at 16:04
  • @AndreHolzner: No, if you write \includegraphics{chick} then the file is searched with all supported file extensions. Now, pdflatex is not supporting EPS files, so doesn't find chick.eps. If there would be a chick.pdf in the same directory it would use that one. – Martin Scharrer Nov 23 '15 at 12:27

Using MiKTeX you have to use the recommended graphics format depending on the engine you are using.

So, if you are using latex—mostly at a queue latex→dvips→pstopdf—you can only use EPS, PCX, BMP, MSP, PICT or PNTG, all of them with different file extensions and sometimes with additional endings. EPS is the most recommended file format with latex→dvips, because the dimensions of EPS may be detected by graphics/graphicx itself. For the other file formats you need additional bb-files with the dimensions or to use option boundingbox.

If you are using pdflatex with direct PDF output, you can only use PDF, JPEG, PNG and MPS. (Note: MPS is a subtype of EPS generated by MetaPost and needs parts of ConTeXt to be installed.)

With TeX Live since 2010, support for on-the-fly conversion of EPS to PDF has been added. This should be activated out if the box. The conversion consists in three parts:

  1. A graphics.cfg file, that supports file extensions .ps and .eps even, if pdflatex with direct pdf output is used.
  2. LaTeX package epstopdf, that uses shell escapes to convert eps to pdf on the fly using repstopdf.
  3. A texmf.cnf with settings shell_escpape = p and shell_escape_commands = repstopdf.

Because of this, you may use EPS with pdflatex and direct PDF output, if you are using TeX Live since 2010.

With MiKTeX you may use on-the-fly conversion, too. In this case you have to load LaTeX package epstopdf on your own (see the manual for more information) and you have to set command line option --enable-write18 at call of pdflatex. If you call pdflatex from within a LaTeX editor, have a look at the editor or the profile settings and the editor manual to find out, where you may add this command line option.

You may test the on-the-fly conversion using:

%%BoundingBox:100 100 172 172
100 100 moveto
72 72 rlineto
72 neg 0 rlineto
72 72 neg rlineto
100 100 moveto
/Times-Roman findfont
72 scalefont
(A) show

  You are using pdf\LaTeX. If you see the picture, on-the-fly conversion does work!
  You need to use pdflatex to test the on-the-fly conversion! You may see the
  original eps file without conversion now:


Instead of using on-the-fly conversion you may simply convert every EPS to PDF using epstopdf. In this case you may remove extra white space around the picture using pdfcrop.

Note, that sometimes the conversion to PDF results in PDFs with bad Bounding Box. In this case, you should search for %%PageBoundingBox at the PS file and copy the four dimensions at this line to the line %%BoundingBox at the begin or end of the file (replacing the values you'd find there). On-the-fly conversion will be use these new values at next run of pdflatex. If you are using manual conversion, don't forget to do it again.

To convert PDF to EPS the usage of pdftops --eps is recommended. This is a command line utility from xpdf. Note, that this is available not only for Linux, but for Windows too. Alternative you may use pdf2ps, a ghostscript command line utility. But the results may be not a good as the results of pdftops.

  • I miss the epstopdf loading. Let me point to Including pdf figures in Latex document using TexnicCenter. – Speravir Mar 8 '14 at 1:59
  • Thanks. Nice and detailed answer. Most importantly you provide simple solution to everyone. For instance, I didn't have to install TeX Live instead of MiKTeX and just added \usepackage{esptopdf}. This is especially important for the folks who are writing a paper close to the deadline and just need a quick solution. – Sergiy Belozorov Sep 1 '14 at 4:37

I had problem not being able to read the eps file using TeXworks. I fixed the problem by including the following line in the tex file:


I then called the file using:

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Heiko Oberdiek Apr 21 '14 at 23:33
  • Yepp, but one must take care that epstopdf is loaded after graphics/graphicx. In TeX Live this is not needed. See also my comment to Schweinebacke’s answer. – Speravir Apr 21 '14 at 23:39
  • A suggestion: Do us a favour and change your username to something more telling than "user1234". – Speravir Apr 21 '14 at 23:40

For what its worth, I tried all the above methods and none worked. Eventually, I found that TeXstudio was calling repstopdf and not epstopdf. repstopdf was symlinked to epstopdf under /usr/texbin. I removed the repstopdf symlink and recreated it to point to the same file that epstopdf was symlinked to after which it worked.

cd /usr/texbin
rm repstopdf
ln -s ../../texmf-dist/scripts/epstopdf/epstopdf.pl repstopdf

I am running TeXstudio v2.6.6 on Mountain Lion/Mac.

  • I'm also having the same problem with TeXstudio (v2.7.0 on OSX Mavericks 10.9.2). I tried it in Latexian and there was no problem, so it's definitely a TeXstudio issue. Your solution didn't work for me, unfortunately... – GTF Apr 3 '14 at 15:58
  • Ok, problem solved within TeXstudio's preferences. It has its own internal $PATH variable, which was set to an old (and no longer installed) TeXLive. Changing this to the current version fixed the problem. – GTF Apr 3 '14 at 16:00

The filecontents first line should be "%!PS" instead of "%!" to avoid "Invalid binary DOS header" from epstopdf.cpp available at

My setup is C:\Pub\Tex>pdflatex -version

MiKTeX-pdfTeX 2.9.4225 (1.40.12) (MiKTeX 2.9)

J. Gélinas

  • 1
    This does not answer the question. Instead, it appears as if you are providing the answer to another problem you are having. If so, please open a new question about your problem. – Sverre Sep 12 '15 at 14:37

Change pdflatex to xelatex, it solves the problem for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.