From e2041bab726766a5193e515f8a7e1761613d1222 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 18 Feb 2008 00:22:07 +0000 Subject: new latex package thmtools (17feb08) git-svn-id: svn://tug.org/texlive/trunk@6667 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/thmtools/aliasctr.sty | 72 +++++++++++++ .../texmf-dist/tex/latex/thmtools/thm-autoref.sty | 45 ++++++++ Master/texmf-dist/tex/latex/thmtools/thm-kv.sty | 71 ++++++++++++ .../texmf-dist/tex/latex/thmtools/thm-listof.sty | 62 +++++++++++ Master/texmf-dist/tex/latex/thmtools/thm-patch.sty | 119 +++++++++++++++++++++ .../texmf-dist/tex/latex/thmtools/thm-restate.sty | 72 +++++++++++++ Master/texmf-dist/tex/latex/thmtools/unique.sty | 83 ++++++++++++++ 7 files changed, 524 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/thmtools/aliasctr.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/thm-kv.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/thm-listof.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/thm-patch.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/thm-restate.sty create mode 100644 Master/texmf-dist/tex/latex/thmtools/unique.sty (limited to 'Master/texmf-dist/tex/latex/thmtools') diff --git a/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty b/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty new file mode 100644 index 00000000000..e8e4f1aec61 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty @@ -0,0 +1,72 @@ +%% +%% This is file `aliasctr.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% aliasctr.dtx (with options: `code') +%% 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{aliasctr}[2006/01/22 v0.1 counter aliasing (ulmi)] +\def\aliasctr@f@llow#1#2\@nil#3{% + \ifx#1\@elt + \noexpand #3% + \else + \expandafter\aliasctr@f@llow#1\@elt\@nil{#1}% + \fi +} +\newcommand\aliasctr@follow[1]{% + \expandafter\aliasctr@f@llow + \csname cl@#1\endcsname\@elt\@nil{\csname cl@#1\endcsname}% +} +\renewcommand*\@addtoreset[2]{\bgroup + \edef\aliasctr@@truelist{\aliasctr@follow{#2}}% + \let\@elt\relax + \expandafter\@cons\aliasctr@@truelist{{#1}}% +\egroup} +\RequirePackage{remreset} +\renewcommand*\@removefromreset[2]{\bgroup + \edef\aliasctr@@truelist{\aliasctr@follow{#2}}% + \expandafter\let\csname c@#1\endcsname\@removefromreset + \def\@elt##1{% + \expandafter\ifx\csname c@##1\endcsname\@removefromreset + \else + \noexpand\@elt{##1}% + \fi}% + \expandafter\xdef\aliasctr@@truelist{% + \aliasctr@@truelist} +\egroup} +\newcommand\@counteralias[2]{{% + \def\@@gletover##1##2{% + \expandafter\global + \expandafter\let\csname ##1\expandafter\endcsname + \csname ##2\endcsname + }% + \@ifundefined{c@#2}{\@nocounterr{#2}}{% + \@ifdefinable{c@#1}{% + \@@gletover{c@#1}{c@#2}% + \@@gletover{the#1}{the#2}% + \@@gletover{theH#1}{theH#2}% + \@@gletover{p@#1}{p@#2}% + \expandafter\global + \expandafter\def\csname cl@#1\expandafter\endcsname + \expandafter{\csname cl@#2\endcsname}% + %\@addtoreset{#1}{@ckpt}% + }% + }% +}} +\endinput +%% +%% End of file `aliasctr.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty b/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty new file mode 100644 index 00000000000..51cdd97d018 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thm-autoref.sty @@ -0,0 +1,45 @@ +%% +%% This is file `thm-autoref.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thm-autoref.dtx (with options: `autoref') +%% 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{thm-autoref}[2008/02/17 BETA thm-autoref (ulmi)] + +\RequirePackage{thm-patch, aliasctr} + +\let\@xa=\expandafter +\let\@nx=\noexpand + +\newcommand\thmt@autorefsetup{% + \@xa\def\csname\thmt@envname autorefname\@xa\endcsname\@xa{\thmt@thmname}% + \ifthmt@hassibling + \@counteralias{\thmt@envname}{\thmt@sibling}% + \@xa\def\@xa\thmt@autoreffix\@xa{% + \@xa\let\csname the\thmt@envname\@xa\endcsname + \csname the\thmt@sibling\endcsname + \def\thmt@autoreffix{}% + }% + \protected@edef\thmt@sibling{\thmt@envname}% + \fi +} +\g@addto@macro\thmt@newtheorem@predefinition{\thmt@autorefsetup}% +\g@addto@macro\thmt@newtheorem@postdefinition{\csname thmt@autoreffix\endcsname}% +\endinput +%% +%% End of file `thm-autoref.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty new file mode 100644 index 00000000000..7a5c5899f26 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thm-kv.sty @@ -0,0 +1,71 @@ +%% +%% This is file `thm-kv.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thm-kv.dtx (with options: `kv') +%% 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{thm-kv}[2008/02/17 BETA thm-kv interface (ulmi)] +\let\@xa\expandafter +\let\@nx\noexpand +\usepackage{keyval} + +\define@key{thmt}{parent}{\thmt@setparent{#1}} +\define@key{thmt}{numberwithin}{\thmt@setparent{#1}} +\define@key{thmt}{within}{\thmt@setparent{#1}} + +\define@key{thmt}{sibling}{\thmt@setsibling{#1}} +\define@key{thmt}{numberlike}{\thmt@setsibling{#1}} +\define@key{thmt}{sharenumber}{\thmt@setsibling{#1}} + +\define@key{thmt}{title}{\thmt@setthmname{#1}} +\define@key{thmt}{name}{\thmt@setthmname{#1}} +\define@key{thmt}{heading}{\thmt@setthmname{#1}} + +\define@key{thmt}{unnumbered}[]{\thmt@isnumberedfalse} +\define@key{thmt}{starred}[]{\thmt@isnumberedfalse} + +\newif\ifthmt@isnumbered +\newcommand\thmt@setparent[1]{% + \def\thmt@parent{#1}% +} +\newcommand\thmt@setsibling{% + \def\thmt@sibling +} +\newcommand\thmt@setthmname{% + \def\thmt@thmname +} + +\newcommand\declaretheorem[2][]{% + \thmt@setthmname{\MakeUppercase #2}% + \thmt@setparent{}% + \thmt@setsibling{}% + \thmt@isnumberedtrue% + \setkeys{thmt}{#1}% + \protected@edef\thmt@tmp{% + \@nx\newtheorem + \ifthmt@isnumbered\else *\fi + {#2}% + \ifx\thmt@sibling\@empty\else [\thmt@sibling]\fi + {\thmt@thmname}% + \ifx\thmt@parent\@empty\else [\thmt@parent]\fi + }%\show\thmt@tmp + \thmt@tmp +} +\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 new file mode 100644 index 00000000000..d120829c6ef --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thm-listof.sty @@ -0,0 +1,62 @@ +%% +%% This is file `thm-listof.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thm-listof.dtx (with options: `listof') +%% 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{thm-listof}[2008/02/17 BETA thm-listof (ulmi)] +\let\@xa=\expandafter +\let\@nx=\noexpand +\RequirePackage{thm-patch} + +\providecommand\listtheoremname{List of Theorems} +\newcommand\listoftheorems{% + %% much hacking here to pick up the definition from the class + %% without oodles of conditionals. + \bgroup + \let\listfigurename\listtheoremname + \let\thref@starttoc\@starttoc + \def\@starttoc##1{\thref@starttoc{loe}}% + \expandafter\listoffigures + \egroup +} + +\newcommand\thmt@mklistcmd{% + \@xa\protected@edef\csname l@\thmt@envname\endcsname{% + \@nx\@dottedtocline{1}{1.5em}{2.3em}% + }% +} +\g@addto@macro\thmt@newtheorem@predefinition{% + \thmt@mklistcmd +} + +\addtotheoremposthook{% + \addcontentsline{loe}{\thmt@envname}{% + \numberline{\csname the\thmt@envname\endcsname}% + \thmt@thmname + \ifx\@empty\thmt@optarg\else\protect\space(\thmt@optarg)\fi + }% +} +\newcommand\ignoretheorems[1]{% + \@for\thm:=#1\do{% + \@xa\let\csname l@\thm\endcsname=\@gobbletwo + }% +} +\endinput +%% +%% End of file `thm-listof.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty b/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty new file mode 100644 index 00000000000..7b5315388e9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thm-patch.sty @@ -0,0 +1,119 @@ +%% +%% This is file `thm-patch.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thm-patch.dtx (with options: `patch') +%% 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{thm-patch}[2008/02/17 BETA thm-patch (ulmi)] +\let\@xa=\expandafter +\let\@nx=\noexpand + +\@ifundefined{c@thmt@dummyctr}{% + \newcounter{thmt@dummyctr}% +}{}% +\gdef\theHthmt@dummyctr{dummy.\arabic{thmt@dummyctr}}% + +\newif\ifthmt@isstarred +\newif\ifthmt@hassibling +\newif\ifthmt@hasparent + +\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 + }% +} +\newcommand\thmt@newtheoremiv{% + \thmt@newtheorem@predefinition + % whee, now reassemble the whole shit. + \protected@edef\thmt@args{% + \@nx\thmt@original@newtheorem% + \ifthmt@isstarred *\fi + {\thmt@envname}% + \ifthmt@hassibling [\thmt@sibling]\fi + {\thmt@thmname}% + \ifthmt@hasparent [\thmt@parent]\fi + } + \thmt@args + \thmt@newtheorem@postdefinition +} + +\newcommand\thmt@newtheorem@predefinition{} +\newcommand\thmt@newtheorem@postdefinition{} + +\g@addto@macro\thmt@newtheorem@postdefinition{% + \@xa\thmt@addtheoremhook\@xa{\thmt@envname}% + \ifthmt@isstarred\@namedef{the\thmt@envname}{}\fi + \protected@edef\thmt@tmp{% + \def\@nx\thmt@envname{\thmt@envname}% + \def\@nx\thmt@thmname{\thmt@thmname}% + } + \@xa\addtotheoremprehook\@xa[\@xa\thmt@envname\@xa]\@xa{% + \thmt@tmp + }% +} +\newcommand\thmt@addtheoremhook[1]{% + % 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 + }% + \@namedef{thmt@#1@preheadhook}{}% + \@namedef{thmt@#1@postheadhook}{}% +} +\newcommand\thmt@generic@preheadhook{\refstepcounter{thmt@dummyctr}} +\newcommand\thmt@generic@postheadhook{} + +\newcommand\addtotheoremprehook[1][generic]{% + \expandafter\g@addto@macro\csname thmt@#1@preheadhook\endcsname% +} +\newcommand\addtotheoremposthook[1][generic]{% + \expandafter\g@addto@macro\csname thmt@#1@postheadhook\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 new file mode 100644 index 00000000000..38ee8540b4a --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/thm-restate.sty @@ -0,0 +1,72 @@ +%% +%% This is file `thm-restate.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thm-restate.dtx (with options: `restate') +%% 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{thm-restate}[2008/02/17 BETA thm-restate (ulmi)] + +\let\@xa\expandafter +\let\@nx\noexpand +\@ifundefined{c@thmt@dummyctr}{% + \newcounter{thmt@dummyctr}% + }{} +\gdef\theHthmt@dummyctr{dummy.\arabic{thmt@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 + \@xa\@firstoftwo% this is the end of the environment. + \else + \@xa\@secondoftwo% go on collecting + \fi{% + \@xa#1\@xa{\the\thmt@toks}% + }{% + \@xa\thmt@toks\@xa{\the\thmt@toks\end{#3}}% + \thmt@collect@body{#1}% + }% +} + +\newenvironment{restatable}[3][]{% + \def\thmrst@type{#2}% + \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 + \thmt@collect@body\thmrst@store +}{% + \csname end\thmrst@type\endcsname + %\def\@currenvir{restatable}% +} +\endinput +%% +%% End of file `thm-restate.sty'. diff --git a/Master/texmf-dist/tex/latex/thmtools/unique.sty b/Master/texmf-dist/tex/latex/thmtools/unique.sty new file mode 100644 index 00000000000..2c607807cc3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/thmtools/unique.sty @@ -0,0 +1,83 @@ +%% +%% This is file `unique.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% unique.dtx (with options: `code') +%% 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{unique}[2007/07/29 v0.1 test for uniqueness (ulmi)] +\newcommand\setuniqmark[1]{% + \expandafter\ifx\csname uniq@now@#1\endcsname\relax + \global\@namedef{uniq@now@#1}{\uniq@ONE}% + \else + \expandafter\ifx\csname uniq@now@#1\endcsname\uniq@MANY\else + \immediate\write\@auxout{% + \string\uniq@setmany{#1}% + }% + \ifuniq{#1}{% + \uniq@warnnotunique{#1}% + }{}% + \fi + \global\@namedef{uniq@now@#1}{\uniq@MANY}% + \fi +} +\newcommand\ifuniq[1]{% + \expandafter\ifx\csname uniq@last@#1\endcsname\uniq@MANY + \expandafter \@secondoftwo + \else + \expandafter\@firstoftwo + \fi +} +\def\uniq@ONE{\uniq@ONE} +\def\uniq@MANY{\uniq@MANY} +\newif\if@uniq@rerun +\def\uniq@setmany#1{% + \global\@namedef{uniq@last@#1}{\uniq@MANY}% + \AtEndDocument{% + \uniq@warnifunique{#1}% + }% +} +\def\uniq@warnifunique#1{% + \expandafter\ifx\csname uniq@now@#1\endcsname\uniq@MANY\else + \PackageWarningNoLine{uniq}{% + `#1' is unique now.\MessageBreak + Rerun LaTeX to pick up the change% + }% + \@uniq@reruntrue + \fi +} +\def\uniq@warnnotunique#1{% + \PackageWarningNoLine{uniq}{% + `#1' is not unique anymore.\MessageBreak + Rerun LaTeX to pick up the change% + }% + \@uniq@reruntrue +} +\def\uniq@maybesuggestrerun{% + \if@uniq@rerun + \PackageWarningNoLine{uniq}{% + Uniquenesses have changed. \MessageBreak + Rerun LaTeX to pick up the change% + }% + \fi +} +\AtEndDocument{% + \immediate\write\@auxout{\string\uniq@maybesuggestrerun}% +} +\endinput +%% +%% End of file `unique.sty'. -- cgit v1.2.3