13

I'm trying to put a .pdf graphic in my LaTeX file. This is usually no problem for me. I use pdfLaTeX in TeXworks. The only difference this time seems to be that I'm using the style files from the journal Statistical Science (http://www.e-publications.org/ims/support/sts-instructions.html).

I've tried several solutions. This one and converting the pdf to .eps or .ps all make the error go away, but then there is just a big blank space where the image is supposed to be. Any ideas?

Edit: Here is the preamble:

\documentclass[dvips,sts]{imsart}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{figure}[h!]
\centering
\includegraphics[width =  \textwidth]{simLinkError.pdf}
\caption{Blah}  
\label{fig:sim1}
\end{figure}
\end{document}
zkurtz
  • 415
  • 4
    "Cannot determine size of graphic #1 (no Bounding Box)" error occour when we compile latex on a TeX file with non-eps images such as PDF/JPG/PNG etc. To fix this error: You need to run pdflatex on the TeX file. Otherwise you need to convert your image to EPS using convert and run latex on the TeX file. – Jagath Jul 17 '13 at 03:49
  • @JagathAR, as I mentioned, I am using pdfLaTeX on my TeX file. Is this different than pdflatex? – zkurtz Jul 17 '13 at 13:11
  • @dustin, no, [demo] is not there ... – zkurtz Jul 17 '13 at 13:12
  • 1
    Can you post a small example of your problem which has the preamble? – dustin Jul 17 '13 at 13:16
  • @dustin, see the updates to my question. I'm not sure how to post a minimal working example, as there are several style files involved. – zkurtz Jul 17 '13 at 13:51
  • I don't have the class but I improved your MWE so others who do have it can help. – dustin Jul 17 '13 at 13:57
  • 4
    Remove the dvips option to the class. This is all is needed. – egreg Jul 17 '13 at 13:58
  • @egreg: removing 'dvips' does it! Post as answer and I can give you credit, and bonus points for explaining why. I wonder why the 'dvips' option was included in the journal's example tex file, and is it a problem for everyone who tries to use graphics. – zkurtz Jul 17 '13 at 14:02

2 Answers2

20

Options to \documentclass are examined by all packages. So you're loading graphicx with the dvips option, which allows only EPS graphics to be imported and is nonsense when the engine is pdflatex. So remove it.

\documentclass[sts]{imsart}

In general dvips, pdftex or xetex should not be used even with packages that know them, such as

  • graphicx
  • hyperref
  • geometry

that can deduce the needed driver by themselves.

egreg
  • 1,121,712
  • Thanks again! I'd vote this up if I had enough reputation to do so. – zkurtz Jul 17 '13 at 14:17
  • 3
    @zkurtz Don't worry, you'll get it. And I really don't need more reputation, do I? ;-) – egreg Jul 17 '13 at 14:20
  • Using Texlipse under Project/Properties/Latex Project Properties output format pdf and build commands pdflatex have to be used instead of the corresponding dvi parameters. – Torsten May 08 '14 at 13:46
5
gs -o /dev/null -sDEVICE=bbox Input.pdf

yields

%%BoundingBox: 0 0 702 399
\includegraphics[bb=0 0 702 399]{Input.pdf}
Torbjørn T.
  • 206,688
PCofNYC
  • 61
  • 1
  • 3