2

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:

\begin{figure}
\centering
\includegraphics[scale=0.5]{time_elapsed.pdf}
\label{fig5}
\end{figure}

So how to solve the problem?

6
  • 1
    Which driver you are using (pdfTeX, LuaTeX, XeTeX, dvips, dvipdfm, ...)? Commented May 14, 2013 at 21:46
  • @HeikoOberdiek:I have updated my post, it is a different error msg now, I dont know how to fix it.
    – daiyue
    Commented May 14, 2013 at 21:48
  • 2
    You're probably using latex which only accepts EPS files and not PDF.
    – egreg
    Commented May 14, 2013 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
    Commented May 14, 2013 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
    Commented May 14, 2013 at 22:04

2 Answers 2

4

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

\documentclass[preview]{standalone}
\usepackage{graphicx}

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

You will get an output as follows.

enter image description here

Useful links:

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

! 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?

You must log in to answer this question.

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