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.

\qed With \qed, the user can locally change the end symbol to appear:<br />

108 \gdef\qed{\expandafter\def\csname \InTheoType Symbol\endcsname<br />

109 {\the\qedsymbol}}%<br />

When calling \qed, the end symbol of the innermost theorem-like environment<br />

at that time is set to the value stored in \qedsymbol at that time.<br />

\PotEndMark Handling a potential endmark position:<br />

110 \gdef\PotEndMark#1{<br />

111 \@ifnextchar[%]<br />

112 {\PotEndMark@opt{#1}}{\SetEndMark{\InTheoType}{#1}{\relax}}}%<br />

113 \gdef\PotEndMark@opt#1[#2]{\SetEndMark{\InTheoType}{#1}{#2}}%<br />

Arguments: 〈cmd seq〉:=#1 is a command sequence to be executed when<br />

setting the endmark.<br />

〈else cmd seq〉= #2: a command sequence that is executed when no end<br />

mark is set (default is \relax; differs only in amsmath equation*).<br />

It adds the current theorem type 〈env〉 to the parameters, and calls<br />

\SetEndMark{〈env〉}{〈cmd seq〉}{〈else cmd seq〉}.<br />

\SetEndMark \SetEndMark sets an endmark for an environment. It is called by<br />

\PotEndMark.<br />

114 \gdef\SetEndMark#1#2#3{%<br />

115 \stepcounter{end#1ctr}%<br />

116 \@ifundefined{mark\thm@romannum{curr#1ctr}#1\thm@romannum{end#1ctr}}%<br />

117 {#3}%<br />

118 {#2{\csname mark\thm@romannum{curr#1ctr}#1\thm@romannum{end#1ctr}\endcsname<br />

119 \ifdim\rightmargin>\z@\hskip-\rightmargin\fi<br />

120 \hbox to 0cm{}}}}%<br />

Arguments:<br />

〈env〉:=#1: current theorem-environment.<br />

〈cmd seq〉:= #2: is a command sequence to be executed when setting the<br />

endmark.<br />

〈else cmd seq〉= #3: a command sequence that is executed when no end<br />

mark is set (usually \relax; differs only in amsmath tags).<br />

All three arguments are transmitted by \PotEndMark.<br />

Line 115: incrementsend〈env〉ctrforpreparingthenextsituation for setting<br />

a potential endmark.<br />

Line 116, 117: if<br />

\mark〈env〉<br />

is undefined – which is the case iff at this position no endmark has to be<br />

set –, 〈else cmd seq〉 is executed,<br />

Line 118: otherwise, 〈cmd seq〉 and then<br />

38

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

Saved successfully!

Ooh no, something went wrong!