TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Took me 6 hours today and still doesn't work, the error is :

Package pdftex.def error PDF mode expected mf-texlive/tex/latex/pdftex-def/pdftex.def

Example document:




when I change it to


I get cannot determine size of graphic in the figure file. I check all remedy on google and here but ... also tried picture with pdf format.

share|improve this question
Just to confirm---are you using latex or pdflatex? – Sharpie May 8 '11 at 20:52
I am using latex – user5387 May 9 '11 at 5:02
Then it sounds like your EPS file is missing a bounding box. – Sharpie May 9 '11 at 5:05
up vote 5 down vote accepted

PDFLaTeX does not support EPS files. However, some modern LaTeX distributions will try to automatically convert it to a PDF image, which maybe this doesn't work in your case. It would be also possible that the size information, namely the bounding box, in that EPS file is missing.

If you are using latex, i.e. the DVI mode of LaTeX, which supports EPS then you should remove the incorrect pdftex option from the graphicx package. The packages should be able to figure out the used driver by themselves, so you should avoid such options anyway. If you are using pdflatex then it would be better to convert the EPS to a PDF file manually, e.g. using the epstopdf tool (I'm not sure if it comes with the Windows version, but I think so). You need to change the .eps extension to .pdf then, of course. You can also drop the extension and LaTeX will look for files with the given base name with all supported extensions, i.e. \includegraphics{file} will use file.eps for latex and file.pdf (or file.png, file.jpg) for pdflatex.

share|improve this answer
the order in which extensions are tried is .png, .pdf, .jpg, .mps, .jpeg, .jbig2, .jb2; after these, uppercase extensions are tried in the same order (with the exception of MPS). It's probably useful to remark this, since it can cause some head scratching. – egreg May 8 '11 at 21:53
@egreg: Thanks for mentioned that. I knew it but didn't recall the exact order. We should then also mention that the order can be changed by \DeclareGraphicsExtensions{<comma separated list of extensions>}. – Martin Scharrer May 8 '11 at 22:14
that might be useful; however users should always choose the best format for their pictures: PNG, PDF and JPEG are each suitable for their particular kind of pictures. – egreg May 8 '11 at 22:20
Seems pdflatex is a bit better ! Now I don't have picture on my preview ! – user5387 May 9 '11 at 6:55
@egreg could you elaborate about the ordering?! any simple example ?! – user5387 May 9 '11 at 6:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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