[OS X TeX] Error with graphicx/keyval
Margarida Mello
agram.mello at gmail.com
Fri Aug 13 15:16:51 EDT 2010
Hi,
don't quite know why it's not working, but there is another way around:
\newlength\larg
\setlength{\larg}{1in}
\begin{document}
\includegraphics[width=\larg]{filename}
\end{document}
Best regards,
Margarida
> Message: 1
> Date: Fri, 13 Aug 2010 13:49:21 -0500
> From: Chris Goedde <cgg.lists at gmail.com>
> Subject: [OS X TeX] Error with graphicx/keyval
> To: TeX on Mac OS X Mailing List <MacOSX-TeX at email.esm.psu.edu>
> Message-ID: <D89222F8-2C61-4EB1-8FBA-31D5DAE777D1 at gmail.com>
> Content-Type: text/plain; charset=us-ascii
>
> 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 MacOSX-TeX
mailing list