[texhax] keyval package

Chris Bourke cbourke at cse.unl.edu
Tue Mar 22 18:42:43 CET 2005



I'm finding the keyval package documentation confusing; first a question:

Up to now, I've avoided using the keyval package.  To get the same effect,
I define something like

\DeclareOption{font=sanserif}{ <my code here> }

which simulates what the keyval package is doing.  My question is, if I
continue to do this, will there be any problems?  Can I use this cheap
trick instead of using keyval?

I am trying to convert everything over to use keyval, but its not working
so far.  For example,

\define at key{font}{sanserif}{ <my code here> }

by iteself, doesn't work.  Not only that, but when I use
\usepackage[font=sanserif]{MyPackage}, it throws a Warning (unknown
option).  I've check and rechecked the documentation, but It's not making
sense to me.  Do I have to use \PassOptionsToPackage somehow?  Do I have
to previously declare the entire set of values explicitly?  I've been
looking at some other packages that use keyval but have the same problems.
Does anyone have a *minimal* example that works?


-----------------------------------------------

Chris Bourke
cbourke at cse.unl.edu
http://www.cse.unl.edu/~cbourke



More information about the texhax mailing list