tags:

views:

33

answers:

2

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!

A: 

Not unless you are altering the package itself and adding your options.

Mica
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
A: 

Two options

  1. 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;
  2. 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