[OS X TeX] Error with graphicx/keyval

Chris Goedde cgg.lists at gmail.com
Fri Aug 13 20:49:21 CEST 2010


Hi all,

Can someone explain to me why the following doesn't work, and what would work instead?

\documentclass[11pt]{article}

\usepackage{graphicx}

\newcommand{\Size}{width=1in}

\begin{document}

\includegraphics[\Size]{testfig}

\end{document}

The error I get is ! Package keyval Error: width=1in undefined.

I understand why keyval is involved, it's used internally by \includegraphics. But why does my \Size command cause keyval to choke? If I want to put the size argument to \includegraphics inside a command, what should I do instead?

(Larger picture is that I'm updates some very old macros I use for placing figures to make them more general/flexible/useful, and I want to construct the size for the figure programmatically from the arguments I feed the macros.)

Thanks.

Chris Goedde




More information about the macostex-archives mailing list