diff options
Diffstat (limited to 'macros/latex/contrib/thmtools/source/thm-listof.dtx')
-rw-r--r-- | macros/latex/contrib/thmtools/source/thm-listof.dtx | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/macros/latex/contrib/thmtools/source/thm-listof.dtx b/macros/latex/contrib/thmtools/source/thm-listof.dtx index 39603b4341..cb5b7e380a 100644 --- a/macros/latex/contrib/thmtools/source/thm-listof.dtx +++ b/macros/latex/contrib/thmtools/source/thm-listof.dtx @@ -80,16 +80,15 @@ \newcommand\listoftheorems[1][]{% %% much hacking here to pick up the definition from the class %% without oodles of conditionals. - \bgroup + \begingroup \setlisttheoremstyle{#1}% \let\listfigurename\listtheoremname \def\contentsline##1{% \csname thmt@contentsline@##1\endcsname{##1}% }% \@for\thmt@envname:=\thmt@allenvs\do{% - \@xa\protected@edef\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? - \@nx\@dottedtocline{1}{1.5em}{\@nx\thmt@listnumwidth}% - }% + % CHECK: is \cs{l@\thmt@envname} repeatedly defined? + \thmtlo@newentry }% \let\thref@starttoc\@starttoc \def\@starttoc##1{\thref@starttoc{loe}}% @@ -108,7 +107,7 @@ }% %\expandafter \listoffigures - \egroup + \endgroup } \newcommand\setlisttheoremstyle[1]{% @@ -123,25 +122,60 @@ % FMi 2019-09-31 allow local title \define@key{thmt-listof}{title}{\def\listtheoremname{#1}} % -- FMi +\newif\ifthmt@listswap +\def\thmt@TRUE{true} +\def\thmt@FALSE{false} +\define@key{thmt-listof}{swapnumber}[true]{% + \def\thmt@tmp{#1}% + \ifx\thmt@tmp\thmt@TRUE + \thmt@listswaptrue + \else\ifx\thmt@tmp\thmt@FALSE + \thmt@listswapfalse + \else + \PackageError{thmtools}{Unknown value `#1' to key swapnumber}{}% + \fi\fi +} -\providecommand\thmt@listnumwidth{2.3em} +\ifdefined\@tocline + % for ams classes (amsart.cls, amsproc.cls, amsbook.cls) which + % don't use \@dottedtocline and don't provide \@dotsep + \def\thmtlo@newentry{% + \@xa\def\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? + % similar to \l@figure defined in ams classes + \@tocline{0}{3pt plus2pt}{0pt}{\thmt@listnumwidth}{}% + }% + } + \providecommand*\thmt@listnumwidth{1.5pc} +\else + \def\thmtlo@newentry{% + \@xa\def\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? + \@dottedtocline{1}{1.5em}{\thmt@listnumwidth}% + }% + } + \providecommand*\thmt@listnumwidth{2.3em} +\fi \providecommand\thmtformatoptarg[1]{ (#1)} \newcommand\thmt@mklistcmd{% - \@xa\protected@edef\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? - \@nx\@dottedtocline{1}{1.5em}{\@nx\thmt@listnumwidth}% - }% + \thmtlo@newentry \ifthmt@isstarred \@xa\def\csname ll@\thmt@envname\endcsname{% - \protect\numberline{\protect\let\protect\autodot\protect\@empty}% + \protect\ifthmt@listswap + \protect\else + \protect\numberline{\protect\let\protect\autodot\protect\@empty}% + \protect\fi \thmt@thmname \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi }% \else \@xa\def\csname ll@\thmt@envname\endcsname{% - \protect\numberline{\csname the\thmt@envname\endcsname}% - \thmt@thmname + \protect\ifthmt@listswap + \thmt@thmname~\csname the\thmt@envname\endcsname + \protect\else + \protect\numberline{\csname the\thmt@envname\endcsname}% + \thmt@thmname + \protect\fi \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi }% \fi |