From b654ef0b09c4b139ace61d2429f4d8b4c7f30e8e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Jul 2010 22:43:34 +0000 Subject: thmtools 43 (11jul10) git-svn-id: svn://tug.org/texlive/trunk@19380 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/thmtools/VERSION.tex | 2 +- .../doc/latex/thmtools/thmtools-manual.tex | 3 + Master/texmf-dist/doc/latex/thmtools/thmtools.pdf | Bin 310466 -> 311692 bytes Master/texmf-dist/source/latex/thmtools/thm-kv.dtx | 16 ++-- .../source/latex/thmtools/thm-listof.dtx | 14 ++-- .../source/latex/thmtools/thm-restate.dtx | 81 +++++++++++++++----- .../texmf-dist/source/latex/thmtools/thmtools.dtx | 4 +- Master/texmf-dist/tex/latex/thmtools/aliasctr.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/parseargs.sty | 2 +- .../texmf-dist/tex/latex/thmtools/thm-amsthm.sty | 2 +- .../texmf-dist/tex/latex/thmtools/thm-autoref.sty | 2 +- .../texmf-dist/tex/latex/thmtools/thm-beamer.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thm-kv.sty | 18 ++--- .../texmf-dist/tex/latex/thmtools/thm-listof.sty | 16 ++-- Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty | 2 +- .../texmf-dist/tex/latex/thmtools/thm-ntheorem.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thm-patch.sty | 2 +- .../texmf-dist/tex/latex/thmtools/thm-restate.sty | 83 ++++++++++++++++----- .../tex/latex/thmtools/thmdef-shaded.sty | 2 +- .../tex/latex/thmtools/thmdef-thmbox.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thmtools.sty | 6 +- Master/texmf-dist/tex/latex/thmtools/unique.sty | 2 +- 22 files changed, 179 insertions(+), 86 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/thmtools/VERSION.tex b/Master/texmf-dist/doc/latex/thmtools/VERSION.tex index d6389ba8aa9..2cd429da167 100644 --- a/Master/texmf-dist/doc/latex/thmtools/VERSION.tex +++ b/Master/texmf-dist/doc/latex/thmtools/VERSION.tex @@ -1 +1 @@ -\def\x #1-#2-#3 #4 v#5\@{\def\VERSION{#1/#2/#3 v#5}}\x 2010-07-05 21:23:32 +0200 v41\@ \ No newline at end of file +\def\x #1-#2-#3 #4 v#5\@{\def\VERSION{#1/#2/#3 v#5}}\x 2010-07-11 10:12:33 +0200 v43\@ \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex b/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex index ea0380c2515..7c43fdfa3e3 100644 --- a/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex +++ b/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex @@ -708,6 +708,9 @@ given to be changed to |\ref{foo}|, and a text is added to the note. (The exact text is given by the macro |\thmcontinues|, which takes the label as its argument.) + \item[restate] Saying |restate=foo| will hopefully work like + wrapping this theorem in a restatable environment. (It probably still fails + in cases that I didn't think of.) \end{description} \begin{source} \begin{body}[gobble=6] diff --git a/Master/texmf-dist/doc/latex/thmtools/thmtools.pdf b/Master/texmf-dist/doc/latex/thmtools/thmtools.pdf index 35e620155ee..f8b4b8b66b6 100644 Binary files a/Master/texmf-dist/doc/latex/thmtools/thmtools.pdf and b/Master/texmf-dist/doc/latex/thmtools/thmtools.pdf differ 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 % 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}% }% } diff --git a/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty b/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty index 4337fd0f579..4607a3cf3fc 100644 --- a/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty +++ b/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {aliasctr}[2010/07/05 v41] +\ProvidesPackage {aliasctr}[2010/07/11 v43] \def\aliasctr@f@llow#1#2\@nil#3{% \ifx#1\@elt \noexpand #3% diff --git a/Master/texmf-dist/tex/latex/thmtools/parseargs.sty b/Master/texmf-dist/tex/latex/thmtools/parseargs.sty index d49ac610c97..dd789c6d2b5 100644 --- a/Master/texmf-dist/tex/latex/thmtools/parseargs.sty +++ b/Master/texmf-dist/tex/latex/thmtools/parseargs.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {parseargs}[2010/07/05 v41] +\ProvidesPackage {parseargs}[2010/07/11 v43] \newtoks\@parsespec \def\parse@endquark{\parse@endquark} diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-amsthm.sty b/Master/texmf-dist/tex/latex/thmtools/thm-amsthm.sty index cb091d7e283..8ea630669db 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-amsthm.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-amsthm.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-amsthm}[2010/07/05 v41] +\ProvidesPackage {thm-amsthm}[2010/07/11 v43] \define@key{thmstyle}{spaceabove}{% \def\thmt@style@spaceabove{#1}% } diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty b/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty index 2ec7525501a..271f5f24c7d 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-autoref}[2010/07/05 v41] +\ProvidesPackage {thm-autoref}[2010/07/11 v43] \RequirePackage{thm-patch, aliasctr, parseargs, keyval} diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-beamer.sty b/Master/texmf-dist/tex/latex/thmtools/thm-beamer.sty index b62aefcbfab..20728a4ba4f 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-beamer.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-beamer.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-beamer}[2010/07/05 v41] +\ProvidesPackage {thm-beamer}[2010/07/11 v43] \newif\ifthmt@hasoverlay \def\thmt@parsetheoremargs#1{% \parse{% diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty index 7ec6386128a..8d7db609d1d 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-kv}[2010/07/05 v41] +\ProvidesPackage {thm-kv}[2010/07/11 v43] \let\@xa\expandafter \let\@nx\noexpand @@ -127,20 +127,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/tex/latex/thmtools/thm-listof.sty b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty index d3586991893..abd0fd0b8be 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-listof}[2010/07/05 v41] +\ProvidesPackage {thm-listof}[2010/07/11 v43] \let\@xa=\expandafter \let\@nx=\noexpand \RequirePackage{thm-patch,keyval,kvsetkeys} @@ -124,22 +124,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/tex/latex/thmtools/thm-llncs.sty b/Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty index d788539e80d..f34ae418dfc 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-llncs}[2010/07/05 v41] +\ProvidesPackage {thm-llncs}[2010/07/11 v43] \@ifclasslater{llncs}{2010/04/15}{}{% \PackageWarningNoLine{thmtools}{% LLNCS.cls too old, not supported by thmtools diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-ntheorem.sty b/Master/texmf-dist/tex/latex/thmtools/thm-ntheorem.sty index db1d91ae80c..b8bca23b204 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-ntheorem.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-ntheorem.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-ntheorem}[2010/07/05 v41] +\ProvidesPackage {thm-ntheorem}[2010/07/11 v43] \def\thmt@declaretheoremstyle@setup{} \def\thmt@declaretheoremstyle#1{% diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty b/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty index 5051b80cb60..2486109be8c 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-patch}[2010/07/05 v41] +\ProvidesPackage {thm-patch}[2010/07/11 v43] \RequirePackage{parseargs} \newif\ifthmt@isstarred diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty index 7e4c11447f2..3639bf8c2f1 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty @@ -20,8 +20,8 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-restate}[2010/07/05 v41] - +\ProvidesPackage {thm-restate}[2010/07/11 v43] +\RequirePackage{thmtools} \let\@xa\expandafter \let\@nx\noexpand \@ifundefined{c@thmt@dummyctr}{% @@ -55,16 +55,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 }% }% @@ -78,18 +78,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}% @@ -134,10 +136,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. @@ -145,7 +147,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}% @@ -177,6 +184,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 +} + \endinput %% %% End of file `thm-restate.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thmdef-shaded.sty b/Master/texmf-dist/tex/latex/thmtools/thmdef-shaded.sty index d72436f7bf2..580699ffbd6 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thmdef-shaded.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thmdef-shaded.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thmdef-shaded}[2010/07/05 v41] +\ProvidesPackage {thmdef-shaded}[2010/07/11 v43] \define@key{thmdef}{shaded}[{}]{% \thmt@trytwice{}{% \RequirePackage{shadethm}% diff --git a/Master/texmf-dist/tex/latex/thmtools/thmdef-thmbox.sty b/Master/texmf-dist/tex/latex/thmtools/thmdef-thmbox.sty index 8134fa0fa05..84bad137671 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thmdef-thmbox.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thmdef-thmbox.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thmdef-thmbox}[2010/07/05 v41] +\ProvidesPackage {thmdef-thmbox}[2010/07/11 v43] \define@key{thmdef}{thmbox}[L]{% \thmt@trytwice{% \let\oldproof=\proof diff --git a/Master/texmf-dist/tex/latex/thmtools/thmtools.sty b/Master/texmf-dist/tex/latex/thmtools/thmtools.sty index 5ada8535cf0..4a4c6c97f1d 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thmtools.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thmtools.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thmtools}[2010/07/05 v41] +\ProvidesPackage {thmtools}[2010/07/11 v43] \DeclareOption{debug}{% \def\thmt@debug{\typeout}% } @@ -30,8 +30,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}% }% } diff --git a/Master/texmf-dist/tex/latex/thmtools/unique.sty b/Master/texmf-dist/tex/latex/thmtools/unique.sty index f736efb1022..30c9930743c 100644 --- a/Master/texmf-dist/tex/latex/thmtools/unique.sty +++ b/Master/texmf-dist/tex/latex/thmtools/unique.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {unique}[2010/07/05 v41] +\ProvidesPackage {unique}[2010/07/11 v43] \DeclareOption{unq}{% \newwrite\uniq@channel -- cgit v1.2.3