summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-08-07 22:18:43 +0000
committerKarl Berry <karl@freefriends.org>2020-08-07 22:18:43 +0000
commitd7359b696521401de6deaa4f70a6b40319cfa2a0 (patch)
tree8d45b41c17197de7a8514fb22f9c305a6ae9865d /Master/texmf-dist/tex/latex/thmtools/thm-listof.sty
parentd6a7e0e5536b4924edec286797ed38021b94509d (diff)
thmtools
git-svn-id: svn://tug.org/texlive/trunk@56068 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/thmtools/thm-listof.sty')
-rw-r--r--Master/texmf-dist/tex/latex/thmtools/thm-listof.sty60
1 files changed, 47 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty
index 69286d9eb42..f0856dd0eff 100644
--- a/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty
+++ b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty
@@ -22,7 +22,7 @@
%%
%%
\NeedsTeXFormat {LaTeX2e}
-\ProvidesPackage {thm-listof}[2020/07/16 v69]
+\ProvidesPackage {thm-listof}[2020/08/01 v0.72]
\let\@xa=\expandafter
\let\@nx=\noexpand
\RequirePackage{thm-patch,keyval,kvsetkeys}
@@ -45,16 +45,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}}%
@@ -73,7 +72,7 @@
}%
%\expandafter
\listoffigures
- \egroup
+ \endgroup
}
\newcommand\setlisttheoremstyle[1]{%
@@ -86,25 +85,60 @@
\define@key{thmt-listof}{ignoreall}[true]{\ignoretheorems{\thmt@allenvs}}
\define@key{thmt-listof}{showall}[true]{\showtheorems{\thmt@allenvs}}
\define@key{thmt-listof}{title}{\def\listtheoremname{#1}}
+\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