summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-07-11 22:43:34 +0000
committerKarl Berry <karl@freefriends.org>2010-07-11 22:43:34 +0000
commitb654ef0b09c4b139ace61d2429f4d8b4c7f30e8e (patch)
tree21ad6e9e18acff359f47c661411a3c77238dcba8 /Master/texmf-dist/source/latex
parent832adfe312ce50bfe615e4c31eaa51541cefe817 (diff)
thmtools 43 (11jul10)
git-svn-id: svn://tug.org/texlive/trunk@19380 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-kv.dtx16
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-listof.dtx14
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-restate.dtx81
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thmtools.dtx4
4 files changed, 80 insertions, 35 deletions
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx
index 42ed3eabb79..02f81e1932f 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx
@@ -128,20 +128,20 @@
\fi
}
-\@for\keyname:=parent,numberwithin,within\do{%
-\define@key{thmdef}{\keyname}{\thmt@trytwice{\thmt@setparent{#1}}{}}%
+\@for\tmp@keyname:=parent,numberwithin,within\do{%
+\define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setparent{#1}}{}}%
}
-\@for\keyname:=sibling,numberlike,sharenumber\do{%
-\define@key{thmdef}{\keyname}{\thmt@trytwice{\thmt@setsibling{#1}}{}}%
+\@for\tmp@keyname:=sibling,numberlike,sharenumber\do{%
+\define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setsibling{#1}}{}}%
}
-\@for\keyname:=title,name,heading\do{%
-\define@key{thmdef}{\keyname}{\thmt@trytwice{\thmt@setthmname{#1}}{}}%
+\@for\tmp@keyname:=title,name,heading\do{%
+\define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setthmname{#1}}{}}%
}
-\@for\keyname:=unnumbered,starred\do{%
-\define@key{thmdef}{\keyname}[]{\thmt@trytwice{\thmt@isnumberedfalse}{}}%
+\@for\tmp@keyname:=unnumbered,starred\do{%
+\define@key{thmdef}{\tmp@keyname}[]{\thmt@trytwice{\thmt@isnumberedfalse}{}}%
}
\def\thmt@YES{yes}
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx b/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx
index c10c81d817f..29097408c54 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx
@@ -156,22 +156,22 @@
}
\newcommand\showtheorems[1]{%
- \@for\thm:=#1\do{%
- \typeout{showing \thm}%
- \@xa\let\csname thmt@contentsline@\thm\endcsname
+ \@for\thmt@thm:=#1\do{%
+ \typeout{showing \thmt@thm}%
+ \@xa\let\csname thmt@contentsline@\thmt@thm\endcsname
=\thmt@contentslineShow
}%
}
\newcommand\ignoretheorems[1]{%
- \@for\thm:=#1\do{%
- \@xa\let\csname thmt@contentsline@\thm\endcsname
+ \@for\thmt@thm:=#1\do{%
+ \@xa\let\csname thmt@contentsline@\thmt@thm\endcsname
=\thmt@contentslineIgnore
}%
}
\newcommand\onlynamedtheorems[1]{%
- \@for\thm:=#1\do{%
- \global\@xa\let\csname thmt@contentsline@\thm\endcsname
+ \@for\thmt@thm:=#1\do{%
+ \global\@xa\let\csname thmt@contentsline@\thmt@thm\endcsname
=\thmt@contentslineIfNamed
}%
}
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx
index 8faec5f2fd4..58d840b1d41 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx
@@ -86,7 +86,7 @@
%
%\StopEventually{}
% \begin{macrocode}
-
+\RequirePackage{thmtools}
\let\@xa\expandafter
\let\@nx\noexpand
\@ifundefined{c@thmt@dummyctr}{%
@@ -142,16 +142,16 @@
\def\thmt@counterformatters{%
@alph,@Alph,@arabic,@roman,@Roman,@fnsymbol}
-\@for\displ:=\thmt@counterformatters\do{%
- \@xa\let\csname thmt@\displ\@xa\endcsname\csname \displ\endcsname
+\@for\thmt@displ:=\thmt@counterformatters\do{%
+ \@xa\let\csname thmt@\thmt@displ\@xa\endcsname\csname \thmt@displ\endcsname
}%
\def\thmt@sanitizethe#1{%
- \@for\displ:=\thmt@counterformatters\do{%
- \@xa\protected@edef\csname\displ\endcsname##1{%
+ \@for\thmt@displ:=\thmt@counterformatters\do{%
+ \@xa\protected@edef\csname\thmt@displ\endcsname##1{%
\@nx\ifx\@xa\@nx\csname c@#1\endcsname ##1%
- \@xa\protect\csname \displ\endcsname{##1}%
+ \@xa\protect\csname \thmt@displ\endcsname{##1}%
\@nx\else
- \@nx\csname thmt@\displ\endcsname{##1}%
+ \@nx\csname thmt@\thmt@displ\endcsname{##1}%
\@nx\fi
}%
}%
@@ -165,18 +165,20 @@
\bgroup
% ugly hack: save chapter,..subsection numbers
% for equation numbers.
- \refstepcounter{thmt@dummyctr}% why is this here?
+ %\refstepcounter{thmt@dummyctr}% why is this here?
+ %% temporarily disabled, broke autorefname.
\def\@currentlabel{}%
- \@for\ctr:=\thmt@innercounters\do{%
- \thmt@sanitizethe{\ctr}%
+ \@for\thmt@ctr:=\thmt@innercounters\do{%
+ \thmt@sanitizethe{\thmt@ctr}%
\protected@edef\@currentlabel{%
\@currentlabel
- \protect\def\@xa\protect\csname the\ctr\endcsname{\csname the\ctr\endcsname}%
- \ifcsname theH\ctr\endcsname
- \protect\def\@xa\protect\csname theH\ctr\endcsname{%
- (restate \protect\theHthmt@dummyctr)\csname theH\ctr\endcsname}%
+ \protect\def\@xa\protect\csname the\thmt@ctr\endcsname{%
+ \csname the\thmt@ctr\endcsname}%
+ \ifcsname theH\thmt@ctr\endcsname
+ \protect\def\@xa\protect\csname theH\thmt@ctr\endcsname{%
+ (restate \protect\theHthmt@dummyctr)\csname theH\thmt@ctr\endcsname}%
\fi
- \protect\setcounter{\ctr}{\number\csname c@\ctr\endcsname}%
+ \protect\setcounter{\thmt@ctr}{\number\csname c@\thmt@ctr\endcsname}%
}%
}%
\label{thmt@@#1@data}%
@@ -228,10 +230,10 @@
% of the environment, so we get
% (4.2) [(3.1 from restate)] (4.3)
\def\thmt@restorecounters{}%
- \@for\ctr:=\thmt@innercounters\do{%
+ \@for\thmt@ctr:=\thmt@innercounters\do{%
\protected@edef\thmt@restorecounters{%
\thmt@restorecounters
- \protect\setcounter{\ctr}{\arabic{\ctr}}%
+ \protect\setcounter{\thmt@ctr}{\arabic{\thmt@ctr}}%
}%
}%
% pull the new semi-static definition of \theequation et al.
@@ -239,7 +241,12 @@
\thmt@trivialref{thmt@@#3@data}{}%
\fi
% call the proper begin-env code, possibly with optional argument
- \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[{#1}]\fi
+ % (omit if stored via key-val)
+ \ifthmt@restatethis
+ \thmt@restatethisfalse
+ \else
+ \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[{#1}]\fi
+ \fi
\ifthmt@thisistheone
% store a label so we can pick up the number later.
\label{thmt@@#3}%
@@ -271,6 +278,44 @@
}{%
\endthmt@restatable
}
+
+%%% support for keyval-style: restate=foobar
+\protected@edef\thmt@thmuse@families{%
+ \thmt@thmuse@families%
+ ,restate phase 1%
+ ,restate phase 2%
+}
+
+\newif\ifthmt@restatethis
+\define@key{restate phase 1}{restate}{%
+ \thmt@debug{we will restate as #1}%
+ \@namedef{thmt@unusedkey@restate}{}%
+ % spurious "unused key" fixes itself once we are after tracknames...
+ \thmt@restatethistrue
+ \def\thmt@storedoptargs{}%
+ \def\thmt@storename{#1}%
+ \protected@edef\tmp@a{%
+ \@nx\thmt@thisistheonetrue
+ \@nx\@xa\@nx\thmt@restatable\@nx\@xa[\@nx\thmt@storedoptargs]%
+ {\thmt@envname}{\thmt@storename}%
+ }%
+ \@xa\g@addto@macro\@xa\thmt@local@postheadhook\@xa{%
+ \tmp@a
+ }%
+}
+\thmt@mkignoringkeyhandler{restate phase 1}
+
+\define@key{restate phase 2}{restate}{%
+ % do not store restate as a key for repetition:
+ % infinite loop.
+}
+\kv@set@family@handler{restate phase 2}{%
+ \ifthmt@restatethis
+ \@xa\@xa\@xa\g@addto@macro\@xa\@xa\@xa\thmt@storedoptargs\@xa\@xa\@xa{%
+ \@xa\kv@key\@xa=\kv@value,}%
+ \fi
+}
+
% \end{macrocode}
%\iffalse
%</restate>
diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx
index b480838ffec..a234b01c478 100644
--- a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx
@@ -38,8 +38,8 @@
\def\thmt@quark{\thmt@quark}
\newtoks\thmt@toks
-\@for\opt:=lowercase,uppercase,anycase\do{%
- \@xa\DeclareOption\@xa{\opt}{%
+\@for\thmt@opt:=lowercase,uppercase,anycase\do{%
+ \@xa\DeclareOption\@xa{\thmt@opt}{%
\@xa\PassOptionsToPackage\@xa{\CurrentOption}{thm-kv}%
}%
}