next up previous contents
Next: Commands within option code Up: Commands for class and Previous: Loading files

Option declaration

 

The following commands deal with the declaration and handling of options to document classes and packages.

There are some commands designed especially for use within the <code> argument of these commands (see below).


\DeclareOption {<option-name>} {<code>}

This makes <option-name> a `declared option' of the class or package in which it is put.

The <code> argument contains the code to be executed if that option is specified for the class or package; it can contain any valid LaTeX2e construct.

Example:

   \DeclareOption{twoside}{\@twosidetrue}


\DeclareOption* {<code>}

This declares the <code> to be executed for every option which is specified for, but otherwise not explicitly declared by, the class or package; this code is called the `default option code' and it can contain any valid LaTeX2e construct.

If a class file contains no \DeclareOption* then, by default, all specified but undeclared options for that class will be silently passed to all packages (as will the specified and declared options for that class).

If a package file contains no \DeclareOption* then, by default, each specified but undeclared option for that package will produce an error.



Rainer Schoepf
Thu Jan 8 11:51:39 MET 1998