Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\documentclass{article}
\usepackage[pdftex]{graphicx}
\begin{document}

\includegraphics[scale=0.5,angle=90]{histogram_DSC_activity.eps}

\section{Title}
\end{document}

when I change it to

\usepackage{graphicx}

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
1  
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

1 Answer 1

up vote 3 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

 
discard

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.