summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx')
-rw-r--r--Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx123
1 files changed, 77 insertions, 46 deletions
diff --git a/Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx b/Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx
index b67c4e0f2f6..26e50a89e1f 100644
--- a/Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx
+++ b/Master/texmf-dist/source/latex/ntheorem/ntheorem.dtx
@@ -1,11 +1,11 @@
-\def\filedate{2005/07/07}
-\def\docdate{2005/07/07}
-\def\fileversion{1.25}
+\def\filedate{2009/07/01}
+\def\docdate{2009/07/01}
+\def\fileversion{1.28}
\def\basename{ntheorem}
% \iffalse
%
% Package 'ntheorem' to use with LaTeX2e
-% Copyright 1997 - 2004 by Wolfgang May and Andreas Schedler.
+% Copyright 1997 - 2009 by Wolfgang May and Andreas Schedler.
%
% Written and maintained by
% Wolfgang May (Uni Goettingen, formerly Uni Freiburg)
@@ -33,7 +33,7 @@
%
% \fi
%
-% \CheckSum{2575}
+% \CheckSum{2591}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -1545,18 +1545,19 @@
% It is set to 1 when starting an environment. Each time, when
% a situation (\ref{elist:2})--(\ref{elist:4}) is reached, the command
% \begin{quote}
-% |\mark|$<$|\roman{curr|env|ctr}|$>$\env
-% $<$|\roman{end|\env|ctr}|$>$
+% |\mark|$<$|\thm@romannum{curr|env|ctr}|$>$\env
+% $<$|\thm@romannum{end|\env|ctr}|$>$
% \end{quote}
-% is called
-% ($<$|\roman{curr|\env|ctr}|$>$\env
-% $<$|\roman{end|\env|ctr}|$>$
+% is called (where |\thm@romannum| just writes the value of a counter
+% as its roman numeral representation, e.g., 17 as xvii). \\
+% ($<$|\thm@romannum{curr|\env|ctr}|$>$\env
+% $<$|\thm@romannum{end|\env|ctr}|$>$
% uniquely identifies all situations (\ref{elist:2})--(\ref{elist:4}) in a document).
%
% If at this position an endmark has to be set,
% \begin{quote}
-% |\mark|$<$|\roman{curr|\env|ctr}|$>$\env
-% $<$|\roman{end|\env|ctr}|$>$
+% |\mark|$<$|\thm@romannum{curr|\env|ctr}|$>$\env
+% $<$|\thm@romannum{end|\env|ctr}|$>$
% \end{quote}
% is defined in the |.aux| file to be |\end|\env|Symbol|,
% otherwise it is undefined and simply ignored.
@@ -1566,8 +1567,8 @@
% current line.
% Otherwise,
% \begin{quote}
-% |\def\mark|$<$|\roman{curr|env|ctr}|$>$\env|%|\\
-% $<$|\roman{end|\env|ctr}|$>$|{|\env|Symbol}|
+% |\def\mark|$<$|\thm@romannum{curr|env|ctr}|$>$\env|%|\\
+% $<$|\thm@romannum{end|\env|ctr}|$>$|{|\env|Symbol}|
% \end{quote}
% is written to the |.aux| file for setting the endmark
% at the latest potential position inside the theorem in the next run.
@@ -1782,6 +1783,21 @@
% situation which must be handled by the |.aux| file.
% For further comments see |\@endtheorem|.
%
+%
+% \begin{macro}{\thm@romannum}
+% \changes{v1.28}{2009/07/02}{duplicate latex's definition (WM,
+% reported by Ch. Garcia Duarte)}
+% The functionality of |latex.ltx|'s |\roman| command converts
+% numbers into strings, e.g., 17 into xvii. It is used to put
+% notes into the |.aux| file. It must be
+% locally defined, just duplicating the definition of |\roman| in
+% latex.ltx since some packages redefine |\roman|:
+% \begin{macrocode}
+\gdef\thm@romannum#1{\expandafter\thm@roman@num\csname c@#1\endcsname}%
+\gdef\thm@roman@num#1{\romannumeral #1}%
+% \end{macrocode}
+% \end{macro}
+%
% In the following, all relevant environments are changed for
% handling potential end mark positions:
%
@@ -1859,6 +1875,9 @@
% \end{packeddescr}\end{macro}
%
% \begin{macro}{\[}
+% \changes{v1.27}{2008/06/18}{fixed: start array with no additional
+% space (WM, reported by Tillmann Berg)}
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% If an end mark is set, a displaymath is put into box such that
% the end marks appears at its bottom level at the right. Thus, also
% the definition of |\[| has to be changed:
@@ -1873,10 +1892,10 @@
\makebox[.6\linewidth]%
\fi
$$\stepcounter{end\InTheoType ctr}%
- \@ifundefined{mark\roman{curr\InTheoType ctr}%
- \InTheoType\roman{end\InTheoType ctr}}{\relax}%
+ \@ifundefined{mark\thm@romannum{curr\InTheoType ctr}%
+ \InTheoType\thm@romannum{end\InTheoType ctr}}{\relax}%
{\ifx\csname\InTheoType Symbol\endcsname\@empty\else
- \boxmaxdepth=.5ex\begin{array}[b]{l}%
+ \boxmaxdepth=.5ex\begin{array}[b]{@{}l}%
\boxmaxdepth=\maxdimen\displaystyle\fi}%
\addtocounter{end\InTheoType ctr}{-1}%
%%$$ BRACE MATCH HACK
@@ -1891,8 +1910,8 @@
% The end position of a displaymath inside a theorem-environment
% corresponds to |end\InTheoType ctr|+1.
% An endmark has to be set there, if \\
-% \hspace*{0.5cm} |\mark|$<$|\roman{curr#1ctr}|$>$|#1|%
-% $<$|\roman{end#1ctr}|$+1>$
+% \hspace*{0.5cm} |\mark|$<$|\thm@romannum{curr#1ctr}|$>$|#1|%
+% $<$|\thm@romannum{end#1ctr}|$+1>$
% is defined and not the empty symbol.
% \item[Lines \Coderef{st-b-displ}{13}--\Coderef{st-b-displ}{14}:]
% If so, the whole displayed stuff is put in an array with
@@ -1902,13 +1921,14 @@
% \end{packeddescr}\end{macro}
%
% \begin{macro}{\]}
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% At the end of a displaymath, the end marks is set at its bottom level:
% \Codelabel{st-e-displ}
% \begin{macrocode}
\gdef\]{%
\stepcounter{end\InTheoType ctr}%
- \@ifundefined{mark\roman{curr\InTheoType ctr}%
- \InTheoType\roman{end\InTheoType ctr}}{\relax}%
+ \@ifundefined{mark\thm@romannum{curr\InTheoType ctr}%
+ \InTheoType\thm@romannum{end\InTheoType ctr}}{\relax}%
{\ifx\csname\InTheoType Symbol\endcsname\@empty\else
\end{array}\fi}%
\addtocounter{end\InTheoType ctr}{-1}%
@@ -2024,6 +2044,7 @@
% Original: ltmiscen.dtx
%
%\begin{macro}{\endcenter}%
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% In \LaTeX, |\endcenter| just calls |\endtrivlist|.
% Here, the situation is more complex since the the endmark has
% to be put in the last line without affecting its centering:
@@ -2034,8 +2055,8 @@
\@endtrivlist
{\PotEndMark{\rightskip0pt%
\settowidth{\leftskip}%
- { \csname mark\roman{curr\InTheoType ctr}\InTheoType
- \roman{end\InTheoType ctr}\endcsname}%
+ { \csname mark\thm@romannum{curr\InTheoType ctr}\InTheoType
+ \thm@romannum{end\InTheoType ctr}\endcsname}%
\advance\leftskip\@flushglue\hskip\@flushglue}}}
% \end{macrocode}
%
@@ -2146,13 +2167,14 @@
% called by |\PotEndMark|.
% \changes{v1.16}{1999/08/05}{extended for handling right indents (quote) (WM)}
% \changes{v1.16}{2001/11/28}{removed tilde in hbox (WM)}
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% \Codelabel{SetEndMark}
% \begin{macrocode}
\gdef\SetEndMark#1#2{%
\stepcounter{end#1ctr}%
- \@ifundefined{mark\roman{curr#1ctr}#1\roman{end#1ctr}}%
+ \@ifundefined{mark\thm@romannum{curr#1ctr}#1\thm@romannum{end#1ctr}}%
{\relax}%
- {#2{\csname mark\roman{curr#1ctr}#1\roman{end#1ctr}\endcsname
+ {#2{\csname mark\thm@romannum{curr#1ctr}#1\thm@romannum{end#1ctr}\endcsname
\ifdim\rightmargin>\z@\hskip-\rightmargin\fi
\hbox to 0cm{}}}}%
% \end{macrocode}
@@ -2168,8 +2190,8 @@
% \item[Line \Coderef{SetEndMark}{3}, \Coderef{SetEndMark}{4}:]
% if
% \begin{quote}
-% |\mark|$<$|\roman{curr|\env|ctr}|$>$\env%
-% $<$|\roman{end|\env|ctr}|$>$
+% |\mark|$<$|\thm@romannum{curr|\env|ctr}|$>$\env%
+% $<$|\thm@romannum{end|\env|ctr}|$>$
% \end{quote}
% is undefined
% -- which is the case iff at this position no endmark has to be set --,
@@ -2177,8 +2199,8 @@
% \item[Line \Coderef{SetEndMark}{5}:]
% otherwise, \meta{cmd\_seq} and then
% \begin{quote}
-% |\mark|$<$|\roman{curr|\env|ctr}|$>$|\env|%
-% $<$|\roman{end|\env|ctr}|$>$,
+% |\mark|$<$|\thm@romannum{curr|\env|ctr}|$>$|\env|%
+% $<$|\thm@romannum{end|\env|ctr}|$>$,
% \end{quote}
% which is defined in the |.aux| file to be the end symbol are called. \\
% The construction \meta{cmd\_seq}|{|\ldots|}| in line
@@ -2221,6 +2243,7 @@
% thref option. Change both if you change them.
%
% \begin{macro}{\OrganizeTheoremSymbol}
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% The information for setting the end marks is written to the .aux file:
%
% \Codelabel{OrgThSymb}
@@ -2231,7 +2254,7 @@
\expandafter\meaning\csname\InTheoType Symbol\endcsname\relax}%
\protected@write\@auxout{}%
{\string\global\string\def\string\mark%
- \roman{curr\InTheoType ctr}\InTheoType \roman{end\InTheoType ctr}%
+ \thm@romannum{curr\InTheoType ctr}\InTheoType \thm@romannum{end\InTheoType ctr}%
{\thm@tmp}}%
\@eesphack}
% \end{macrocode}
@@ -2239,8 +2262,8 @@
% \begin{packeddescr}
% \item[Lines \Coderef{OrgThSymb}{5}--\Coderef{OrgThSymb}{7}:]
% Write \\
-% |\global\def\mark|$<$|\roman{curr|\env|ctr}|$>\env
-% <$|\roman{end|\env|ctr}|$>$%
+% |\global\def\mark|$<$|\thm@romannum{curr|\env|ctr}|$>\env
+% <$|\thm@romannum{end|\env|ctr}|$>$%
% |{<|\env|Symbol>}|
% to the |.aux| file. \\
% \env :=|\InTheoType| gives the innermost theorem-like environment,
@@ -2281,10 +2304,13 @@
% |fleqn| is only active it |thmmarks| is also active.
%
% \begin{macro}{\[}
+% \changes{v1.27}{2008/06/18}{fixed: start array with no additional
+% space (WM, reported by Tillmann Berg)}
% Since |fleqn| treats displayed math as trivlists, it's quite
% another thing:
%
% \Codelabel{fleqn-b-displ}
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% \begin{macrocode}
\renewcommand\[{\relax
\ifmmode\@badmath
@@ -2296,10 +2322,10 @@
\hb@xt@\linewidth\bgroup $\m@th\displaystyle %$
\hskip\mathindent\bgroup
\stepcounter{end\InTheoType ctr}%
- \@ifundefined{mark\roman{curr\InTheoType ctr}%
- \InTheoType\roman{end\InTheoType ctr}}{\relax}%
+ \@ifundefined{mark\thm@romannum{curr\InTheoType ctr}%
+ \InTheoType\thm@romannum{end\InTheoType ctr}}{\relax}%
{\ifx\csname\InTheoType Symbol\endcsname\@empty\else
- \boxmaxdepth=.5ex\begin{array}[b]{l}%
+ \boxmaxdepth=.5ex\begin{array}[b]{@{}l}%
\boxmaxdepth=\maxdimen\displaystyle\fi}%
\addtocounter{end\InTheoType ctr}{-1}%
\fi}
@@ -2316,6 +2342,7 @@
% \end{packeddescr}\end{macro}
%
% \begin{macro}{\]}
+% \changes{v1.28}{2009/07/02}{replaced roman by thm@romannum (WM)}
% Here, the end mark is placed after a |\hfil| ate the end of the line
% containing the displaymath:
%
@@ -2323,8 +2350,8 @@
% \begin{macrocode}
\renewcommand\]{%
\stepcounter{end\InTheoType ctr}%
- \@ifundefined{mark\roman{curr\InTheoType ctr}%
- \InTheoType\roman{end\InTheoType ctr}}{\relax}%
+ \@ifundefined{mark\thm@romannum{curr\InTheoType ctr}%
+ \InTheoType\thm@romannum{end\InTheoType ctr}}{\relax}%
{\ifx\csname\InTheoType Symbol\endcsname\@empty\else
\end{array}\fi}%
\addtocounter{end\InTheoType ctr}{-1}%
@@ -2690,10 +2717,10 @@
% \item[Line \Coderef{EndTags}{4}:]
% if equation numbers are set as default, call
% |\SetTagPlusEndMark| to set tag and end mark.
-% \item[Line \Coderef{EndTags}{5}:]
+% \item[Lines \Coderef{EndTags}{5}, \Coderef{EndTags}{6}:]
% if a tag is set manually, call
% |\SetTagPlusEndMark| to set tag and end mark.
-% \item[Line \Coderef{EndTags}{6}:]
+% \item[Line \Coderef{EndTags}{7}:]
% otherwise, call |\SetOnlyEndMark| to set only an end mark.
% \end{packeddescr}
% \end{macro}
@@ -2725,14 +2752,18 @@
% \end{packeddescr}
% \end{macro}
%
-% \begin{macro}{\SetTagsPlusEndMark}
-% \Codelabel{TagsPlus}
+% \begin{macro}{\SetTagPlusEndMark}
+% \Codelabel{TagPlus}
+% \changes{v1.26}{2007/10/17}{fixed: box to tagwidth (problem with leqno; WM)}
% \begin{macrocode}
+\newdimen{\tagwidth}
\gdef\SetTagPlusEndMark{%
\iftagsleft@
\gdef\maketag@@@##1{%
+ \settowidth{\tagwidth}{$##1$}%% %% WM 17.10.2007
+ \hbox to \tagwidth{%
\hbox to \displaywidth{\m@th\normalfont##1%
- \hss\PotEndMark{\hss}}}%
+ \hss\PotEndMark{\hss}}\hss}}%
\else
\gdef\maketag@@@##1{\hbox{\m@th\normalfont##1%
\llap{\hss\PotEndMark{\raisebox{-1.3em}}}}}%
@@ -2741,13 +2772,13 @@
%
% Set a tag \emph{and} an end mark:
% \begin{packeddescr}
-% \item[Lines \Coderef{TagsPlus}{2}--\Coderef{TagsPlus}{9}:]
+% \item[Lines \Coderef{TagPlus}{2}--\Coderef{TagPlus}{11}:]
% redefine the |\maketag@@@| macro:
-% \item[Lines \Coderef{TagsPlus}{3}--\Coderef{TagsPlus}{5}:]
+% \item[Lines \Coderef{TagPlus}{3}--\Coderef{TagPlus}{7}:]
% if tags are set to the left, build a box of the whole
% displaywidth and put the original tag on the left, and the (potential)
-% endmark at the right.
-% \item[Lines \Coderef{TagsPlus}{7},\Coderef{TagsPlus}{8}:]
+% endmark at the right. Put this box with width 0 and continue.
+% \item[Lines \Coderef{TagPlus}{8},\Coderef{TagPlus}{9}:]
% if the tags are set to the right, the (potential) end
% mark is put below it.
% \end{packeddescr}