diff options
author | Karl Berry <karl@freefriends.org> | 2011-08-23 16:25:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-08-23 16:25:16 +0000 |
commit | 95f44e6aaa9707ee94a8dfa04153274ce05396ac (patch) | |
tree | 56bd92a8ce774691f853b353e17f59fe54dcd5aa /Master/texmf-dist/tex/latex/thmtools/thm-restate.sty | |
parent | 4731222142fb8eb709e5f954db3231ea1283eb63 (diff) |
thmtools 61 (22aug11)
git-svn-id: svn://tug.org/texlive/trunk@23659 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/thmtools/thm-restate.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/thmtools/thm-restate.sty | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty index ee8c52826a7..93f7d343212 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty @@ -11,7 +11,7 @@ %% The `thmtools' package has the LPPL maintenance status: maintained. %% Current Maintainer is Ulrich M. Schwarz, ulmi@absatzen.de %% -%% Copyright (C) 2008-2010 by Ulrich M. Schwarz. +%% Copyright (C) 2008-2011 by Ulrich M. Schwarz. %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, version 1.3a. @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-restate}[2010/08/09 v50] +\ProvidesPackage {thm-restate}[2011/06/02 v61] \RequirePackage{thmtools} \let\@xa\expandafter \let\@nx\noexpand @@ -158,7 +158,7 @@ \label{thmt@@#3}% \fi % this will be the collected body. - ##1 + ##1% \csname end#2\endcsname % if we faked the counter values, restore originals now. \ifthmt@thisistheone\else\thmt@restorecounters\fi @@ -191,17 +191,27 @@ ,restate phase 1% ,restate phase 2% } +\newcommand\thmt@splitrestateargs[1][]{% + \g@addto@macro\thmt@storedoptargs{,#1}% + \def\tmp@a##1\@{\def\thmt@storename{##1}}% + \tmp@a +} \newif\ifthmt@restatethis \define@key{restate phase 1}{restate}{% - \thmt@debug{we will restate as #1}% + \thmt@thmuse@iskvtrue + \def\thmt@storedoptargs{}% discard the first time around + \thmt@splitrestateargs #1\@ + \def\thmt@storedoptargs{}% discard the first time around + %\def\thmt@storename{#1}% + \thmt@debug{we will restate as `\thmt@storename' with more args + `\thmt@storedoptargs'}% \@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\def\@nx\@currenvir{\thmt@envname}% \@nx\@xa\@nx\thmt@restatable\@nx\@xa[\@nx\thmt@storedoptargs]% {\thmt@envname}{\thmt@storename}% }% @@ -214,11 +224,15 @@ \define@key{restate phase 2}{restate}{% % do not store restate as a key for repetition: % infinite loop. + % instead, retain the added keyvals + % overwriting thmt@storename should be safe here, it's been + % xdefd into the postheadhook + \thmt@splitrestateargs #1\@ } \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,}% + \@xa\@xa\@xa\g@addto@macro\@xa\@xa\@xa\thmt@storedoptargs\@xa\@xa\@xa{\@xa\@xa\@xa,% + \@xa\kv@key\@xa=\kv@value}% \fi } |