From 0062f2dde6fe9e690fe436bff55f7edb88c78403 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 10 Jul 2010 00:04:53 +0000 Subject: thmtools update (6jul10) git-svn-id: svn://tug.org/texlive/trunk@19319 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/thmtools/VERSION.tex | 2 +- .../doc/latex/thmtools/thmtools-manual.tex | 31 ++++-- Master/texmf-dist/doc/latex/thmtools/thmtools.pdf | Bin 298212 -> 310466 bytes Master/texmf-dist/source/latex/thmtools/thm-kv.dtx | 88 +++++++++++++++- .../texmf-dist/source/latex/thmtools/thm-llncs.dtx | 90 +++++++++++++++++ .../texmf-dist/source/latex/thmtools/thm-patch.dtx | 13 ++- .../source/latex/thmtools/thm-restate.dtx | 112 +++++++++++++++------ .../texmf-dist/source/latex/thmtools/thmtools.dtx | 9 ++ .../texmf-dist/source/latex/thmtools/thmtools.ins | 1 + 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 | 89 +++++++++++++++- .../texmf-dist/tex/latex/thmtools/thm-listof.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty | 92 +++++++++++++++++ .../texmf-dist/tex/latex/thmtools/thm-ntheorem.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thm-patch.sty | 15 ++- .../texmf-dist/tex/latex/thmtools/thm-restate.sty | 85 ++++++++++------ .../tex/latex/thmtools/thmdef-shaded.sty | 2 +- .../tex/latex/thmtools/thmdef-thmbox.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thmtools.sty | 11 +- Master/texmf-dist/tex/latex/thmtools/unique.sty | 2 +- 24 files changed, 556 insertions(+), 102 deletions(-) create mode 100644 Master/texmf-dist/source/latex/thmtools/thm-llncs.dtx create mode 100644 Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/thmtools/VERSION.tex b/Master/texmf-dist/doc/latex/thmtools/VERSION.tex index db461fa6966..d6389ba8aa9 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-06-08 22:07:11 +0200 v35\@ \ No newline at end of file +\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 diff --git a/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex b/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex index 73be5b7b985..ea0380c2515 100644 --- a/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex +++ b/Master/texmf-dist/doc/latex/thmtools/thmtools-manual.tex @@ -698,28 +698,37 @@ Usually, the optional argument of a theorem serves just to give a note that is shown in the theorem's head. \Thmtools\ allows you to have a - key-value list here as well. Currently, the only two keys that are - known are |name|, setting the note text, and |label|, which will put a - |\label| command after the heading, so it's only moderately useful right now. - - But it's good to already know the following: we try to treat the argument - as a keyval argument. If \emph{any} key matches, we assume that is the - right thing to do. Otherwise, it is treated as an old-style direct note. - Note that for implementation reasons, keys that are unknown are silently - discarded. + key-value list here as well. The following keys are known right now: + \begin{description} + \item[name] This is what used to be the old argument. It usually holds + the name of the theorem, or a source. + \item[label] This will issue a |\label| command after the head. Not very + useful, more of a demo. + \item[continues] Saying |continues=foo| will cause the number that is + 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.) + \end{description} \begin{source} \begin{body}[gobble=6] \begin{theorem}[name=Keyed theorem, label=thm:key] - This is a key-val theorem. + This is a + key-val theorem. + \end{theorem} + \begin{theorem}[continues=thm:key] + And it's spread out. \end{theorem} \end{body} \end{source} \begin{result} \begin{theorem}[name=Keyed theorem, - label=thm:key] + label=thm:key,continues=thm:key] This is a key-val theorem. \end{theorem} + \begin{theorem}[continues=thm:key] + And it's spread out. + \end{theorem} \end{result} diff --git a/Master/texmf-dist/doc/latex/thmtools/thmtools.pdf b/Master/texmf-dist/doc/latex/thmtools/thmtools.pdf index 0493ee9d4a0..35e620155ee 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 fb1dc723eac..42ed3eabb79 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx @@ -18,8 +18,59 @@ \let\@xa\expandafter \let\@nx\noexpand + +\DeclareOption{lowercase}{% + \PackageInfo{thm-kv}{Theorem names will be lowercased}% + \global\let\thmt@modifycase\MakeLowercase} + +\DeclareOption{uppercase}{% + \PackageInfo{thm-kv}{Theorem names will be uppercased}% + \global\let\thmt@modifycase\MakeUppercase} + +\DeclareOption{anycase}{% + \PackageInfo{thm-kv}{Theorem names will be unchanged}% + \global\let\thmt@modifycase\@empty} + +\ExecuteOptions{uppercase} +\ProcessOptions\relax + \RequirePackage{keyval,kvsetkeys,thm-patch} +\@ifpackagelater{kvsetkeys}{2010/07/02}{% + % assume Heiko goes along with my patch... +}{% + \RequirePackage{etex} + \PackageInfo{thm-kv}{kvsetkeys patch applied}% + \long\def\kv@processor@default#1#2#3{% + \protected@edef\kvsu@fam{#1}% new + \@onelevel@sanitize\kvsu@fam% new + \protected@edef\kvsu@key{#2}% new + \@onelevel@sanitize\kvsu@key% new + \unless\ifcsname KV@#1@\kvsu@key\endcsname + \unless\ifcsname KVS@#1@handler\endcsname + \kv@error@unknownkey{#1}{\kvsu@key}% + \else + \csname KVS@#1@handler\endcsname{#2}{#3}% + % still using #2 #3 here is intentional: handler might + % be used for strange stuff like implementing key names + % that contain strange characters or other strange things. + \relax + \fi + \else + \ifx\kv@value\relax + \unless\ifcsname KV@#1@\kvsu@key @default\endcsname + \kv@error@novalue{#1}{\kvsu@key}% + \else + \csname KV@#1@\kvsu@key @default\endcsname + \relax + \fi + \else + \csname KV@#1@\kvsu@key\endcsname{#3}% + \fi + \fi + } +} + % useful key handler defaults. \newcommand\thmt@mkignoringkeyhandler[1]{% \kv@set@family@handler{#1}{% @@ -177,10 +228,13 @@ \thmt@mkextendingkeyhandler{thmdef}{thmdef}{\string\declaretheorem\space key} +\let\thmt@newtheorem\newtheorem + \newcommand\declaretheorem[2][]{% - \let\thmt@theoremdefiner\thmt@original@newtheorem + % why was that here? + %\let\thmt@theoremdefiner\thmt@original@newtheorem \def\thmt@envname{#2}% - \thmt@setthmname{\MakeUppercase #2}% + \thmt@setthmname{\thmt@modifycase #2}% \thmt@setparent{}% \thmt@setsibling{}% \thmt@isnumberedtrue% @@ -188,12 +242,14 @@ \kvsetkeys{thmdef0}{#1}% \kvsetkeys{thmdef}{#1}% \protected@edef\thmt@tmp{% - \@nx\newtheorem + \@nx\thmt@newtheorem \ifthmt@isnumbered\else *\fi {#2}% \ifx\thmt@sibling\@empty\else [\thmt@sibling]\fi {\thmt@thmname}% \ifx\thmt@parent\@empty\else [\thmt@parent]\fi + \relax% added so we can delimited-read everything later + % (recall newtheorem is patched) }%\show\thmt@tmp \thmt@tmp % uniquely ugly kludge: some keys make only sense @@ -275,6 +331,28 @@ \def\thmt@newoptarg{#1\@iden}% } +\providecommand\thmt@suspendcounter[2]{% + \@xa\protected@edef\csname the#1\endcsname{#2}% + \@xa\let\csname c@#1\endcsname\c@thmt@dummyctr +} + +\providecommand\thmcontinues[1]{% + \ifcsname hyperref\endcsname + \hyperref[#1]{continuing} + \else + continuing + \fi + from p.\,\pageref{#1}% +} + +\thmt@define@thmuse@key{continues}{% + \thmt@suspendcounter{\thmt@envname}{\thmt@trivialref{#1}{??}}% + \g@addto@macro\thmt@newoptarg{{, }% + \thmcontinues{#1}% + \@iden}% +} + + % \end{macrocode} % % Defining new theorem styles; keys are in opt-arg @@ -297,8 +375,10 @@ \@onlypreamble\declaretheoremstyle \kv@set@family@handler{thmstyle}{% + \@onelevel@sanitize\kv@value + \@onelevel@sanitize\kv@key \PackageInfo{thmtools}{% - Key `#1' (with value `#2')\MessageBreak + Key `\kv@key' (with value `\kv@value')\MessageBreak is not a known style key.\MessageBreak Will pass this to every \string\declaretheorem\MessageBreak that uses `style=\thmt@style'% diff --git a/Master/texmf-dist/source/latex/thmtools/thm-llncs.dtx b/Master/texmf-dist/source/latex/thmtools/thm-llncs.dtx new file mode 100644 index 00000000000..5a3b480c2e1 --- /dev/null +++ b/Master/texmf-dist/source/latex/thmtools/thm-llncs.dtx @@ -0,0 +1,90 @@ +% \iffalse meta-comment +% +% Copyright (C) 2010 by Ulrich M. Schwarz +% See file COPYING for more details. +%\fi +% +%\iffalse (hide this from DocInput) +%<*llncs> +%\fi +% \begin{macrocode} +\@ifclasslater{llncs}{2010/04/15}{}{% + \PackageWarningNoLine{thmtools}{% + LLNCS.cls too old, not supported by thmtools + }% + \endinput} +% Thank you very much, Springer, for having yet another bloody +% system. Annoyingly, it makes \xdefs all over the place, so +% they break \MakeUppercase and hence name=. +\ifx\thmt@modifycase\@empty\else + \PackageWarningNoLine{thmtools}{% + LLNCS support disables automatic casing of theorem names + }% + \let\thmt@modifycase\@empty +\fi +%% +% Usage: +% +% \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font} +% or \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font} +% or \spnewtheorem*{env_nam}{caption}{cap_font}{body_font} +\providecommand\thmt@style@headfont{\normalfont\bfseries} +\providecommand\thmt@style@bodyfont{\normalfont\itshape} + +\let\thmt@original@spnewtheorem\spnewtheorem +\let\thmt@theoremdefiner\thmt@original@spnewtheorem + +% cf thm-patch.dtx +\def\spnewtheorem{% + \thmt@isstarredfalse + \thmt@hassiblingfalse + \thmt@hasparentfalse + \parse{% + {\parseFlag*{\thmt@isstarredtrue}{}}% + {\parseMand{\def\thmt@envname{##1}}}% + {\parseOpt[]{\thmt@hassiblingtrue\def\thmt@sibling{##1}}{}}% + {\parseMand{% + \def\thmt@thmname{##1}% + }}% + {\parseOpt[]{\thmt@hasparenttrue\def\thmt@parent{##1}}{}}% + {\parseMand{\def\thmt@style@headfont{##1}}}% + {\parseMand{\def\thmt@style@bodyfont{##1}}}% + {\let\@parsecmd\thmt@spnewtheoremiv}% + }% +} + +\newcommand\thmt@spnewtheoremiv{% + \thmt@newtheorem@predefinition + % whee, now reassemble the whole shebang. + \protected@edef\thmt@args{% + \@nx\thmt@theoremdefiner% + \ifthmt@isstarred *\fi + {\thmt@envname}% + \ifthmt@hassibling [\thmt@sibling]\fi + {\thmt@thmname}% + \ifthmt@hasparent [\thmt@parent]\fi + {\thmt@style@headfont}{\thmt@style@bodyfont}% + } + \thmt@args + \thmt@newtheorem@postdefinition +} + +% for the keyval interface: +\define@key{thmdef}{headfont}{% + \def\thmt@style@headfont{#1}% +} +\define@key{thmdef}{bodyfont}{% +\def\thmt@style@bodyfont{#1}% +} + +\def\thmt@almost@spnewtheorem#1\relax{% + \def\thm@tmpa{\spnewtheorem#1}% + \@xa\@xa\@xa\thm@tmpa + \@xa\@xa\@xa{\@xa\thmt@style@headfont\@xa}% + \@xa{\thmt@style@bodyfont}% +} +\let\thmt@newtheorem\thmt@almost@spnewtheorem +% \end{macrocode} +%\iffalse (hide this from DocInput) +% +%\fi diff --git a/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx b/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx index 3cb6a6fcd1d..498f20f676a 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx @@ -64,9 +64,16 @@ \thmt@local@preheadhook \csname thmt@#1@preheadhook\endcsname \thmt@generic@preheadhook - \protected@edef\tmp@args{% - \ifx\@empty\thmt@optarg\else [{\thmt@optarg}]\fi - }% + % change following to \@xa-orgy at some point? + % forex, might have keyvals involving commands. + %\protected@edef\tmp@args{% + % \ifx\@empty\thmt@optarg\else [{\thmt@optarg}]\fi + %}% + \ifx\@empty\thmt@optarg + \def\tmp@args{}% + \else + \@xa\def\@xa\tmp@args\@xa{\@xa[\@xa{\thmt@optarg}]}% + \fi \csname thmt@original@#1\@xa\endcsname\tmp@args %%moved down: \thmt@local@postheadhook %% (give postheadhooks a chance to re-set nameref data) diff --git a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx index 1abbee30f6c..8faec5f2fd4 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx @@ -101,21 +101,42 @@ \@xa\@firstoftwo% this is the end of the environment. \else \@xa\@secondoftwo% go on collecting - \fi{% + \fi{% this is the end, my friend, drop the \end. + % and call #1 with the collected body. \@xa#1\@xa{\the\thmt@toks}% - }{% + }{% go on collecting \@xa\thmt@toks\@xa{\the\thmt@toks\end{#3}}% \thmt@collect@body{#1}% }% } - +% \end{macrocode} +% A totally ignorant version of |\ref|, defaulting to \#2 if label not +% known yet. Otherwise, return the formatted number. +% \begin{macrocode} \def\thmt@trivialref#1#2{% \ifcsname r@#1\endcsname \@xa\@xa\@xa\thmt@trivi@lr@f\csname r@#1\endcsname\relax\@nil \else #2\fi } \def\thmt@trivi@lr@f#1#2\@nil{#1} - +% \end{macrocode} +% +% Counter safeties: some counters' values should be stored, such as +% equation, so we don't get a new number. (We cannot reference it anyway.) +% We cannot store everything, though, think page counter or section number! +% There is one problem here: we have to remove all references to other +% counters from |\theequation|, otherwise your equation could get a number +% like (3.1) in one place and (4.1) in another section. +% +% The best solution I can come up with is to override the usual macros +% that counter display goes through, to check if their argument is one +% that should be fully-expanded away or retained. +% +% The following should only be called from within a group, and the sanitized +% |\thectr| must not be called from within that group, since it needs the +% original |\@arabic| et al. +% +% \begin{macrocode} \def\thmt@innercounters{% equation} \def\thmt@counterformatters{% @@ -140,10 +161,38 @@ \fi } +\def\thmt@rst@storecounters#1{% + \bgroup + % ugly hack: save chapter,..subsection numbers + % for equation numbers. + \refstepcounter{thmt@dummyctr}% why is this here? + \def\@currentlabel{}% + \@for\ctr:=\thmt@innercounters\do{% + \thmt@sanitizethe{\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}% + \fi + \protect\setcounter{\ctr}{\number\csname c@\ctr\endcsname}% + }% + }% + \label{thmt@@#1@data}% + \egroup +}% +% \end{macrocode} +% +% Now, the main business. +% +% \begin{macrocode} \newif\ifthmt@thisistheone \newenvironment{thmt@restatable}[3][]{% - \thmt@toks{}% - \stepcounter{thmt@dummyctr}% + \thmt@toks{}% will hold body +% + \stepcounter{thmt@dummyctr}% used for data storage label. +% \long\def\thmrst@store##1{% \@xa\gdef\csname #3\endcsname{% \@ifstar{% @@ -155,57 +204,58 @@ \@xa\long\@xa\gdef\csname thmt@stored@#3\@xa\endcsname\@xa{% \begingroup \ifthmt@thisistheone - \bgroup - % ugly hack: save chapter,..subsection numbers - % for equation numbers. - \refstepcounter{thmt@dummyctr}% - \def\@currentlabel{}% - \@for\ctr:=\thmt@innercounters\do{% - \thmt@sanitizethe{\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}% - \fi - \protect\setcounter{\ctr}{\number\csname c@\ctr\endcsname}% - }% - }% - \label{thmt@@#3@data}% - \egroup + % these are the valid numbers, store them for the other + % occasions. + \thmt@rst@storecounters{#3}% \else + % this one should use other numbers... + % first, fake the theorem number. \@xa\protected@edef\csname the#2\endcsname{% \thmt@trivialref{thmt@@#3}{??}}% + % if the number wasn't there, have a "re-run to get labels right" + % warning. \ifcsname r@thmt@@#3\endcsname\else \G@refundefinedtrue \fi + % prevent stepcountering the theorem number, + % but still, have some number for hyperref, just in case. \@xa\let\csname c@#2\endcsname=\c@thmt@dummyctr \@xa\let\csname theH#2\endcsname=\theHthmt@dummyctr + % disable labeling. \let\label=\@gobble \let\ltx@label=\@gobble% amsmath needs this + % We shall need to restore the counters at the end + % of the environment, so we get + % (4.2) [(3.1 from restate)] (4.3) \def\thmt@restorecounters{}% \@for\ctr:=\thmt@innercounters\do{% \protected@edef\thmt@restorecounters{% \thmt@restorecounters - \protect\setcounter{equation}{\arabic{equation}}% + \protect\setcounter{\ctr}{\arabic{\ctr}}% }% - } + }% + % pull the new semi-static definition of \theequation et al. + % from the aux file. \thmt@trivialref{thmt@@#3@data}{}% \fi - %\def\@currenvir{#2}% - \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[#1]\fi + % call the proper begin-env code, possibly with optional argument + \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[{#1}]\fi \ifthmt@thisistheone + % store a label so we can pick up the number later. \label{thmt@@#3}% \fi + % this will be the collected body. ##1 \csname end#2\endcsname + % if we faked the counter values, restore originals now. \ifthmt@thisistheone\else\thmt@restorecounters\fi \endgroup - }% + }% thmt@stored@#3 + % in either case, now call the just-created macro, \csname #3\@xa\endcsname\ifthmt@thisistheone\else*\fi + % and artificially close the current environment. \@xa\end\@xa{\@currenvir} - }% + }% thm@rst@store \thmt@collect@body\thmrst@store }{% %% now empty, just used as a marker. diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx index 80782f0fb76..b480838ffec 100644 --- a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx @@ -38,6 +38,12 @@ \def\thmt@quark{\thmt@quark} \newtoks\thmt@toks +\@for\opt:=lowercase,uppercase,anycase\do{% + \@xa\DeclareOption\@xa{\opt}{% + \@xa\PassOptionsToPackage\@xa{\CurrentOption}{thm-kv}% + }% +} + \ProcessOptions\relax % a scratch counter, mostly for fake hyperlinks @@ -74,6 +80,9 @@ \@ifclassloaded{beamer}{% \RequirePackage{thm-beamer} }{} +\@ifclassloaded{llncs}{% + \RequirePackage{thm-llncs} +}{} % \end{macrocode} %\iffalse diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.ins b/Master/texmf-dist/source/latex/thmtools/thmtools.ins index 852d3e3358f..45016df995d 100644 --- a/Master/texmf-dist/source/latex/thmtools/thmtools.ins +++ b/Master/texmf-dist/source/latex/thmtools/thmtools.ins @@ -37,6 +37,7 @@ http://www.latex-project.org/lppl/lppl-1-3a.txt \file{thm-amsthm.sty}{\from{thm-amsthm.dtx}{amsthm}} \file{thm-ntheorem.sty}{\from{thm-ntheorem.dtx}{ntheorem}} \file{thm-beamer.sty}{\from{thm-beamer.dtx}{beamer}} + \file{thm-llncs.sty}{\from{thm-llncs.dtx}{llncs}} \file{thmdef-shaded.sty}{\from{thmdef-shaded.dtx}{shaded}} \file{thmdef-thmbox.sty}{\from{thmdef-thmbox.dtx}{thmbox}} } diff --git a/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty b/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty index 89ca277e187..4337fd0f579 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/06/08 v35] +\ProvidesPackage {aliasctr}[2010/07/05 v41] \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 eeb6af8e3f3..d49ac610c97 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/06/08 v35] +\ProvidesPackage {parseargs}[2010/07/05 v41] \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 954ce933813..cb091d7e283 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/06/08 v35] +\ProvidesPackage {thm-amsthm}[2010/07/05 v41] \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 99b80416d94..2ec7525501a 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/06/08 v35] +\ProvidesPackage {thm-autoref}[2010/07/05 v41] \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 04b034e4939..b62aefcbfab 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/06/08 v35] +\ProvidesPackage {thm-beamer}[2010/07/05 v41] \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 47b0808b1ce..7ec6386128a 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty @@ -20,12 +20,63 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-kv}[2010/06/08 v35] +\ProvidesPackage {thm-kv}[2010/07/05 v41] \let\@xa\expandafter \let\@nx\noexpand + +\DeclareOption{lowercase}{% + \PackageInfo{thm-kv}{Theorem names will be lowercased}% + \global\let\thmt@modifycase\MakeLowercase} + +\DeclareOption{uppercase}{% + \PackageInfo{thm-kv}{Theorem names will be uppercased}% + \global\let\thmt@modifycase\MakeUppercase} + +\DeclareOption{anycase}{% + \PackageInfo{thm-kv}{Theorem names will be unchanged}% + \global\let\thmt@modifycase\@empty} + +\ExecuteOptions{uppercase} +\ProcessOptions\relax + \RequirePackage{keyval,kvsetkeys,thm-patch} +\@ifpackagelater{kvsetkeys}{2010/07/02}{% + % assume Heiko goes along with my patch... +}{% + \RequirePackage{etex} + \PackageInfo{thm-kv}{kvsetkeys patch applied}% + \long\def\kv@processor@default#1#2#3{% + \protected@edef\kvsu@fam{#1}% new + \@onelevel@sanitize\kvsu@fam% new + \protected@edef\kvsu@key{#2}% new + \@onelevel@sanitize\kvsu@key% new + \unless\ifcsname KV@#1@\kvsu@key\endcsname + \unless\ifcsname KVS@#1@handler\endcsname + \kv@error@unknownkey{#1}{\kvsu@key}% + \else + \csname KVS@#1@handler\endcsname{#2}{#3}% + % still using #2 #3 here is intentional: handler might + % be used for strange stuff like implementing key names + % that contain strange characters or other strange things. + \relax + \fi + \else + \ifx\kv@value\relax + \unless\ifcsname KV@#1@\kvsu@key @default\endcsname + \kv@error@novalue{#1}{\kvsu@key}% + \else + \csname KV@#1@\kvsu@key @default\endcsname + \relax + \fi + \else + \csname KV@#1@\kvsu@key\endcsname{#3}% + \fi + \fi + } +} + \newcommand\thmt@mkignoringkeyhandler[1]{% \kv@set@family@handler{#1}{% \thmt@debug{Key `##1' with value `##2' ignored by #1.}% @@ -170,10 +221,13 @@ \thmt@mkextendingkeyhandler{thmdef}{thmdef}{\string\declaretheorem\space key} +\let\thmt@newtheorem\newtheorem + \newcommand\declaretheorem[2][]{% - \let\thmt@theoremdefiner\thmt@original@newtheorem + % why was that here? + %\let\thmt@theoremdefiner\thmt@original@newtheorem \def\thmt@envname{#2}% - \thmt@setthmname{\MakeUppercase #2}% + \thmt@setthmname{\thmt@modifycase #2}% \thmt@setparent{}% \thmt@setsibling{}% \thmt@isnumberedtrue% @@ -181,12 +235,14 @@ \kvsetkeys{thmdef0}{#1}% \kvsetkeys{thmdef}{#1}% \protected@edef\thmt@tmp{% - \@nx\newtheorem + \@nx\thmt@newtheorem \ifthmt@isnumbered\else *\fi {#2}% \ifx\thmt@sibling\@empty\else [\thmt@sibling]\fi {\thmt@thmname}% \ifx\thmt@parent\@empty\else [\thmt@parent]\fi + \relax% added so we can delimited-read everything later + % (recall newtheorem is patched) }%\show\thmt@tmp \thmt@tmp % uniquely ugly kludge: some keys make only sense @@ -266,6 +322,27 @@ \def\thmt@newoptarg{#1\@iden}% } +\providecommand\thmt@suspendcounter[2]{% + \@xa\protected@edef\csname the#1\endcsname{#2}% + \@xa\let\csname c@#1\endcsname\c@thmt@dummyctr +} + +\providecommand\thmcontinues[1]{% + \ifcsname hyperref\endcsname + \hyperref[#1]{continuing} + \else + continuing + \fi + from p.\,\pageref{#1}% +} + +\thmt@define@thmuse@key{continues}{% + \thmt@suspendcounter{\thmt@envname}{\thmt@trivialref{#1}{??}}% + \g@addto@macro\thmt@newoptarg{{, }% + \thmcontinues{#1}% + \@iden}% +} + \def\thmt@declaretheoremstyle@setup{} \def\thmt@declaretheoremstyle#1{% \PackageWarning{thmtools}{Your backend doesn't allow styling theorems}{} @@ -280,8 +357,10 @@ \@onlypreamble\declaretheoremstyle \kv@set@family@handler{thmstyle}{% + \@onelevel@sanitize\kv@value + \@onelevel@sanitize\kv@key \PackageInfo{thmtools}{% - Key `#1' (with value `#2')\MessageBreak + Key `\kv@key' (with value `\kv@value')\MessageBreak is not a known style key.\MessageBreak Will pass this to every \string\declaretheorem\MessageBreak that uses `style=\thmt@style'% diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty index a302e139a0f..d3586991893 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/06/08 v35] +\ProvidesPackage {thm-listof}[2010/07/05 v41] \let\@xa=\expandafter \let\@nx=\noexpand \RequirePackage{thm-patch,keyval,kvsetkeys} diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty b/Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty new file mode 100644 index 00000000000..d788539e80d --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thm-llncs.sty @@ -0,0 +1,92 @@ +%% +%% This is file `thm-llncs.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thm-llncs.dtx (with options: `llncs') +%% This is a generated file. +%% +%% This file is part of the `thmtools' package. +%% 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. +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, version 1.3a. +%% This version is obtainable at +%% http://www.latex-project.org/lppl/lppl-1-3a.txt +%% +%% +\NeedsTeXFormat {LaTeX2e} +\ProvidesPackage {thm-llncs}[2010/07/05 v41] +\@ifclasslater{llncs}{2010/04/15}{}{% + \PackageWarningNoLine{thmtools}{% + LLNCS.cls too old, not supported by thmtools + }% + \endinput} +\ifx\thmt@modifycase\@empty\else + \PackageWarningNoLine{thmtools}{% + LLNCS support disables automatic casing of theorem names + }% + \let\thmt@modifycase\@empty +\fi +%% +\providecommand\thmt@style@headfont{\normalfont\bfseries} +\providecommand\thmt@style@bodyfont{\normalfont\itshape} + +\let\thmt@original@spnewtheorem\spnewtheorem +\let\thmt@theoremdefiner\thmt@original@spnewtheorem + +\def\spnewtheorem{% + \thmt@isstarredfalse + \thmt@hassiblingfalse + \thmt@hasparentfalse + \parse{% + {\parseFlag*{\thmt@isstarredtrue}{}}% + {\parseMand{\def\thmt@envname{##1}}}% + {\parseOpt[]{\thmt@hassiblingtrue\def\thmt@sibling{##1}}{}}% + {\parseMand{% + \def\thmt@thmname{##1}% + }}% + {\parseOpt[]{\thmt@hasparenttrue\def\thmt@parent{##1}}{}}% + {\parseMand{\def\thmt@style@headfont{##1}}}% + {\parseMand{\def\thmt@style@bodyfont{##1}}}% + {\let\@parsecmd\thmt@spnewtheoremiv}% + }% +} + +\newcommand\thmt@spnewtheoremiv{% + \thmt@newtheorem@predefinition + % whee, now reassemble the whole shebang. + \protected@edef\thmt@args{% + \@nx\thmt@theoremdefiner% + \ifthmt@isstarred *\fi + {\thmt@envname}% + \ifthmt@hassibling [\thmt@sibling]\fi + {\thmt@thmname}% + \ifthmt@hasparent [\thmt@parent]\fi + {\thmt@style@headfont}{\thmt@style@bodyfont}% + } + \thmt@args + \thmt@newtheorem@postdefinition +} + +\define@key{thmdef}{headfont}{% + \def\thmt@style@headfont{#1}% +} +\define@key{thmdef}{bodyfont}{% +\def\thmt@style@bodyfont{#1}% +} + +\def\thmt@almost@spnewtheorem#1\relax{% + \def\thm@tmpa{\spnewtheorem#1}% + \@xa\@xa\@xa\thm@tmpa + \@xa\@xa\@xa{\@xa\thmt@style@headfont\@xa}% + \@xa{\thmt@style@bodyfont}% +} +\let\thmt@newtheorem\thmt@almost@spnewtheorem +\endinput +%% +%% End of file `thm-llncs.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-ntheorem.sty b/Master/texmf-dist/tex/latex/thmtools/thm-ntheorem.sty index f505ddc2691..db1d91ae80c 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/06/08 v35] +\ProvidesPackage {thm-ntheorem}[2010/07/05 v41] \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 831e32e3459..5051b80cb60 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/06/08 v35] +\ProvidesPackage {thm-patch}[2010/07/05 v41] \RequirePackage{parseargs} \newif\ifthmt@isstarred @@ -40,9 +40,16 @@ \thmt@local@preheadhook \csname thmt@#1@preheadhook\endcsname \thmt@generic@preheadhook - \protected@edef\tmp@args{% - \ifx\@empty\thmt@optarg\else [{\thmt@optarg}]\fi - }% + % change following to \@xa-orgy at some point? + % forex, might have keyvals involving commands. + %\protected@edef\tmp@args{% + % \ifx\@empty\thmt@optarg\else [{\thmt@optarg}]\fi + %}% + \ifx\@empty\thmt@optarg + \def\tmp@args{}% + \else + \@xa\def\@xa\tmp@args\@xa{\@xa[\@xa{\thmt@optarg}]}% + \fi \csname thmt@original@#1\@xa\endcsname\tmp@args %%moved down: \thmt@local@postheadhook %% (give postheadhooks a chance to re-set nameref data) diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty index 7df9032c04a..7e4c11447f2 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty @@ -20,7 +20,7 @@ %% %% \NeedsTeXFormat {LaTeX2e} -\ProvidesPackage {thm-restate}[2010/06/08 v35] +\ProvidesPackage {thm-restate}[2010/07/05 v41] \let\@xa\expandafter \let\@nx\noexpand @@ -36,21 +36,20 @@ \@xa\@firstoftwo% this is the end of the environment. \else \@xa\@secondoftwo% go on collecting - \fi{% + \fi{% this is the end, my friend, drop the \end. + % and call #1 with the collected body. \@xa#1\@xa{\the\thmt@toks}% - }{% + }{% go on collecting \@xa\thmt@toks\@xa{\the\thmt@toks\end{#3}}% \thmt@collect@body{#1}% }% } - \def\thmt@trivialref#1#2{% \ifcsname r@#1\endcsname \@xa\@xa\@xa\thmt@trivi@lr@f\csname r@#1\endcsname\relax\@nil \else #2\fi } \def\thmt@trivi@lr@f#1#2\@nil{#1} - \def\thmt@innercounters{% equation} \def\thmt@counterformatters{% @@ -75,10 +74,31 @@ \fi } +\def\thmt@rst@storecounters#1{% + \bgroup + % ugly hack: save chapter,..subsection numbers + % for equation numbers. + \refstepcounter{thmt@dummyctr}% why is this here? + \def\@currentlabel{}% + \@for\ctr:=\thmt@innercounters\do{% + \thmt@sanitizethe{\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}% + \fi + \protect\setcounter{\ctr}{\number\csname c@\ctr\endcsname}% + }% + }% + \label{thmt@@#1@data}% + \egroup +}% \newif\ifthmt@thisistheone \newenvironment{thmt@restatable}[3][]{% - \thmt@toks{}% - \stepcounter{thmt@dummyctr}% + \thmt@toks{}% will hold body + \stepcounter{thmt@dummyctr}% used for data storage label. \long\def\thmrst@store##1{% \@xa\gdef\csname #3\endcsname{% \@ifstar{% @@ -90,57 +110,58 @@ \@xa\long\@xa\gdef\csname thmt@stored@#3\@xa\endcsname\@xa{% \begingroup \ifthmt@thisistheone - \bgroup - % ugly hack: save chapter,..subsection numbers - % for equation numbers. - \refstepcounter{thmt@dummyctr}% - \def\@currentlabel{}% - \@for\ctr:=\thmt@innercounters\do{% - \thmt@sanitizethe{\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}% - \fi - \protect\setcounter{\ctr}{\number\csname c@\ctr\endcsname}% - }% - }% - \label{thmt@@#3@data}% - \egroup + % these are the valid numbers, store them for the other + % occasions. + \thmt@rst@storecounters{#3}% \else + % this one should use other numbers... + % first, fake the theorem number. \@xa\protected@edef\csname the#2\endcsname{% \thmt@trivialref{thmt@@#3}{??}}% + % if the number wasn't there, have a "re-run to get labels right" + % warning. \ifcsname r@thmt@@#3\endcsname\else \G@refundefinedtrue \fi + % prevent stepcountering the theorem number, + % but still, have some number for hyperref, just in case. \@xa\let\csname c@#2\endcsname=\c@thmt@dummyctr \@xa\let\csname theH#2\endcsname=\theHthmt@dummyctr + % disable labeling. \let\label=\@gobble \let\ltx@label=\@gobble% amsmath needs this + % We shall need to restore the counters at the end + % of the environment, so we get + % (4.2) [(3.1 from restate)] (4.3) \def\thmt@restorecounters{}% \@for\ctr:=\thmt@innercounters\do{% \protected@edef\thmt@restorecounters{% \thmt@restorecounters - \protect\setcounter{equation}{\arabic{equation}}% + \protect\setcounter{\ctr}{\arabic{\ctr}}% }% - } + }% + % pull the new semi-static definition of \theequation et al. + % from the aux file. \thmt@trivialref{thmt@@#3@data}{}% \fi - %\def\@currenvir{#2}% - \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[#1]\fi + % call the proper begin-env code, possibly with optional argument + \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[{#1}]\fi \ifthmt@thisistheone + % store a label so we can pick up the number later. \label{thmt@@#3}% \fi + % this will be the collected body. ##1 \csname end#2\endcsname + % if we faked the counter values, restore originals now. \ifthmt@thisistheone\else\thmt@restorecounters\fi \endgroup - }% + }% thmt@stored@#3 + % in either case, now call the just-created macro, \csname #3\@xa\endcsname\ifthmt@thisistheone\else*\fi + % and artificially close the current environment. \@xa\end\@xa{\@currenvir} - }% + }% thm@rst@store \thmt@collect@body\thmrst@store }{% %% now empty, just used as a marker. diff --git a/Master/texmf-dist/tex/latex/thmtools/thmdef-shaded.sty b/Master/texmf-dist/tex/latex/thmtools/thmdef-shaded.sty index fb7c702151f..d72436f7bf2 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/06/08 v35] +\ProvidesPackage {thmdef-shaded}[2010/07/05 v41] \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 bc343754c16..8134fa0fa05 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/06/08 v35] +\ProvidesPackage {thmdef-thmbox}[2010/07/05 v41] \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 3d7da9e41bf..5ada8535cf0 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/06/08 v35] +\ProvidesPackage {thmtools}[2010/07/05 v41] \DeclareOption{debug}{% \def\thmt@debug{\typeout}% } @@ -30,6 +30,12 @@ \def\thmt@quark{\thmt@quark} \newtoks\thmt@toks +\@for\opt:=lowercase,uppercase,anycase\do{% + \@xa\DeclareOption\@xa{\opt}{% + \@xa\PassOptionsToPackage\@xa{\CurrentOption}{thm-kv}% + }% +} + \ProcessOptions\relax \newcounter{thmt@dummyctr}% @@ -63,6 +69,9 @@ \@ifclassloaded{beamer}{% \RequirePackage{thm-beamer} }{} +\@ifclassloaded{llncs}{% + \RequirePackage{thm-llncs} +}{} \endinput %% diff --git a/Master/texmf-dist/tex/latex/thmtools/unique.sty b/Master/texmf-dist/tex/latex/thmtools/unique.sty index 378dd6dce8b..f736efb1022 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/06/08 v35] +\ProvidesPackage {unique}[2010/07/05 v41] \DeclareOption{unq}{% \newwrite\uniq@channel -- cgit v1.2.3