[Tex/LaTex] Undefined error when trying to include .eps

epsepstopdfgraphicsmiktexpdftex

\documentclass{book}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\includegraphics*[50pt,500pt][400pt,750pt]{figs/ch3/pda_anbn.eps}
\end{document}

Error says the \includegraphics line is undefined. I'm using Miktex 2.9.

Specifically the error message is "! Undefined control sequence.<argument> ...onverted-to.pdf image\GPT@AttrShort\ifx \GPT@print \ltx@empty... ...500pt][400pt,750pt]{figs/ch3/pda_anbn.eps}".

Note: I see the pdf is being generated, in the same folder, from the eps. So epstopdf is working. Could it be something wrong with the includegraphics syntax?

Best Answer

pdfTeX consists of TeX and the driver part, which produces PDF. Therefore it is able to detect the bounding/media boxes of the included image files. A manual specifying of the bounding box does not make much sense:

  • The user would have to determine the bounding box values. What's the bounding box of a PNG file? What is the bounding box of the fifth page of a ten page PDF file?

  • What's the bounding box, if the image file was given without extension and there are several choices with different internal bounding boxes?

  • What happens, if the image file changes. Who updates the bounding box data in the TeX file?

  • How to deal with rounding errors?

  • What is the interpretation of a user "lie", if the specified bounding box differs from the actual bounding box?

Therefore the driver pdftex.def does not support the manual specification of the bounding box, because it is not needed. If the user wants to have a portion of the image, there are options viewport and trim to specify this wish in a cleaner way. Option bb is treated as viewport with a warning.

Nevertheless the actual error of the two optional argument form of \includegraphics is a bug. A fix will have to replace it by a better error message or by a similar behavior as option bb. (I have not yet analyzed the internals.)

Related Question