All I am trying to include a pdf image in my tex file, but when I compiled the tex file, the console pop up the following error msg:

! LaTeX Error: Cannot determine size of graphic in time_elapsed.pdf (no Boundin gBox).

This is my code:


So how to solve the problem?

  • 1
    Which driver you are using (pdfTeX, LuaTeX, XeTeX, dvips, dvipdfm, ...)? May 14 '13 at 21:46
  • @HeikoOberdiek:I have updated my post, it is a different error msg now, I dont know how to fix it.
    – daiyue
    May 14 '13 at 21:48
  • 2
    You're probably using latex which only accepts EPS files and not PDF.
    – egreg
    May 14 '13 at 21:48
  • I have used a few eps files as well, so i can't use pdflatex, coz my other eps files wont be compiled
    – daiyue
    May 14 '13 at 21:51
  • Just convert the EPS files to PDF. Depending on your TeX distribution, this can even be automatic if you load the epstopdf package.
    – egreg
    May 14 '13 at 22:04

Try to compile the following with pdflatex. The simplest workflow should be like the following.


\includegraphics{example-image-a}% no need to explicitly specify the file extension.

You will get an output as follows.

enter image description here

Useful links:

  • 1
    If you include the mwe package it becomes a MWE.
    – percusse
    May 14 '13 at 21:50
  • @percusse: But it still works without mwe package. May 14 '13 at 21:51
  • Loading the mwe package once, makes the images to stay available even when the package is not loaded.
    – percusse
    May 14 '13 at 21:52
  • @percusse: I am trying to parse your sentence. May 14 '13 at 21:53

! LaTeX Error: Cannot determine size of graphic in time_elapsed.pdf (no Boundin gBox).

That looks very much like the error produced by latex when you try to include pure PostScript (.ps) image instead of encapsulated PostScript (.eps). Are you sure you are using pdflatex command for TeX-ing?

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.