Hi, I would like to know if there's a way to use a command (something I create with \newcommand) in a package configuration). Something like \usepackage[someoption=\somecommand]{somepackage} Thanks for your help!
Also note that package options are fully expanded, which makes them sort of impossible to use for anything like this. (Not so with keyval options, though.)
Will Robertson
2010-01-06 02:58:01
A:
Two options
- You can check to see if a csname is defined using
\ifdef
in the package, so that defining\csname
as a macro before invoking\usepackage
can be checked. This isn't exactly what you asked, but it should, I guess, do what you want; - You can pass the name of a command as a string without the backslash (say, to
\input
) in the options, and then bind the command using\edef\inputcs{\def\passname#1{\csname#1\endcsname}\expandafter\passname\input}
.
Charles Stewart
2010-01-06 06:42:52