From 47f4481a23ad516f02cbd8a8bd2a2c180a1ac883 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Wed, 25 Jun 2008 11:34:57 +0000 Subject: thmtools patch update v0.1beta6 2008/06/22 git-svn-id: svn://tug.org/texlive/trunk@9040 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/thmtools/parseargs.sty | 71 ++++++++++++ .../texmf-dist/tex/latex/thmtools/thm-autoref.sty | 2 +- Master/texmf-dist/tex/latex/thmtools/thm-kv.sty | 46 +++++++- .../texmf-dist/tex/latex/thmtools/thm-listof.sty | 17 ++- Master/texmf-dist/tex/latex/thmtools/thm-patch.sty | 122 +++++++++++++++------ .../texmf-dist/tex/latex/thmtools/thm-restate.sty | 68 ++++++++---- Master/texmf-dist/tex/latex/thmtools/thmtools.sty | 26 +++++ 7 files changed, 290 insertions(+), 62 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/thmtools/parseargs.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/thmtools.sty (limited to 'Master/texmf-dist/tex/latex/thmtools') diff --git a/Master/texmf-dist/tex/latex/thmtools/parseargs.sty b/Master/texmf-dist/tex/latex/thmtools/parseargs.sty new file mode 100644 index 00000000000..6e4d5f79ccf --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/parseargs.sty @@ -0,0 +1,71 @@ +%% +%% This is file `parseargs.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% parseargs.dtx (with options: `parseargs') +%% 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 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{parseargs}[2008/05/12 v0.1alpha1 generic argument parser (ulmi)] + +\newtoks\@parsespec +\def\parse@endquark{\parse@endquark} +\newcommand\parse[1]{% + \@parsespec{#1\parse@endquark}\@parse} + +\newcommand\@parse{% + \edef\p@tmp{\the\@parsespec}% + \ifx\p@tmp\parse@endquark + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi{% + \@parsepop + }% +} +\def\@parsepop{% + \expandafter\p@rsepop\the\@parsespec\@nil + \@parsecmd +} +\def\p@rsepop#1#2\@nil{% + #1% + \@parsespec{#2}% +} + +\newcommand\parseOpt[4]{% + %\parseOpt{openchar}{closechar}{yes}{no} + \def\@parsecmd{% + \@ifnextchar#1{\@@reallyparse}{#4\@parse} + }% + \def\@@reallyparse#1##1#2{% + #3\@parse + }% +} + +\newcommand\parseMand[1]{% + %\parseMand{code} + \def\@parsecmd##1{#1\@parse}% +} + +\newcommand\parseFlag[3]{% + %\parseFlag{flagchar}{yes}{no} + \def\@parsecmd{% + \@ifnextchar#1{#2\expandafter\@parse\@gobble}{#3\@parse}% + }% +} +\endinput +%% +%% End of file `parseargs.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty b/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty index 51cdd97d018..663fd9001b9 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty @@ -19,7 +19,7 @@ %% http://www.latex-project.org/lppl/lppl-1-3a.txt %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{thm-autoref}[2008/02/17 BETA thm-autoref (ulmi)] +\ProvidesPackage{thm-autoref}[2008/03/09 v0.1beta2 thm-autoref (ulmi)] \RequirePackage{thm-patch, aliasctr} diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty index 7a5c5899f26..534135a8316 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty @@ -19,7 +19,7 @@ %% http://www.latex-project.org/lppl/lppl-1-3a.txt %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{thm-kv}[2008/02/17 BETA thm-kv interface (ulmi)] +\ProvidesPackage{thm-kv}[2008/06/22 v0.1beta6 thm-kv interface (ulmi)] \let\@xa\expandafter \let\@nx\noexpand \usepackage{keyval} @@ -39,6 +39,21 @@ \define@key{thmt}{unnumbered}[]{\thmt@isnumberedfalse} \define@key{thmt}{starred}[]{\thmt@isnumberedfalse} +\define@key{thmt}{preheadhook}{\addtotheorempreheadhook[\thmt@envname]{#1}} +\define@key{thmt}{postheadhook}{\addtotheorempostheadhook[\thmt@envname]{#1}} +\define@key{thmt}{prefoothook}{\addtotheoremprefoothook[\thmt@envname]{#1}} +\define@key{thmt}{postfoothook}{\addtotheorempostfoothook[\thmt@envname]{#1}} + +\define@key{thmt}{style}{\thmt@setstyle{#1}} + +\providecommand\theoremstyle[1]{% + \PackageWarning{thm-kv}{% + Your backend doesn't have a `\string\theoremstyle' command.\MessageBreak + Your style request `#1' was ignored + }% +} +\let\thmt@setstyle\theoremstyle + \newif\ifthmt@isnumbered \newcommand\thmt@setparent[1]{% \def\thmt@parent{#1}% @@ -51,6 +66,8 @@ } \newcommand\declaretheorem[2][]{% + \let\thmt@theoremdefiner\thmt@original@newtheorem + \def\thmt@envname{#2}% \thmt@setthmname{\MakeUppercase #2}% \thmt@setparent{}% \thmt@setsibling{}% @@ -65,7 +82,34 @@ \ifx\thmt@parent\@empty\else [\thmt@parent]\fi }%\show\thmt@tmp \thmt@tmp + % uniquely ugly kludge: some keys make only sense + % afterwards. + \setkeys{thmt}{#1}% } + \define@key{thmt}{shaded}[{}]{% + \RequirePackage{shadethm}% + \addtotheorempreheadhook[\thmt@envname]{% + \setlength\shadedtextwidth{\linewidth}% + \setkeys{thmt@shade}{#1}\begin{shadebox}}% + \addtotheorempostfoothook[\thmt@envname]{\end{shadebox}}% + } +\define@key{thmt@shade}{textwidth}{\setlength\shadedtextwidth{#1}} +\define@key{thmt@shade}{bgcolor}{\definecolor{shadethmcolor}#1} +\define@key{thmt@shade}{rulecolor}{\definecolor{shaderulecolor}#1} +\define@key{thmt@shade}{rulewidth}{\setlength\shadeboxrule{#1}} +\define@key{thmt@shade}{margin}{\setlength\shadeboxsep{#1}} + \define@key{thmt}{thmbox}[L]{% + \let\oldproof=\proof + \let\oldendproof=\endproof + \let\oldexample=\example + \let\oldendexample=\endexample + \RequirePackage[nothm]{thmbox} + \let\proof=\oldproof + \let\endproof=\oldendproof + \let\example=\oldexample + \let\endexample=\oldendexample + \def\thmt@theoremdefiner{\newboxtheorem[#1]}% + }% \endinput %% %% End of file `thm-kv.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty index d120829c6ef..ffcf87aa17b 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty @@ -19,11 +19,23 @@ %% http://www.latex-project.org/lppl/lppl-1-3a.txt %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{thm-listof}[2008/02/17 BETA thm-listof (ulmi)] +\ProvidesPackage{thm-listof}[2008/05/10 v0.1beta3 thm-listof (ulmi)] \let\@xa=\expandafter \let\@nx=\noexpand \RequirePackage{thm-patch} +\def\thmtlo@oldchapter{0}% +\newcommand\thmtlo@chaptervspacehack{} +\@ifundefined{chapter}{}{% + \def\thmtlo@chaptervspacehack{% + \ifnum \arabic{chapter}>\thmtlo@oldchapter\relax + % new chapter, add vspace to loe. + \addtocontents{loe}{\protect\addvspace{10\p@}}% + \edef\thmtlo@oldchapter{\arabic{chapter}}% + \fi + }% +} + \providecommand\listtheoremname{List of Theorems} \newcommand\listoftheorems{% %% much hacking here to pick up the definition from the class @@ -45,7 +57,8 @@ \thmt@mklistcmd } -\addtotheoremposthook{% +\addtotheorempostheadhook{% + \thmtlo@chaptervspacehack \addcontentsline{loe}{\thmt@envname}{% \numberline{\csname the\thmt@envname\endcsname}% \thmt@thmname diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty b/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty index 7b5315388e9..bc8d171a2c4 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty @@ -19,51 +19,83 @@ %% http://www.latex-project.org/lppl/lppl-1-3a.txt %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{thm-patch}[2008/02/17 BETA thm-patch (ulmi)] +\ProvidesPackage{thm-patch}[2008/06/22 v0.1beta6 thm-patch (ulmi)] \let\@xa=\expandafter \let\@nx=\noexpand +\RequirePackage{parseargs} \@ifundefined{c@thmt@dummyctr}{% \newcounter{thmt@dummyctr}% }{}% \gdef\theHthmt@dummyctr{dummy.\arabic{thmt@dummyctr}}% +\gdef\thethmt@dummyctr{}% \newif\ifthmt@isstarred \newif\ifthmt@hassibling \newif\ifthmt@hasparent +\@ifundefined{beamer@version}{% + \def\thmt@parsetheoremargs#1{% + \parse{% + {\parseOpt[]{\def\thmt@optarg{##1}}{\let\thmt@optarg\@empty}}% + {% + \csname thmt@#1@preheadhook\endcsname + \thmt@generic@preheadhook + \protected@edef\tmp@args{% + \ifx\@empty\thmt@optarg\else [\thmt@optarg]\fi + }% + \csname thmt@original@#1\@xa\endcsname\tmp@args + \csname thmt@#1@postheadhook\endcsname + \thmt@generic@postheadhook + \let\@parsecmd\@empty + }% + }% + }% +}{% + \newif\ifthmt@hasoverlay + \def\thmt@parsetheoremargs#1{% + \parse{% + {\parseOpt<>{\thmt@hasoverlaytrue\def\thmt@overlay{##1}}{}}% + {\parseOpt[]{\def\thmt@optarg{##1}}{\let\thmt@optarg\@empty}}% + {\ifthmt@hasoverlay\expandafter\@gobble\else\expandafter\@firstofone\fi + {\parseOpt<>{\thmt@hasoverlaytrue\def\thmt@overlay{##1}}{}}% + }% + {% + \csname thmt@#1@preheadhook\endcsname + \thmt@generic@preheadhook + \protected@edef\tmp@args{% + \ifthmt@hasoverlay <\thmt@overlay>\fi + \ifx\@empty\thmt@optarg\else [\thmt@optarg]\fi + }% + \csname thmt@original@#1\@xa\endcsname\tmp@args + \csname thmt@#1@postheadhook\endcsname + \thmt@generic@postheadhook + \let\@parsecmd\@empty + }% + } + }% +} + \let\thmt@original@newtheorem\newtheorem \def\newtheorem{% \thmt@isstarredfalse - \let\thmt@sibling=\relax \thmt@hassiblingfalse - \let\thmt@parent=\relax \thmt@hasparentfalse - \@ifstar - {\thmt@isstarredtrue\thmt@newtheoremii}% - {\thmt@newtheoremii}% -} -\newcommand\thmt@newtheoremii[1]{% - \def\thmt@envname{#1}% - \thmt@newtheoremiii -} -\newcommand\thmt@newtheoremiii[2][]{% - \def\thmt@thmname{#2}% - \ifx&\else - \thmt@hassiblingtrue - \def\thmt@sibling{#1}% - \fi - \@ifnextchar[{% - \thmt@hasparenttrue - \def\tmp@a[####1]{\def\thmt@parent{####1}\thmt@newtheoremiv}% - \tmp@a - }{% - \thmt@newtheoremiv + \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}}{}}% + {\let\@parsecmd\thmt@newtheoremiv}% }% } + \newcommand\thmt@newtheoremiv{% \thmt@newtheorem@predefinition % whee, now reassemble the whole shit. \protected@edef\thmt@args{% - \@nx\thmt@original@newtheorem% + \@nx\thmt@theoremdefiner% \ifthmt@isstarred *\fi {\thmt@envname}% \ifthmt@hassibling [\thmt@sibling]\fi @@ -84,7 +116,7 @@ \def\@nx\thmt@envname{\thmt@envname}% \def\@nx\thmt@thmname{\thmt@thmname}% } - \@xa\addtotheoremprehook\@xa[\@xa\thmt@envname\@xa]\@xa{% + \@xa\addtotheorempreheadhook\@xa[\@xa\thmt@envname\@xa]\@xa{% \thmt@tmp }% } @@ -92,28 +124,48 @@ % this adds two command calls to the newly-defined theorem. \@xa\let\csname thmt@original@#1\@xa\endcsname \csname#1\endcsname - \@xa\renewcommand\csname \thmt@envname\endcsname[1][]{% - \def\thmt@optarg{##1}% - \csname thmt@#1@preheadhook\endcsname - \thmt@generic@preheadhook - \csname thmt@original@#1\@xa\endcsname - \ifx\@empty\thmt@optarg\else [##1]\fi - \csname thmt@#1@postheadhook\endcsname - \thmt@generic@postheadhook + \@xa\renewcommand\csname #1\endcsname{ + \thmt@parsetheoremargs{#1}% }% + \@xa\let\csname thmt@original@end#1\@xa\endcsname\csname end#1\endcsname + \@xa\def\csname end#1\endcsname{% + % these need to be in opposite order of headhooks. + \csname thmtgeneric@prefoothook\endcsname + \csname thmt@#1@prefoothook\endcsname + \csname thmt@original@end#1\endcsname + \csname thmt@generic@postfoothook\endcsname + \csname thmt@#1@postfoothook\endcsname + } \@namedef{thmt@#1@preheadhook}{}% \@namedef{thmt@#1@postheadhook}{}% + \@namedef{thmt@#1@prefoothook}{}% + \@namedef{thmt@#1@postfoothook}{}% } \newcommand\thmt@generic@preheadhook{\refstepcounter{thmt@dummyctr}} \newcommand\thmt@generic@postheadhook{} -\newcommand\addtotheoremprehook[1][generic]{% +\providecommand\g@prependto@macro[2]{% + \begingroup + \toks@\@xa{\@xa{#1}{#2}}% + \def\tmp@a##1##2{##2##1}% + \@xa\@xa\@xa\gdef\@xa\@xa\@xa#1\@xa\@xa\@xa{\@xa\tmp@a\the\toks@}% + \endgroup +} + +\newcommand\addtotheorempreheadhook[1][generic]{% \expandafter\g@addto@macro\csname thmt@#1@preheadhook\endcsname% } -\newcommand\addtotheoremposthook[1][generic]{% +\newcommand\addtotheorempostheadhook[1][generic]{% \expandafter\g@addto@macro\csname thmt@#1@postheadhook\endcsname% } +\newcommand\addtotheoremprefoothook[1][generic]{% + \expandafter\g@prependto@macro\csname thmt@#1@prefoothook\endcsname% +} +\newcommand\addtotheorempostfoothook[1][generic]{% + \expandafter\g@prependto@macro\csname thmt@#1@postfoothook\endcsname% +} + \endinput %% %% End of file `thm-patch.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty index 38ee8540b4a..7d88dd8091a 100644 --- a/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty +++ b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty @@ -19,7 +19,7 @@ %% http://www.latex-project.org/lppl/lppl-1-3a.txt %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{thm-restate}[2008/02/17 BETA thm-restate (ulmi)] +\ProvidesPackage{thm-restate}[2008/03/09 v0.1beta2 thm-restate (ulmi)] \let\@xa\expandafter \let\@nx\noexpand @@ -27,12 +27,12 @@ \newcounter{thmt@dummyctr}% }{} \gdef\theHthmt@dummyctr{dummy.\arabic{thmt@dummyctr}}% - +\gdef\thethmt@dummyctr{}% \newtoks\thmt@toks \long\def\thmt@collect@body#1#2\end#3{% \@xa\thmt@toks\@xa{\the\thmt@toks #2}% - \def\thmttmpa{#3}\def\thmttmpb{restatable}% - \ifx\thmttmpa\thmttmpb + \def\thmttmpa{#3}%\def\thmttmpb{restatable}% + \ifx\thmttmpa\@currenvir%thmttmpb \@xa\@firstoftwo% this is the end of the environment. \else \@xa\@secondoftwo% go on collecting @@ -44,28 +44,50 @@ }% } -\newenvironment{restatable}[3][]{% - \def\thmrst@type{#2}% +\newif\ifthmt@thisistheone +\newenvironment{thmt@restatable}[3][]{% \long\def\thmrst@store##1{% - \protected@edef\thmrst@nmbr{\csname the#2\endcsname}% - \@xa\long\@xa\gdef\csname #3\@xa\endcsname\@xa{% - \@xa\begingroup - \@xa\def\csname the#2\@xa\endcsname\@xa{\thmrst@nmbr}% - \@xa\let\csname c@#2\endcsname\c@thmt@dummyctr - \@xa\let\csname theH#2\endcsname\theHthmt@dummyctr - \let\label=\@gobble - %\def\@currenvir{#2}% - \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[#1]\fi - ##1 - \csname end#2\endcsname - \endgroup - }##1\end{restatable}}% - %\def\@currenvir{#2}% - \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[#1]\fi + \@xa\gdef\csname #3\endcsname{% + \@ifstar{% + \thmt@thisistheonefalse\csname thmt@stored@#3\endcsname + }{% + \thmt@thisistheonetrue\csname thmt@stored@#3\endcsname + }% + }% + \@xa\long\@xa\gdef\csname thmt@stored@#3\@xa\endcsname\@xa{% + \begingroup + \ifthmt@thisistheone\else + \@xa\protected@edef\csname the#2\endcsname{% + \ifx\@refstar\@undefined\@xa\ref\else\@xa\@refstar\fi{thmt@@#3}}% + \@xa\let\csname c@#2\endcsname=\c@thmt@dummyctr + \@xa\let\csname theH#2\endcsname=\theHthmt@dummyctr + \let\label=\@gobble + \fi + %\def\@currenvir{#2}% + \csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[#1]\fi + \ifthmt@thisistheone + \label{thmt@@#3}% + \fi + ##1 + \csname end#2\endcsname + \endgroup + }% + \csname #3\@xa\endcsname\ifthmt@thisistheone\else*\fi + \@xa\end\@xa{\@currenvir} + }% \thmt@collect@body\thmrst@store }{% - \csname end\thmrst@type\endcsname - %\def\@currenvir{restatable}% + %% now empty, just used as a marker. +} +\newenvironment{restatable}{% + \thmt@thisistheonetrue\thmt@restatable +}{% + \endthmt@restatable +} +\newenvironment{restatable*}{% + \thmt@thisistheonefalse\thmt@restatable +}{% + \endthmt@restatable } \endinput %% diff --git a/Master/texmf-dist/tex/latex/thmtools/thmtools.sty b/Master/texmf-dist/tex/latex/thmtools/thmtools.sty new file mode 100644 index 00000000000..82c5e760aa8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thmtools.sty @@ -0,0 +1,26 @@ +%% +%% This is file `thmtools.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thmtools.dtx (with options: `thmtools') +%% 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 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{thmtools}[2008/06/22 v0.1beta6 Tools for theorem typesetting (ulmi)] +\RequirePackage{thm-kv, thm-autoref, thm-listof} +\endinput +%% +%% End of file `thmtools.sty'. -- cgit v1.2.3