;SPMlt;!DOCTYPE HTML PUBLIC ;SPMquot;-//W3C//DTD HTML 3.2 Final//en;SPMquot;;SPMgt;

;SPMlt;!--Converted with LaTeX2HTML 2022 (Released January 1, 2022) --;SPMgt; ;SPMlt;HTML lang=;SPMquot;en;SPMquot;;SPMgt; ;SPMlt;HEAD;SPMgt; ;SPMlt;TITLE;SPMgt;Contents of Declaring options;SPMlt;/TITLE;SPMgt;

;SPMlt;META HTTP-EQUIV=;SPMquot;Content-Type;SPMquot; CONTENT=;SPMquot;text/html; charset=utf-8;SPMquot;;SPMgt; ;SPMlt;META NAME=;SPMquot;viewport;SPMquot; CONTENT=;SPMquot;width=device-width, initial-scale=1.0;SPMquot;;SPMgt; ;SPMlt;META NAME=;SPMquot;Generator;SPMquot; CONTENT=;SPMquot;LaTeX2HTML v2022;SPMquot;;SPMgt;

;SPMlt;LINK REL=;SPMquot;STYLESHEET;SPMquot; HREF=;SPMquot;clsguide.css;SPMquot;;SPMgt;

;SPMlt;LINK REL=;SPMquot;next;SPMquot; HREF=;SPMquot;node25_mn.html;SPMquot;;SPMgt; ;SPMlt;LINK REL=;SPMquot;previous;SPMquot; HREF=;SPMquot;node23_mn.html;SPMquot;;SPMgt; ;SPMlt;LINK REL=;SPMquot;up;SPMquot; HREF=;SPMquot;node21_mn.html;SPMquot;;SPMgt; ;SPMlt;LINK REL=;SPMquot;next;SPMquot; HREF=;SPMquot;node25_mn.html;SPMquot;;SPMgt; ;SPMlt;/HEAD;SPMgt;

;SPMlt;BODY bgcolor=;SPMquot;#ffffff;SPMquot; text=;SPMquot;#000000;SPMquot; link=;SPMquot;#9944EE;SPMquot; vlink=;SPMquot;#0000ff;SPMquot; alink=;SPMquot;#00ff00;SPMquot;;SPMgt;

;SPMlt;H2;SPMgt;;SPMlt;A ID=;SPMquot;SECTION00333000000000000000;SPMquot;;SPMgt; Declaring options;SPMlt;/A;SPMgt; ;SPMlt;/H2;SPMgt;

;SPMlt;P;SPMgt; The other major difference between L;SPMlt;SUP;SPMgt;;SPMlt;SMALL;SPMgt;A;SPMlt;/SMALL;SPMgt;;SPMlt;/SUP;SPMgt;T;SPMlt;SMALL;SPMgt;E;SPMlt;/SMALL;SPMgt;X;SPMamp;nbsp;2.09 styles and L;SPMlt;SUP;SPMgt;;SPMlt;SMALL;SPMgt;A;SPMlt;/SMALL;SPMgt;;SPMlt;/SUP;SPMgt;T;SPMlt;SMALL;SPMgt;E;SPMlt;/SMALL;SPMgt;X2;SPMlt;SUB;SPMgt;e;SPMlt;/SUB;SPMgt; packages and classes is in option handling. Packages and classes can now declare options and these can be specified by authors; for example, the |twocolumn| option is declared by the |article| class.

;SPMlt;P;SPMgt; An option is declared as follows: ;SPMlt;PRE;SPMgt; <#1#>;SPMamp;lt;option;SPMamp;gt;<#1#><#2#>;SPMamp;lt;code;SPMamp;gt;<#2#> ;SPMlt;/PRE;SPMgt; For example, the |dvips| option to the |graphics| package is implemented as: ;SPMlt;PRE;SPMgt; <#3#>dvips<#3#><#21#>1 #center59#<#21#> ;SPMlt;/PRE;SPMgt; This means that when an author writes ||, the file |dvips.def| is loaded. As another example, the |a4paper| option is declared in the |article| class to set the || and || lengths: ;SPMlt;PRE;SPMgt; <#5#>a4paper<#5#><#22#>2 <#22#> ;SPMlt;/PRE;SPMgt; Sometimes a user will request an option which the class or package has not explicitly declared. By default this will produce a warning (for classes) or error (for packages); this behaviour can be altered as follows: ;SPMlt;PRE;SPMgt; <#10#>;SPMamp;lt;code;SPMamp;gt;<#10#> ;SPMlt;/PRE;SPMgt; For example, to make the package |fred| produce a warning rather than an error for unknown options, you could specify: ;SPMlt;PRE;SPMgt; <#23#>5 <#11#>fred<#11#><#12#>Unknown option `'<#12#>6 <#23#> ;SPMlt;/PRE;SPMgt; Then, if an author writes ||, they will get a warning ;SPMlt;TT;SPMgt;Package fred Warning: Unknown option `foo'.;SPMlt;/TT;SPMgt; As another example, the |fontenc| package tries to load a file |;SPMamp;lt;ENC;SPMamp;gt;enc.def| whenever the ENC option is used. This can be done by writing: ;SPMlt;PRE;SPMgt; <#24#>7 #center60#<#24#> ;SPMlt;/PRE;SPMgt; It is possible to pass options on to another package or class, using the command |r | For example, to pass every unknown option on to the |article| class, you can use: ;SPMlt;PRE;SPMgt; <#25#>10 <#25#> ;SPMlt;/PRE;SPMgt; If you do this then you should make sure you load the class at some later point, otherwise the options will never be processed!

;SPMlt;P;SPMgt; So far, we have explained only how to declare options, not how to execute them. To process the options with which the file was called, you should use: ;SPMlt;PRE;SPMgt; ;SPMlt;/PRE;SPMgt; This executes the code for each option that was both specified and declared (see Section;SPMamp;nbsp;;SPMlt;A HREF=;SPMquot;#Sec:commands.options;SPMquot; TARGET=;SPMquot;_top;SPMquot;;SPMgt;;SPMlt;IMG ALT=;SPMquot;[*];SPMquot; SRC=;SPMquot;crossref.png;SPMquot;;SPMgt;;SPMlt;/A;SPMgt; for details of how this is done).

;SPMlt;P;SPMgt; For example, if the |jane| package file contains: ;SPMlt;PRE;SPMgt; <#16#>foo<#16#><#26#><#26#> <#18#>baz<#18#><#27#><#27#> <#28#><#28#> ;SPMlt;/PRE;SPMgt; and an author writes ||, then they will see the messages ;SPMlt;TT;SPMgt;Saw foo.;SPMlt;/TT;SPMgt; and ;SPMlt;TT;SPMgt;What's bar?;SPMlt;/TT;SPMgt;

;SPMlt;P;SPMgt;

;SPMlt;HR;SPMgt;

;SPMlt;/BODY;SPMgt; ;SPMlt;/HTML;SPMgt;