I have a little problem: I am not able to put an image in my document. This is how I start:

















and this is the error report:

ERROR: LaTeX Error: Cannot determine size of graphic in mol.png (no BoundingBox).

--- TeX said ---

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

l.67 \includegraphics{mol.png}

Some months ago I used the same procedure and it worked.

I even tried to reproduce the .dvi file from the .tex file that I wrote some months ago but today doesn't work.

Another question: how can I produce a .pdf file from a .tex file? I forgot it.

I'm working on debian using emacs

  • 1
    Welcome to TeX.sx!
    – user11232
    Commented Jan 22, 2013 at 15:06
  • Your picture may be damaged; normally a png picture contains its dimensions. To produce a pdf: pdflatex source.tex, where source.tex is your main file (the one that contains your preamble) Commented Jan 22, 2013 at 15:10
  • Welcome to TeX.sx! This question is very similar to MikTex error for PNG images when trying to produce DVI and Cannot determine size of graphic. Please take a look at it as the information there might help you. If so, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find answers quickly. If not, please edit your question here to explain why so that people can better focus their attention to help you. Commented Jan 22, 2013 at 15:54

2 Answers 2


If you use the command latex (making dvi) you need to specify the natural size the image natwidth=... natwidth=... (not width= as that tries to scale to that size but still needs the natural size. If you use the command pdflatex (making pdf directly) Then the system can read the file and determine its natural size automatically. In either case it is usually a good idea to omit the extension .png then if different systems understand different image formats they will each pick up the right format.


If you use the AucTeX-mode with your Emacs, you can switch the output type between pdf and dvi by typing C-c C-t C-p. Then AucTeX uses pdflatex which handles png-files by default, as @David Carlisle mentioned in his answer.

To have pdf output enabled by default with AucTeX, you can put something like this in our .emacs: (setq TeX-PDF-mode t)

To enable it just for the one particular file each time it is loaded, add something like this to the end of your file:

%%% Local Variables:
%%% mode: latex
%%% TeX-PDF-mode: t
%%% End:

I hope this is helpful.

Not the answer you're looking for? Browse other questions tagged .