22.07.2013 Views

ntheorem.pdf. - Mirrors.med.harvard.edu

ntheorem.pdf. - Mirrors.med.harvard.edu

ntheorem.pdf. - Mirrors.med.harvard.edu

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Line 980: #1isalistoftheoremsets,i.e., oftheformTheoremorTheorem, Definition, ....<br />

Line 981: set tocdepth to −2 to assure that the predefined list-types work.<br />

Line 982: store the list of names in thm@list and call \thm@processlist,<br />

which actually generates the list.<br />

\thm@processlist The file 〈jobname〉.thm contains commands of the form<br />

\contentsline{〈list-of-theoremsets〉}{{〈header〉}{〈number〉}}{〈page〉}.<br />

Thus, dependent on which theoremsets should be listed, \contentsline<br />

must be defined to evaluate the first argument and then to output all arguments,<br />

or to discard the second and third one.<br />

Thisisdoneasfollows: Thecommands\l@〈theorem-set〉and\thm@listdo〈theorem-set〉<br />

(which initially were set to ignore everything by \newtheorem) are redefined<br />

for the theorem sets which should be listed to generate output.<br />

\contentsline is defined to call \l@〈theorem-set〉, adding a line to the list<br />

or ignoring the entry. Since for theorem sets which are not yet known (i.e.,<br />

if the list is created at the beginning of the document, and the theoremset<br />

is only defined later), \l@〈theorem-set〉 is not yet defined, \contentsline<br />

has to check if the command is defined, otherwise ignore the arguments.<br />

Then, the .thm file is processed, evaluating the \contentsline commands.<br />

After processing the .thm file, the mentioned commands are again redefined<br />

to discard everything. We need to define the macros globally for dealing<br />

with complex, user-defined, list-types.<br />

984 \def\thm@processlist{%<br />

985 \begingroup<br />

986 \typeout{** Generating table of \thm@list}%<br />

987 \def\contentsline##1{%<br />

988 \expandafter\@ifundefined{l@##1}%<br />

989 {\thm@lgobble@entry}{\csname l@##1\endcsname}}%<br />

990 \thm@@thmlstart<br />

991 \@for\thm@currentlist:=\thm@list<br />

992 \do{%<br />

993 \ifx\thm@currentlist\@empty\else<br />

994 \expandafter\gdef\csname l@\thm@currentlist\endcsname{\thm@thmline}%<br />

995 \expandafter\gdef\csname thm@listdo\thm@currentlist\endcsname{\thm@inlistdo}%<br />

996 \fi<br />

997 }%<br />

998 \@input{\jobname .thm}%<br />

999 \thm@@thmlend<br />

1000 \@for\thm@currentlist:=\thm@list<br />

1001 \do{%<br />

1002 \ifx\thm@currentlist\@empty\else<br />

1003 \expandafter\gdef\csname l@\thm@currentlist\endcsname<br />

1004 {\thm@lgobble@entry}%<br />

1005 \expandafter\gdef\csname thm@listdo\thm@currentlist\endcsname<br />

1006 {\thm@lgobble@freetext}%<br />

1007 \fi<br />

73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!