summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/thmtools
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-05-19 23:24:59 +0000
committerKarl Berry <karl@freefriends.org>2010-05-19 23:24:59 +0000
commit37692430a0ed6d4bc09b544c26cbc8ba41255965 (patch)
treefce78f8c376af10afb0d10fd1ffcd90f8b2d39bc /Master/texmf-dist/source/latex/thmtools
parentfb8881a67bb8f860de4fed71bbdb2b2b7c39ac89 (diff)
thmtools 24 (18may10)
git-svn-id: svn://tug.org/texlive/trunk@18359 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/thmtools')
-rw-r--r--Master/texmf-dist/source/latex/thmtools/aliasctr.dtx34
-rw-r--r--Master/texmf-dist/source/latex/thmtools/parseargs.dtx69
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-amsthm.dtx140
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx127
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-beamer.dtx42
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-kv.dtx410
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-listof.dtx151
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-ntheorem.dtx123
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-patch.dtx159
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-restate.dtx83
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx62
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thmdef-thmbox.dtx26
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thmtools.dtx133
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thmtools.ins14
-rw-r--r--Master/texmf-dist/source/latex/thmtools/unique.dtx45
15 files changed, 860 insertions, 758 deletions
diff --git a/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx b/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx
index bd3f1667fda..1dd8d3aff17 100644
--- a/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx
@@ -6,46 +6,14 @@
% the LaTeX Project Public License, version 1.3a. The full license text
% is available from http://www.latex-project.org/
%
-% \fi
-%
-%\iffalse
-%<*driver>
-\documentclass{ltxdoc}
-\usepackage{aliasctr}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.87]{luximono, helvet}
-\newcommand\pkg{\textsf}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\GetFileInfo{aliasctr.sty}
-\author{Ulrich M. Schwarz\thanks{ulmi at absatzen dot de}}
-\title{The \pkg{aliasctr} package\thanks{%
- This documents \pkg{aliasctr}~\fileversion, dated~\filedate.
- Newer versions might be found at http://absatzen.de
-}}
-\begin{document}
- \maketitle
- \DocInput{aliasctr.dtx}
-\end{document}
-%</driver>
%<*code>
-%\fi
-% \iffalse $Id: aliasctr.dtx,v 1.3 2008/03/09 18:59:17 ulmi Exp $\fi
-% \section{Usage}
+% \fi
% |\@counteralias{#1}{#2}| makes |#1| a counter that uses |#2|'s count register.
% This is useful for things like \pkg{hyperref}'s |\autoref|, which otherwise
% can't distinguish theorems and definitions if they share a counter.
%
% For detailed information, see Die TeXnische Kom\"odie 3/2006.
% \StopEventually{}
-% \section{Implementation}
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{aliasctr}[2006/01/22 v0.1 counter aliasing (ulmi)]
-% \end{macrocode}
% \begin{macro}{\@addtoreset}
% add |\@elt{#1}| to |\cl@#2|.
% This differs from the kernel implementation insofar as we trail the
diff --git a/Master/texmf-dist/source/latex/thmtools/parseargs.dtx b/Master/texmf-dist/source/latex/thmtools/parseargs.dtx
index bf89eaefde1..8f4aa421710 100644
--- a/Master/texmf-dist/source/latex/thmtools/parseargs.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/parseargs.dtx
@@ -10,75 +10,9 @@
% \fi
%
%\iffalse (hide this from DocInput)
-%<*driver>
-\documentclass{ltxdoc}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.8]{helvet}
-\usepackage{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{parseargs}
-\newtheorem{lemma}{Lemma}
-\providecommand\pkg{\textsf}
-\GetFileInfo{parseargs.sty}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
- \newcommand\ParseArgs{\textsf{ParseArgs}}
- \title{The \ParseArgs\ package\thanks{%
- This file documents version~\fileversion\ of~\filedate,
- RCS ${}$Id: parseargs.dtx,v 1.3 2008/08/03 13:10:16 ulmi Exp ulmi ${}$.
- }}
- \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}}
-
- \maketitle
-
- \begin{abstract}
- A command like |\newtheorem| with its gazillion different argument
- possibilities is difficult to parse manually. And then, you add beamer
- support and you have to wade through a maze of twisty call indirections,
- all alike.
-
- This package provides a generic argument parser similar to the one that
- will be in \LaTeX3.
- \end{abstract}
-
- \DocInput{thm-autoref.dtx}
-\end{document}
-%</driver>
%<*parseargs>
%\fi
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-% \CheckSum{160}
-%
-% \DoNotIndex{\@for,\addtocounter,\arabic,\csname,\endcsname,\cup,\CurrentOption}
-% \DoNotIndex{\{,\},\do,\define@key,\def,\DeclareOption,\else,\ensuremath,\expandafter}
-% \DoNotIndex{\hspace,\fi,\rule,\ifcase,\ifx,\in,\InputIfFileExists,\leq,\let,\mathpalette}
-% \DoNotIndex{\NeedsTeXFormat,\ldots,\ldotp,\newcommand,\newcounter,\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\parm,\ProcessOptions,\protected@edef}
-% \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm}
-%
-%\section{Usage}
-%
% The main command provided by the package is |\parse|\marg{spec}.
% \emph{spec} consists of groups of commands. Each group should set up the
% command |\@parsecmd| which is then run. The important point is that
@@ -91,10 +25,7 @@
% optional, and flag.
%
%\StopEventually{}
-%\section{Implementation}
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{parseargs}[2008/05/12 v0.1alpha1 generic argument parser (ulmi)]
\newtoks\@parsespec
\def\parse@endquark{\parse@endquark}
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-amsthm.dtx b/Master/texmf-dist/source/latex/thmtools/thm-amsthm.dtx
new file mode 100644
index 00000000000..cd61adfbe21
--- /dev/null
+++ b/Master/texmf-dist/source/latex/thmtools/thm-amsthm.dtx
@@ -0,0 +1,140 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2010 by Ulrich M. Schwarz
+% See file COPYING for more details.
+%\fi
+%
+%\iffalse (hide this from DocInput)
+%<*amsthm>
+%\fi
+% \begin{macrocode}
+\define@key{thmstyle}{spaceabove}{%
+ \def\thmt@style@spaceabove{#1}%
+}
+\define@key{thmstyle}{spacebelow}{%
+ \def\thmt@style@spacebelow{#1}%
+}
+\define@key{thmstyle}{headfont}{%
+ \def\thmt@style@headfont{#1}%
+}
+\define@key{thmstyle}{bodyfont}{%
+ \def\thmt@style@bodyfont{#1}%
+}
+\define@key{thmstyle}{notefont}{%
+ \def\thmt@style@notefont{#1}%
+}
+\define@key{thmstyle}{headpunct}{%
+ \def\thmt@style@headpunct{#1}%
+}
+\define@key{thmstyle}{notebraces}{%
+ \def\thmt@style@notebraces{\thmt@embrace#1}%
+}
+\define@key{thmstyle}{break}[]{%
+ \def\thmt@style@postheadspace{\newline}%
+}
+\define@key{thmstyle}{postheadspace}{%
+ \def\thmt@style@postheadspace{#1}%
+}
+\define@key{thmstyle}{headindent}{%
+ \def\thmt@style@headindent{#1}%
+}
+
+\newtoks\thmt@style@headstyle
+\define@key{thmstyle}{headformat}[]{%
+ \thmt@style@headstyle{%
+ \def\NAME{\the\thm@headfont ##1}%
+ \def\NUMBER{\bgroup\@upn{##2}\egroup}%
+ \def\NOTE{\if=##3=\else\bgroup\ \the\thm@notefont(##3)\egroup\fi}%
+ }%
+ \def\thmt@tmp{#1}%
+ \@onelevel@sanitize\thmt@tmp
+ %\tracingall
+ \ifcsname thmt@headstyle@\thmt@tmp\endcsname
+ \thmt@style@headstyle\@xa{%
+ \the\thmt@style@headstyle
+ \csname thmt@headstyle@#1\endcsname
+ }%
+ \else
+ \thmt@style@headstyle\@xa{%
+ \the\thmt@style@headstyle
+ #1
+ }%
+ \fi
+ %\showthe\thmt@style@headstyle
+}
+% examples:
+\def\thmt@headstyle@margin{%
+ \makebox[0pt][r]{\NUMBER\ }\NAME\NOTE
+}
+\def\thmt@headstyle@swapnumber{%
+ \NUMBER\ \NAME\NOTE
+}
+
+
+
+\def\thmt@embrace#1#2(#3){#1#3#2}
+
+\def\thmt@declaretheoremstyle@setup{%
+ \let\thmt@style@notebraces\@empty%
+ \thmt@style@headstyle{}%
+ \kvsetkeys{thmstyle}{%
+ spaceabove=3pt,
+ spacebelow=3pt,
+ headfont=\bfseries,
+ bodyfont=\normalfont,
+ headpunct={.},
+ postheadspace={ },
+ headindent={},
+ notefont={\fontseries\mddefault\upshape}
+ }%
+}
+\def\thmt@declaretheoremstyle#1{%
+ %\show\thmt@style@spaceabove
+ \thmt@toks{\newtheoremstyle{#1}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@spaceabove}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@spacebelow}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@bodyfont}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@headindent}}% indent1 FIXME
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@headfont}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@headpunct}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\thmt@style@postheadspace}}%
+ \thmt@toks\@xa\@xa\@xa{\@xa\the\@xa\thmt@toks\@xa{\the\thmt@style@headstyle}}% headspec FIXME
+ \the\thmt@toks
+ %1 Indent amount: empty = no indent, \parindent = normal paragraph indent
+ %2 Space after theorem head: { } = normal interword space; \newline = linebreak
+ %% BUGFIX: amsthm ignores notefont setting altogether:
+ \thmt@toks\@xa\@xa\@xa{\csname th@#1\endcsname}%
+ \thmt@toks
+ \@xa\@xa\@xa\@xa\@xa\@xa\@xa{%
+ \@xa\@xa\@xa\@xa\@xa\@xa\@xa\thm@notefont
+ \@xa\@xa\@xa\@xa\@xa\@xa\@xa{%
+ \@xa\@xa\@xa\thmt@style@notefont
+ \@xa\thmt@style@notebraces
+ \@xa}\the\thmt@toks}%
+ \@xa\def\csname th@#1\@xa\endcsname\@xa{\the\thmt@toks}%
+% \@xa\def\csname th@#1\@xa\@xa\@xa\@xa\@xa\@xa\@xa\endcsname
+% \@xa\@xa\@xa\@xa\@xa\@xa\@xa{%
+% \@xa\@xa\@xa\@xa\@xa\@xa\@xa\thm@notefont
+% \@xa\@xa\@xa\@xa\@xa\@xa\@xa{%
+% \@xa\@xa\@xa\thmt@style@notefont
+% \@xa\@xa\@xa\thmt@style@notebraces
+% \@xa\@xa\@xa}\csname th@#1\endcsname
+% }
+}
+
+\define@key{thmdef}{qed}[\qedsymbol]{%
+ \thmt@trytwice{}{%
+ \addtotheorempostheadhook[\thmt@envname]{%
+ \pushQED{\qed}%
+ }%
+ \addtotheoremprefoothook[\thmt@envname]{%
+ \protected@edef\qedsymbol{#1}%
+ \popQED
+ }%
+ }%
+}
+
+% \end{macrocode}
+%\iffalse (hide this from DocInput)
+%</amsthm>
+%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx b/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx
index d8c6ea8b4f7..0d8a23dc010 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx
@@ -10,81 +10,18 @@
% \fi
%
%\iffalse (hide this from DocInput)
-%<*driver>
-\documentclass{ltxdoc}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.8]{helvet}
-\usepackage{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{thm-autoref}
-\newtheorem{lemma}{Lemma}
-\providecommand\pkg{\textsf}
-\GetFileInfo{thm-autoref.sty}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
- \newcommand\thmrestate{\textsf{thm-patch}}
- \title{The \thmrestate\ package\thanks{%
- This file documents version~\fileversion\ of~\filedate,
- RCS ${}$Id: thm-autoref.dtx,v 1.4 2008/03/09 18:59:17 ulmi Exp ${}$.
- }}
- \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}}
-
- \maketitle
-
- \begin{abstract}
- Fixes interaction of theorems with hyperref's |\autoref| command.
- \end{abstract}
-
- \DocInput{thm-autoref.dtx}
-\end{document}
-%</driver>
%<*autoref>
%\fi
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-% \CheckSum{160}
-%
-% \DoNotIndex{\@for,\addtocounter,\arabic,\csname,\endcsname,\cup,\CurrentOption}
-% \DoNotIndex{\{,\},\do,\define@key,\def,\DeclareOption,\else,\ensuremath,\expandafter}
-% \DoNotIndex{\hspace,\fi,\rule,\ifcase,\ifx,\in,\InputIfFileExists,\leq,\let,\mathpalette}
-% \DoNotIndex{\NeedsTeXFormat,\ldots,\ldotp,\newcommand,\newcounter,\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\parm,\ProcessOptions,\protected@edef}
-% \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm}
-%
-%\section{Usage}
-%
% \pkg{hyperref}'s |\autoref| command does not work well with theorems that
% share a counter: it'll always think it's a Lemma even if it's a Remark
% that shares the Lemma counter. Load this package to fix it. No further
% intervention needed.
%
%\StopEventually{}
-%\section{Implementation}
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thm-autoref}[2008/03/09 v0.1beta2 thm-autoref (ulmi)]
-\RequirePackage{thm-patch, aliasctr}
+\RequirePackage{thm-patch, aliasctr, parseargs, keyval}
\let\@xa=\expandafter
\let\@nx=\noexpand
@@ -103,6 +40,68 @@
}
\g@addto@macro\thmt@newtheorem@predefinition{\thmt@autorefsetup}%
\g@addto@macro\thmt@newtheorem@postdefinition{\csname thmt@autoreffix\endcsname}%
+
+\def\thmt@refnamewithcomma #1#2#3,#4,#5\@nil{%
+ \@xa\def\csname\thmt@envname #1utorefname\endcsname{#3}%
+ \ifcsname #2refname\endcsname
+ \csname #2refname\endcsname{\thmt@envname}{#3}{#4}%
+ \fi
+}
+\define@key{thmdef}{refname}{\thmt@trytwice{}{%
+ \thmt@refnamewithcomma{a}{c}#1,\textbf{?? (pl. #1)},\@nil
+}}
+\define@key{thmdef}{Refname}{\thmt@trytwice{}{%
+ \thmt@refnamewithcomma{A}{C}#1,\textbf{?? (pl. #1)},\@nil
+}}
+
+
+\ifcsname Autoref\endcsname\else
+\let\thmt@HyRef@testreftype\HyRef@testreftype
+\def\HyRef@Testreftype#1.#2\\{%
+ \ltx@IfUndefined{#1Autorefname}{%
+ \thmt@HyRef@testreftype#1.#2\\%
+ }{%
+ \edef\HyRef@currentHtag{%
+ \expandafter\noexpand\csname#1Autorefname\endcsname
+ \noexpand~%
+ }%
+ }%
+}
+
+
+\let\thmt@HyPsd@@autorefname\HyPsd@@autorefname
+\def\HyPsd@@Autorefname#1.#2\@nil{%
+ \tracingall
+ \ltx@IfUndefined{#1Autorefname}{%
+ \thmt@HyPsd@@autorefname#1.#2\@nil
+ }{%
+ \csname#1Autorefname\endcsname\space
+ }%
+}%
+\def\Autoref{%
+ \parse{%
+ {\parseFlag*{\def\thmt@autorefstar{*}}{\let\thmt@autorefstar\@empty}}%
+ {\parseMand{%
+ \bgroup
+ \let\HyRef@testreftype\HyRef@Testreftype
+ \let\HyPsd@@autorefname\HyPsd@@Autorefname
+ \@xa\autoref\thmt@autorefstar{##1}%
+ \egroup
+ \let\@parsecmd\@empty
+ }}%
+ }%
+}
+\fi % ifcsname Autoref
+
+% not entirely appropriate here, but close enough:
+\AtBeginDocument{%
+ \@ifpackageloaded{nameref}{%
+ \addtotheorempostheadhook{%
+ \expandafter\NR@gettitle\expandafter{\thmt@optarg}%
+ }}{}
+}
+
+
% \end{macrocode}
%\iffalse
%</autoref>
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-beamer.dtx b/Master/texmf-dist/source/latex/thmtools/thm-beamer.dtx
new file mode 100644
index 00000000000..8ac7adba100
--- /dev/null
+++ b/Master/texmf-dist/source/latex/thmtools/thm-beamer.dtx
@@ -0,0 +1,42 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2010 by Ulrich M. Schwarz
+% See file COPYING for more details.
+%\fi
+%
+%\iffalse (hide this from DocInput)
+%<*beamer>
+%\fi
+% \begin{macrocode}
+\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}}{}}%
+ }%
+ {%
+ \def\thmt@local@preheadhook{}%
+ \def\thmt@local@postheadhook{}%
+ \def\thmt@local@prefoothook{}%
+ \def\thmt@local@postfoothook{}%
+ \thmt@local@preheadhook
+ \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
+ \thmt@local@postheadhook
+ \csname thmt@#1@postheadhook\endcsname
+ \thmt@generic@postheadhook
+ \let\@parsecmd\@empty
+ }%
+ }
+}%
+% \end{macrocode}
+%\iffalse (hide this from DocInput)
+%</beamer>
+%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx
index d731d62f1ea..a1aa79fbc29 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx
@@ -10,196 +10,114 @@
% \fi
%
%\iffalse (hide this from DocInput)
-%<*driver>
-\documentclass{ltxdoc}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.8]{helvet}
-\usepackage[scaled]{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{thm-kv, thm-patch}
-\newtheorem{lemma}{Lemma}
-\declaretheorem[sibling=lemma, shaded, name={Rule of Thumb}]{ruleofthumb}
-\usepackage{color}
-\declaretheorem[shaded={bgcolor={rgb}{1,0,0},rulecolor={rgb}{0,1,0},rulewidth=2em,
- margin=1em, textwidth=5cm}]{eyesore}
-
-
-\GetFileInfo{thm-kv.sty}
-\providecommand\pkg{\textsf}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
-
- \newcommand\thmrestate{\textsf{thm-kv}}
- \title{The \thmrestate\ package\thanks{%
- This file documents version~\fileversion\ of~\filedate,
- RCS ${}$Id: thm-kv.dtx,v 1.8 2008/06/22 12:09:41 ulmi Exp ulmi ${}$.
- }}
- \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}}
-
- \maketitle
-
-\begin{abstract}
-\end{abstract}
- \DocInput{thm-kv.dtx}
-\end{document}
-%</driver>
%<*kv>
%\fi
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-% \CheckSum{160}
-%
-% \DoNotIndex{\@for,\addtocounter,\arabic,\csname,\endcsname,\cup,\CurrentOption}
-% \DoNotIndex{\{,\},\do,\define@key,\def,\DeclareOption,\else,\ensuremath,\expandafter}
-% \DoNotIndex{\hspace,\fi,\rule,\ifcase,\ifx,\in,\InputIfFileExists,\leq,\let,\mathpalette}
-% \DoNotIndex{\NeedsTeXFormat,\ldots,\ldotp,\newcommand,\newcounter,\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\parm,\ProcessOptions,\protected@edef}
-% \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm}
-%
-%\section{Usage}
-%
-% \DescribeMacro{\declaretheorem}
-%The macro
-%|\declaretheorem|\oarg{key=val-opts}\marg{name} can be used to define a
-%new theorem instead of |\newtheorem|. It is hoped that |\declaretheorem| is
-%easier to use than |\newtheorem|'s tangle of mutually-exclusive optional
-%arguments. The following is the list of keywords understood:
-%\begin{description}
-% \item[parent, numberwithin, within]
-% These keys govern when the theorem counter is reset. For example, giving
-% parent=chapter gives you theorems numbered per chapter, so it's
-% equivalent to the second optional argument to |\newtheorem|. There are
-% three names so you'll remember at least one of them.
-% \item[sibling, numberlike, sharenumber]
-% These keys make the theorem share a common numbering with the given
-% theorem. This is just like giving the first optional argument.
-% \item[unnumbered, starred]
-% If your theorem package supports it, this will call |\newtheorem*|,
-% i.e. you'll get a theorem that is never numbered. Currently, only
-% amsmath offers this possibility.
-% \item[name, title, heading] |\newtheorem| takes \emph{two} options, the
-% name of the environment (like |lem|) and its title (|Lemma|).
-% |\declaretheorem| only requires the environment name, and the title
-% defaults to the environment name with the first letter uppercased. If
-% you name your environments |lemma|, |theorem|, etc., you don't need to
-% do anything else. Otherwise, you can always manually specify the title.
-% \item[(pre/post)(head/foot)hook] You can specify extra code that will be
-% executed whenever you use the environment. \textbf{Warning:} this needs
-% the \pkg{thm-patch} package, and you're responsible for loading it
-% yourself if you want these keys to work. This functionality might be
-% shifted over to \pkg{thm-patch} in future releases.
-% \item[style]
-% This will issue a |\theoremstyle{foo}| for you if you give |style=foo|.
-% Note that currently, no care is taken to prevent this from becoming the
-% default style for subsequent theorems.
-%\end{description}
-%
-% \subsection{Examples}
-% In many cases, you'll just get by with
-% \begin{verbatim}
-% \declaretheorem{lemma}
-% \end{verbatim}
-% which creates the environment `lemma', which will be labeled `Lemma' and
-% numbered consecutively throughout:
-%\begin{lemma}
-% This is what it looks like.
-%\end{lemma}
-% If you have more environments, you
-% might want
-% \begin{verbatim}
-% \declaretheorem[sibling=lemma]{theorem}
-% \end{verbatim}
-% which will make the theorems share the numbering with the lemmas. If you
-% had wanted per-chapter numbering for everything, you would have said
-%\begin{verbatim}
-% \declaretheorem[parent=chapter]{lemma}
-%\end{verbatim}
-% without need to change subsequent declarations. A very fancy declaration
-% using the shadethm and thm-patch package would look like this:
-%\begin{verbatim}
-% \declaretheorem[sibling=theorem, shaded, name={Rule of Thumb}]{ruleofthumb}
-%\end{verbatim}
-%
-%\begin{ruleofthumb}
-% If all else fails, read the manual. Usually all else fails because you
-% didn't.
-% \end{ruleofthumb}
-%
-% You can customize the colors and border like this:
-%\begin{verbatim}
-%\declaretheorem[shaded={bgcolor={rgb}{1,0,0},rulecolor={rgb}{0,1,0},rulewidth=2em,
-% margin=1em, textwidth=5cm}]{eyesore}
-%\end{verbatim}
-%\begin{eyesore}
-% But doing that is strongly discouraged.
-%\end{eyesore}
-%
-% There is also an interface to the thmbox package: you can use |thmbox=X|,
-% where X is one of the styles L, M, S as defined by that package.
-% (Actually, the parameter you give here is just passed on as optional
-% argument to |\newboxtheorem|, so the other parameters like headstyle are valid as well.)
-% The
-% redefinition of proof and example is suppressed unless you load the thmbox
-% package manually before you load thmtools.
-%
%\StopEventually{}
-%\section{Implementation}
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thm-kv}[2009/07/30 v0.1beta11 thm-kv interface (ulmi)]
+
\let\@xa\expandafter
\let\@nx\noexpand
-\RequirePackage{keyval}
+\RequirePackage{keyval,kvsetkeys,thm-patch}
-\define@key{thmt}{parent}{\thmt@setparent{#1}}
-\define@key{thmt}{numberwithin}{\thmt@setparent{#1}}
-\define@key{thmt}{within}{\thmt@setparent{#1}}
+\newif\if@thmt@firstkeyset
-\define@key{thmt}{sibling}{\thmt@setsibling{#1}}
-\define@key{thmt}{numberlike}{\thmt@setsibling{#1}}
-\define@key{thmt}{sharenumber}{\thmt@setsibling{#1}}
+% many keys are evaluated twice, because we don't know
+% if they make sense before or after, or both.
+\def\thmt@trytwice{%
+ \if@thmt@firstkeyset
+ \@xa\@firstoftwo
+ \else
+ \@xa\@secondoftwo
+ \fi
+}
-\define@key{thmt}{title}{\thmt@setthmname{#1}}
-\define@key{thmt}{name}{\thmt@setthmname{#1}}
-\define@key{thmt}{heading}{\thmt@setthmname{#1}}
+\@for\keyname:=parent,numberwithin,within\do{%
+\define@key{thmdef}{\keyname}{\thmt@trytwice{\thmt@setparent{#1}}{}}%
+}
-\define@key{thmt}{unnumbered}[]{\thmt@isnumberedfalse}
-\define@key{thmt}{starred}[]{\thmt@isnumberedfalse}
+\@for\keyname:=sibling,numberlike,sharenumber\do{%
+\define@key{thmdef}{\keyname}{\thmt@trytwice{\thmt@setsibling{#1}}{}}%
+}
-\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}}
+\@for\keyname:=title,name,heading\do{%
+\define@key{thmdef}{\keyname}{\thmt@trytwice{\thmt@setthmname{#1}}{}}%
+}
-\define@key{thmt}{style}{\thmt@setstyle{#1}}
+\@for\keyname:=unnumbered,starred\do{%
+\define@key{thmdef}{\keyname}[]{\thmt@trytwice{\thmt@isnumberedfalse}{}}%
+}
-\providecommand\theoremstyle[1]{%
+\def\thmt@YES{yes}
+\def\thmt@NO{no}
+\def\thmt@UNIQUE{unless unique}
+\define@key{thmdef}{numbered}[\thmt@YES]{
+ \def\thmt@tmp{#1}%
+ \thmt@trytwice{%
+ \ifx\thmt@tmp\thmt@YES
+ \thmt@isnumberedtrue
+ \else\ifx\thmt@tmp\thmt@NO
+ \thmt@isnumberedfalse
+ \else\ifx\thmt@tmp\thmt@UNIQUE
+ \RequirePackage[unq]{unique}
+ \ifuniq{\thmt@envname}{%
+ \thmt@isnumberedfalse
+ }{%
+ \thmt@isnumberedtrue
+ }%
+ \else
+ \PackageError{thmtools}{Unknown value `#1' to key numbered}{}%
+ \fi\fi\fi
+ }{% trytwice: after definition
+ \ifx\thmt@tmp\thmt@UNIQUE
+ \addtotheorempreheadhook[\thmt@envname]{\setuniqmark{\thmt@envname}}%
+ \addtotheorempreheadhook[\thmt@envname]{\def\thmt@dummyctrautorefname{\thmt@thmname\@gobble}}
+ \fi
+ }%
+}
+
+
+\define@key{thmdef}{preheadhook}{\thmt@trytwice{}{\addtotheorempreheadhook[\thmt@envname]{#1}}}
+\define@key{thmdef}{postheadhook}{\thmt@trytwice{}{\addtotheorempostheadhook[\thmt@envname]{#1}}}
+\define@key{thmdef}{prefoothook}{\thmt@trytwice{}{\addtotheoremprefoothook[\thmt@envname]{#1}}}
+\define@key{thmdef}{postfoothook}{\thmt@trytwice{}{\addtotheorempostfoothook[\thmt@envname]{#1}}}
+
+\define@key{thmdef}{style}{\thmt@trytwice{\thmt@setstyle{#1}}{}}
+
+% ugly hack: style needs to be evaluated first so its keys
+% are not overridden by explicit other settings
+\define@key{thmdef0}{style}{%
+ \ifcsname thmt@style #1@defaultkeys\endcsname
+ \thmt@toks{\kvsetkeys{thmdef}}%
+ \@xa\@xa\@xa\the\@xa\@xa\@xa\thmt@toks\@xa\@xa\@xa{%
+ \csname thmt@style #1@defaultkeys\endcsname}%
+ \fi
+}
+\kv@set@family@handler{thmdef0}{}% ignore everything else.
+
+% fallback definition.
+% actually, only the kernel does not provide \theoremstyle.
+% is this one worth having glue code for the theorem package?
+\def\thmt@setstyle#1{%
\PackageWarning{thm-kv}{%
- Your backend doesn't have a `\string\theoremstyle' command.\MessageBreak
- Your style request `#1' was ignored
+ Your backend doesn't have a `\string\theoremstyle' command.
}%
}
-\let\thmt@setstyle\theoremstyle
+
+\ifcsname theoremstyle\endcsname
+ \let\thmt@originalthmstyle\theoremstyle
+ \def\thmt@outerstyle{plain}
+ \renewcommand\theoremstyle[1]{%
+ \def\thmt@outerstyle{#1}%
+ \thmt@originalthmstyle{#1}%
+ }
+ \def\thmt@setstyle#1{%
+ \thmt@originalthmstyle{#1}%
+ }
+ \g@addto@macro\thmt@newtheorem@postdefinition{%
+ \thmt@originalthmstyle{\thmt@outerstyle}%
+ }
+\fi
\newif\ifthmt@isnumbered
\newcommand\thmt@setparent[1]{%
@@ -212,6 +130,7 @@
\def\thmt@thmname
}
+\thmt@mkextendingkeyhandler{thmdef}{thmdef}{\string\declaretheorem\space key}
\newcommand\declaretheorem[2][]{%
\let\thmt@theoremdefiner\thmt@original@newtheorem
@@ -220,7 +139,9 @@
\thmt@setparent{}%
\thmt@setsibling{}%
\thmt@isnumberedtrue%
- \setkeys{thmt}{#1}%
+ \@thmt@firstkeysettrue%
+ \kvsetkeys{thmdef0}{#1}%
+ \kvsetkeys{thmdef}{#1}%
\protected@edef\thmt@tmp{%
\@nx\newtheorem
\ifthmt@isnumbered\else *\fi
@@ -232,61 +153,104 @@
\thmt@tmp
% uniquely ugly kludge: some keys make only sense
% afterwards.
- \setkeys{thmt}{#1}%
+ % and it gets kludgier: again, the default-inherited
+ % keys need to have a go at it.
+ \@thmt@firstkeysetfalse%
+ \kvsetkeys{thmdef0}{#1}%
+ \kvsetkeys{thmdef}{#1}%
+}
+
+\providecommand\thmt@quark{\thmt@quark}
+
+% in-document keyval, i.e. \begin{theorem}[key=val,key=val]
+
+\thmt@mkextendingkeyhandler{thmuse}{thmuse}{\thmt@envname\space optarg key}
+
+\addtotheorempreheadhook{%
+ \ifx\thmt@optarg\@empty\else
+ \@xa\thmt@garbleoptarg\@xa{\thmt@optarg}\fi
+}%
+\providecommand\thmt@garbleoptarg[1]{%
+ \thmt@splitopt#1=\thmt@quark
+ \ifcsname KV@thmuse@\thmt@tmpkey\endcsname
+ % looks like a keyval-style argument
+ \PackageInfo{thmtools}{kv-style argument to `\thmt@envname'}
+ %\typeout{dbg: new-style arg `#1'}%
+ \let\thmt@newoptarg\@empty
+ \kvsetkeys{thmuse}{#1}%
+ \let\thmt@optarg\thmt@newoptarg
+ %\else
+ % \typeout{dbg: old-style arg `#1'}%
+ \fi
+% % optarg present, check if it's newstyle
+% % a newstyle kv args starts with =.
+% %\tracingall
+% \if\expandafter\noexpand\@car #1\@nil=
+% \let\thmt@newoptarg\@empty
+% \@xa\def\@xa\thmt@optarg\@xa{\@cdr #1\@nil}%
+% \def\thmt@tempa{\setkeys{thmt-optarg}}%
+% \@xa\thmt@tempa\@xa{\thmt@optarg}% expansion!
+% \let\thmt@optarg\thmt@newoptarg
+% \else
+% \typeout{(dbg: old-style arg `#1')}%
+% \fi
+}
+\def\thmt@splitopt#1=#2\thmt@quark{%
+ \def\thmt@tmpkey{#1}%
+ \ifx\thmt@tmpkey\@empty
+ \def\thmt@tmpkey{\thmt@quark}%
+ \fi
+ \@onelevel@sanitize\thmt@tmpkey
+}
+
+\define@key{thmuse}{label}{%
+ %\typeout{setting label: #1}%
+ \addtotheorempostheadhook[local]{\label{#1}}%
}
+\define@key{thmuse}{name}{%
+ %\typeout{optarg: #1}%
+ \def\thmt@newoptarg{#1}%
+}
+
% \end{macrocode}
-% \subsection{Package-specific extensions}
-% This is code that requires additional packages. These might be mutually
-% incompatible.
%
-% \subsubsection{shadethm}
-% \begin{macrocode}
- \define@key{thmt}{shaded}[{}]{%
- \RequirePackage{shadethm}%
- \RequirePackage{thm-patch}%
- \addtotheorempreheadhook[\thmt@envname]{%
- \setlength\shadedtextwidth{\linewidth}%
- \setkeys{thmt@shade}{#1}\begin{shadebox}}%
- \addtotheorempostfoothook[\thmt@envname]{\end{shadebox}}%
- }
-% There are some parameters you could set the default for (try them as is,
-% first).
-% (i) shadethmcolor The shading color of the background. See the
-% documentation for the color package, but with a `gray' model, I find .97
-% looks good out of my printer, while a darker shade like .92 is needed
-% to make it copy well. (Black is 0, white is 1.)
-% (i*) shaderulecolor The shading color of the border of the shaded box.
-% See (i). If \shadeboxrule is set to 0pt then this won't print anyway.
-% (i**) shadeboxrule The width of the border around the shading. Set it to
-% 0pt (not just 0) to make it disappear.
-% (i***) shadeboxsep The length by which the shade box surrounds the text.
-\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}}
-% \end{macrocode}
-% \subsubsection{thmbox}
-% Emmanuel Beffara's thmbox package lets you draw certain sorts of borders
-% around the theorems. Note that I don't think it honours \string\theoremstyle.
+% Defining new theorem styles; keys are in opt-arg
+% even though not having any doesn't make much sense.
+% It doesn't do anything exciting here, it's up to
+% the glue layer to provide keys.
+%
% \begin{macrocode}
- \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]}%
+\def\thmt@declaretheoremstyle@setup{}
+\def\thmt@declaretheoremstyle#1{%
+ \PackageWarning{thmtools}{Your backend doesn't allow styling theorems}{}
+}
+\newcommand\declaretheoremstyle[2][]{%
+ \def\thmt@style{#2}%
+ \@xa\def\csname thmt@style \thmt@style @defaultkeys\endcsname{}%
+ \thmt@declaretheoremstyle@setup
+ \kvsetkeys{thmstyle}{#1}%
+ \thmt@declaretheoremstyle{#2}%
+}
+
+\kv@set@family@handler{thmstyle}{%
+ \PackageInfo{thmtools}{%
+ Key `#1' (with value `#2')\MessageBreak
+ is not a known style key.\MessageBreak
+ Will pass this to every \string\declaretheorem\MessageBreak
+ that uses `style=\thmt@style'%
}%
+ \ifx\kv@value\relax% no value given, don't pass on {}!
+ \@xa\g@addto@macro\csname thmt@style \thmt@style @defaultkeys\endcsname{%
+ #1,%
+ }%
+ \else
+ \@xa\g@addto@macro\csname thmt@style \thmt@style @defaultkeys\endcsname{%
+ #1={#2},%
+ }%
+ \fi
+}
% \end{macrocode}
-% \subsubsection{beamer}
-% Nothing yet.
-% \begin{macrocode}
-% \end{macrocode}
+%
%\iffalse
%</kv>
%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx b/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx
index 5b025bc4039..85790f4eac6 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx
@@ -10,68 +10,9 @@
% \fi
%
%\iffalse (hide this from DocInput)
-%<*driver>
-\documentclass{ltxdoc}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.8]{helvet}
-\usepackage{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{thm-patch}
-\newtheorem{lemma}{Lemma}
-\GetFileInfo{thm-listof.sty}
-\providecommand\pkg{\textsf}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
-
- \newcommand\thmlistof{\textsf{thm-listof}}
- \title{The \thmlistof\ package\thanks{%
- This file documents version~\fileversion\ of~\filedate,
- RCS ${}$Id: thm-listof.dtx,v 1.11 2009/03/22 18:05:57 ulmi Exp ulmi ${}$.
- }}
- \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}}
-
- \maketitle
-
-\begin{abstract}
-\end{abstract}
-
- \DocInput{thm-listof.dtx}
-\end{document}
-%</driver>
%<*listof>
%\fi
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-% \CheckSum{160}
-%
-% \DoNotIndex{\@for,\addtocounter,\arabic,\csname,\endcsname,\cup,\CurrentOption}
-% \DoNotIndex{\{,\},\do,\define@key,\def,\DeclareOption,\else,\ensuremath,\expandafter}
-% \DoNotIndex{\hspace,\fi,\rule,\ifcase,\ifx,\in,\InputIfFileExists,\leq,\let,\mathpalette}
-% \DoNotIndex{\NeedsTeXFormat,\ldots,\ldotp,\newcommand,\newcounter,\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\parm,\ProcessOptions,\protected@edef}
-% \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm}
-%
-%\section{Usage}
% This package provides two main commands:
% \DescribeMacro{\listoftheorems}
% |\listoftheorems| will generate, well, a list of all theorems, lemmas,
@@ -111,25 +52,22 @@
% daring, the code for the theorem type ``lemma'' is in |\l@lemma| and so on.
%
%\StopEventually{}
-%\section{Implementation}
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thm-listof}[2010/04/05 v0.1beta13 thm-listof (ulmi)]
\let\@xa=\expandafter
\let\@nx=\noexpand
-\RequirePackage{thm-patch}
+\RequirePackage{thm-patch,keyval,kvsetkeys}
\def\thmtlo@oldchapter{0}%
\newcommand\thmtlo@chaptervspacehack{}
-\@ifundefined{chapter}{}{%
+\ifcsname chapter\endcsname
\def\thmtlo@chaptervspacehack{%
- \ifnum \arabic{chapter}>\thmtlo@oldchapter\relax
+ \ifnum \value{chapter}>\thmtlo@oldchapter\relax
% new chapter, add vspace to loe.
\addtocontents{loe}{\protect\addvspace{10\p@}}%
- \edef\thmtlo@oldchapter{\arabic{chapter}}%
+ \xdef\thmtlo@oldchapter{\arabic{chapter}}%
\fi
}%
-}
+\fi
\providecommand\listtheoremname{List of Theorems}
\newcommand\listoftheorems[1][]{%
@@ -138,6 +76,9 @@
\bgroup
\setlisttheoremstyle{#1}%
\let\listfigurename\listtheoremname
+ \def\contentsline##1{%
+ \csname thmt@contentsline@##1\endcsname{##1}%
+ }%
\let\thref@starttoc\@starttoc
\def\@starttoc##1{\thref@starttoc{loe}}%
% new hack: to allow multiple calls, we defer the opening of the
@@ -158,7 +99,7 @@
}
\newcommand\setlisttheoremstyle[1]{%
- \setkeys{thmt-listof}{#1}%
+ \kvsetkeys{thmt-listof}{#1}%
}
\define@key{thmt-listof}{numwidth}{\def\thmt@listnumwidth{#1}}
\define@key{thmt-listof}{ignore}[\thmt@allenvs]{\ignoretheorems{#1}}
@@ -175,10 +116,21 @@
\@xa\protected@edef\csname l@\thmt@envname\endcsname{% CHECK: why p@edef?
\@nx\@dottedtocline{1}{1.5em}{\@nx\thmt@listnumwidth}%
}%
- \@xa\def\csname ll@\thmt@envname\endcsname{%
- \protect\numberline{\csname the\thmt@envname\endcsname}%
- \thmt@thmname
- \ifx\@empty\thmt@optarg\else\protect\thmtformatoptarg{\thmt@optarg}\fi
+ \ifthmt@isstarred
+ \@xa\def\csname ll@\thmt@envname\endcsname{%
+ \protect\numberline{\protect\let\protect\autodot\protect\@empty}%
+ \thmt@thmname
+ \ifx\@empty\thmt@optarg\else\protect\thmtformatoptarg{\thmt@optarg}\fi
+ }%
+ \else
+ \@xa\def\csname ll@\thmt@envname\endcsname{%
+ \protect\numberline{\csname the\thmt@envname\endcsname}%
+ \thmt@thmname
+ \ifx\@empty\thmt@optarg\else\protect\thmtformatoptarg{\thmt@optarg}\fi
+ }%
+ \fi
+ \@xa\gdef\csname thmt@contentsline@\thmt@envname\endcsname{%
+ \thmt@contentslineShow% default:show
}%
}
\def\thmt@allenvs{\@gobble}
@@ -196,37 +148,60 @@
\csname ll@\thmt@envname\endcsname
}%
}
+
+\newcommand\showtheorems[1]{%
+ \@for\thm:=#1\do{%
+ \typeout{showing \thm}%
+ \@xa\let\csname thmt@contentsline@\thm\endcsname
+ =\thmt@contentslineShow
+ }%
+}
+
\newcommand\ignoretheorems[1]{%
\@for\thm:=#1\do{%
- \@xa\let\csname l@\thm\endcsname=\@gobbletwo
+ \@xa\let\csname thmt@contentsline@\thm\endcsname
+ =\thmt@contentslineIgnore
}%
}
\newcommand\onlynamedtheorems[1]{%
\@for\thm:=#1\do{%
- \@xa\let\csname l@\thm\endcsname=\thmt@showifnamedtheorem
+ \global\@xa\let\csname thmt@contentsline@\thm\endcsname
+ =\thmt@contentslineIfNamed
}%
}
-\def\thmt@showifnamedtheorem#1#2{%
- % check for \thmtformatoptarg on top level of first argument.
- \thmt@sh@wifnamedtheorem#1\thmtformatoptarg\@nil{%
- \@dottedtocline{1}{1.5em}{\thmt@listnumwidth}{#1}{#2}%
- }{}%
+
+\AtBeginDocument{%
+\@ifpackageloaded{hyperref}{%
+ \let\thmt@hygobble\@gobble
+}{%
+ \let\thmt@hygobble\@empty
+}
+\let\thmt@contentsline\contentsline
+}
+
+\def\thmt@contentslineIgnore#1#2#3{%
+ \thmt@hygobble
+}
+\def\thmt@contentslineShow{%
+ \thmt@contentsline
}
-\def\thmt@sh@wifnamedtheorem#1\thmtformatoptarg#2\@nil{%
+
+\def\thmt@contentslineIfNamed#1#2#3{%
+ \thmt@ifhasoptname #2\thmtformatoptarg\@nil{%
+ \thmt@contentslineShow{#1}{#2}{#3}%
+ }{%
+ \thmt@contentslineIgnore{#1}{#2}{#3}%
+ %\thmt@contentsline{#1}{#2}{#3}%
+ }
+}
+
+\def\thmt@ifhasoptname #1\thmtformatoptarg#2\@nil{%
\ifx\@nil#2\@nil
\@xa\@secondoftwo
\else
\@xa\@firstoftwo
\fi
}
-
-\newcommand\showtheorems[1]{%
- \@for\thm:=#1\do{%
- \@xa\protected@edef\csname l@\thm\endcsname{% CHECK: why p@edef?
- \@nx\@dottedtocline{1}{1.5em}{\@nx\thmt@listnumwidth}%
- }%
- }%
-}
% \end{macrocode}
%\iffalse
%</listof>
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-ntheorem.dtx b/Master/texmf-dist/source/latex/thmtools/thm-ntheorem.dtx
new file mode 100644
index 00000000000..0e62613fa6d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/thmtools/thm-ntheorem.dtx
@@ -0,0 +1,123 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2010 by Ulrich M. Schwarz
+% See file COPYING for more details.
+%\fi
+%
+%\iffalse (hide this from DocInput)
+%<*ntheorem>
+%\fi
+% \begin{macrocode}
+
+% actually, ntheorem's so-called style is nothing like a style at all...
+\def\thmt@declaretheoremstyle@setup{}
+\def\thmt@declaretheoremstyle#1{%
+ \ifcsname th@#1\endcsname\else
+ \@xa\let\csname th@#1\endcsname\th@plain
+ \fi
+}
+
+\def\thmt@notsupported#1#2{%
+ \PackageWarning{thmtools}{Key `#2' not supported by #1}{}%
+}
+
+\define@key{thmstyle}{spaceabove}{%
+ \setlength\theorempreskipamount{#1}%
+}
+\define@key{thmstyle}{spacebelow}{%
+ \setlength\theorempostskipamount{#1}%
+}
+\define@key{thmstyle}{headfont}{%
+ \theoremheaderfont{#1}%
+}
+\define@key{thmstyle}{bodyfont}{%
+ \theorembodyfont{#1}%
+}
+% not supported in ntheorem.
+\define@key{thmstyle}{notefont}{%
+ \thmt@notsupported{ntheorem}{notefont}%
+}
+\define@key{thmstyle}{headpunct}{%
+ \theoremseparator{#1}%
+}
+% not supported in ntheorem.
+\define@key{thmstyle}{notebraces}{%
+ \thmt@notsupported{ntheorem}{notebraces}%
+}
+\define@key{thmstyle}{break}{%
+ \theoremstyle{break}%
+}
+% not supported in ntheorem...
+\define@key{thmstyle}{postheadspace}{%
+ %\def\thmt@style@postheadspace{#1}%
+ \@xa\g@addto@macro\csname thmt@style \thmt@style @defaultkeys\endcsname{%
+ postheadhook={\hspace{-\labelsep}\hspace*{#1}},%
+ }%
+}
+
+% not supported in ntheorem
+\define@key{thmstyle}{headindent}{%
+ \thmt@notsupported{ntheorem}{headindent}%
+}
+% sorry, only style, not def with ntheorem.
+\define@key{thmstyle}{qed}[\qedsymbol]{%
+ \theoremsymbol{#1}%
+}
+
+\let\@upn=\textup
+\define@key{thmstyle}{headformat}[]{%
+ \def\thmt@tmp{#1}%
+ \@onelevel@sanitize\thmt@tmp
+ %\tracingall
+ \ifcsname thmt@headstyle@\thmt@tmp\endcsname
+ \newtheoremstyle{\thmt@style}{%
+ \item[\hskip\labelsep\theorem@headerfont%
+ \def\NAME{\theorem@headerfont ####1}%
+ \def\NUMBER{\bgroup\@upn{####2}\egroup}%
+ \def\NOTE{}%
+ \csname thmt@headstyle@#1\endcsname
+ \theorem@separator
+ ]
+ }{%
+ \item[\hskip\labelsep\theorem@headerfont%
+ \def\NAME{\theorem@headerfont ####1}%
+ \def\NUMBER{\bgroup\@upn{####2}\egroup}%
+ \def\NOTE{\if=####3=\else\bgroup\ (####3)\egroup\fi}%
+ \csname thmt@headstyle@#1\endcsname
+ \theorem@separator
+ ]
+ }
+ \else
+ \newtheoremstyle{\thmt@style}{%
+ \item[\hskip\labelsep\theorem@headerfont%
+ \def\NAME{\the\thm@headfont ####1}%
+ \def\NUMBER{\bgroup\@upn{####2}\egroup}%
+ \def\NOTE{}%
+ #1%
+ \theorem@separator
+ ]
+ }{%
+ \item[\hskip\labelsep\theorem@headerfont%
+ \def\NAME{\the\thm@headfont ####1}%
+ \def\NUMBER{\bgroup\@upn{####2}\egroup}%
+ \def\NOTE{\if=####3=\else\bgroup\ (####3)\egroup\fi}%
+ #1%
+ \theorem@separator
+ ]
+ }
+ \fi
+}
+
+\def\thmt@headstyle@margin{%
+ \makebox[0pt][r]{\NUMBER\ }\NAME\NOTE
+}
+\def\thmt@headstyle@swapnumber{%
+ \NUMBER\ \NAME\NOTE
+}
+
+
+
+% \end{macrocode}
+%\iffalse (hide this from DocInput)
+%</ntheorem>
+%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx b/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx
index ccd9ba16397..9b0c03d1ef7 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx
@@ -10,69 +10,9 @@
% \fi
%
%\iffalse (hide this from DocInput)
-%<*driver>
-\documentclass{ltxdoc}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.8]{helvet}
-\usepackage{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{thm-patch}
-\newtheorem{lemma}{Lemma}
-\providecommand\pkg{\textsf}
-\GetFileInfo{thm-patch.sty}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
-
- \newcommand\thmpatch{\textsf{thm-patch}}
- \title{The \thmpatch\ package\thanks{%
- This file documents version~\fileversion\ of~\filedate,
- RCS ${}$Id: thm-patch.dtx,v 1.15 2008/09/02 19:33:09 ulmi Exp ulmi ${}$.
- }}
- \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}}
-
- \maketitle
-
-\begin{abstract}
-\end{abstract}
-
- \DocInput{thm-patch.dtx}
-\end{document}
-%</driver>
%<*patch>
%\fi
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-% \CheckSum{160}
-%
-% \DoNotIndex{\@for,\addtocounter,\arabic,\csname,\endcsname,\cup,\CurrentOption}
-% \DoNotIndex{\{,\},\do,\define@key,\def,\DeclareOption,\else,\ensuremath,\expandafter}
-% \DoNotIndex{\hspace,\fi,\rule,\ifcase,\ifx,\in,\InputIfFileExists,\leq,\let,\mathpalette}
-% \DoNotIndex{\NeedsTeXFormat,\ldots,\ldotp,\newcommand,\newcounter,\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\parm,\ProcessOptions,\protected@edef}
-% \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm}
-%
-%\section{Usage}
-%
% This package is maybe not very suitable for the end user. It redefines
% |\newtheorem| in a way that lets other packages (or the user) add code
% to the newly-defined theorems, in a reasonably cross-compatible (with
@@ -104,65 +44,35 @@
% the extra optional title, if any.
%
%\StopEventually{}
-%\section{Implementation}
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thm-patch}[2008/09/02 v0.1beta6b 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
+\def\thmt@parsetheoremargs#1{%
+ \parse{%
+ {\parseOpt[]{\def\thmt@optarg{##1}}{\let\thmt@optarg\@empty}}%
+ {%
+ \def\thmt@local@preheadhook{}%
+ \def\thmt@local@postheadhook{}%
+ \def\thmt@local@prefoothook{}%
+ \def\thmt@local@postfoothook{}%
+ \thmt@local@preheadhook
+ \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
+ \thmt@local@postheadhook
+ \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
\let\thmt@theoremdefiner\thmt@original@newtheorem
@@ -183,7 +93,7 @@
\newcommand\thmt@newtheoremiv{%
\thmt@newtheorem@predefinition
- % whee, now reassemble the whole shit.
+ % whee, now reassemble the whole shebang.
\protected@edef\thmt@args{%
\@nx\thmt@theoremdefiner%
\ifthmt@isstarred *\fi
@@ -199,6 +109,9 @@
\newcommand\thmt@newtheorem@predefinition{}
\newcommand\thmt@newtheorem@postdefinition{}
+\g@addto@macro\thmt@newtheorem@predefinition{%
+ \@xa\thmt@providetheoremhooks\@xa{\thmt@envname}%
+}
\g@addto@macro\thmt@newtheorem@postdefinition{%
\@xa\thmt@addtheoremhook\@xa{\thmt@envname}%
\ifthmt@isstarred\@namedef{the\thmt@envname}{}\fi
@@ -210,6 +123,16 @@
\thmt@tmp
}%
}
+\newcommand\thmt@providetheoremhooks[1]{%
+ \@namedef{thmt@#1@preheadhook}{}%
+ \@namedef{thmt@#1@postheadhook}{}%
+ \@namedef{thmt@#1@prefoothook}{}%
+ \@namedef{thmt@#1@postfoothook}{}%
+ \def\thmt@local@preheadhook{}%
+ \def\thmt@local@postheadhook{}%
+ \def\thmt@local@prefoothook{}%
+ \def\thmt@local@postfoothook{}%
+}
\newcommand\thmt@addtheoremhook[1]{%
% this adds two command calls to the newly-defined theorem.
\@xa\let\csname thmt@original@#1\@xa\endcsname
@@ -221,18 +144,24 @@
\@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@#1@prefoothook\endcsname
+ \csname thmt@local@prefoothook\endcsname
\csname thmt@original@end#1\endcsname
\csname thmt@generic@postfoothook\endcsname
\csname thmt@#1@postfoothook\endcsname
+ \csname thmt@local@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\thmt@generic@prefoothook{}
+\newcommand\thmt@generic@postfoothook{}
+
+\def\thmt@local@preheadhook{}
+\def\thmt@local@postheadhook{}
+\def\thmt@local@prefoothook{}
+\def\thmt@local@postfoothook{}
+
\providecommand\g@prependto@macro[2]{%
\begingroup
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx
index 2f7a4ec1e6b..1abbee30f6c 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx
@@ -10,70 +10,9 @@
% \fi
%
%\iffalse (hide this from DocInput)
-%<*driver>
-\documentclass{ltxdoc}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.8]{helvet}
-\usepackage{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{thm-restate}
-\newtheorem{lemma}{Lemma}
-\providecommand\pkg{\textsf}
-\GetFileInfo{thm-restate.sty}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
-
- \newcommand\thmrestate{\textsf{thm-restate}}
- \title{The \thmrestate\ package\thanks{%
- This file documents version~\fileversion\ of~\filedate,
- RCS ${}$Id: thm-restate.dtx,v 1.16 2010/04/05 18:02:27 ulmi Exp ulmi ${}$.
- }}
- \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}}
-
- \maketitle
-
-\begin{abstract}
- This package provides one single environment, restatable, which lets you
- repeat whole theorems without retyping them.
-\end{abstract}
-
- \DocInput{thm-restate.dtx}
-\end{document}
-%</driver>
%<*restate>
%\fi
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-% \CheckSum{160}
-%
-% \DoNotIndex{\@for,\addtocounter,\arabic,\csname,\endcsname,\cup,\CurrentOption}
-% \DoNotIndex{\{,\},\do,\define@key,\def,\DeclareOption,\else,\ensuremath,\expandafter}
-% \DoNotIndex{\hspace,\fi,\rule,\ifcase,\ifx,\in,\InputIfFileExists,\leq,\let,\mathpalette}
-% \DoNotIndex{\NeedsTeXFormat,\ldots,\ldotp,\newcommand,\newcounter,\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\parm,\ProcessOptions,\protected@edef}
-% \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage}
-% \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm}
-%
-%\section{Usage}
%\DescribeEnv{restatable}
%Only one environment is provided: \verb|restatable|, which takes one
%optional and two mandatory arguments. The first mandatory argument is the
@@ -146,10 +85,7 @@
%
%
%\StopEventually{}
-%\section{Implementation}
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thm-restate}[2010/04/05 v0.1beta13 thm-restate (ulmi)]
\let\@xa\expandafter
\let\@nx\noexpand
@@ -158,7 +94,6 @@
}{}
\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}%
@@ -174,8 +109,10 @@
}%
}
-\def\thmt@trivialref#1{%
- \@xa\@xa\@xa\thmt@trivi@lr@f\csname r@#1\endcsname\@nil
+\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}
@@ -205,6 +142,8 @@
\newif\ifthmt@thisistheone
\newenvironment{thmt@restatable}[3][]{%
+ \thmt@toks{}%
+ \stepcounter{thmt@dummyctr}%
\long\def\thmrst@store##1{%
\@xa\gdef\csname #3\endcsname{%
\@ifstar{%
@@ -227,7 +166,8 @@
\@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{\csname 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}%
}%
@@ -236,7 +176,10 @@
\egroup
\else
\@xa\protected@edef\csname the#2\endcsname{%
- \thmt@trivialref{thmt@@#3}}%
+ \thmt@trivialref{thmt@@#3}{??}}%
+ \ifcsname r@thmt@@#3\endcsname\else
+ \G@refundefinedtrue
+ \fi
\@xa\let\csname c@#2\endcsname=\c@thmt@dummyctr
\@xa\let\csname theH#2\endcsname=\theHthmt@dummyctr
\let\label=\@gobble
@@ -248,7 +191,7 @@
\protect\setcounter{equation}{\arabic{equation}}%
}%
}
- \thmt@trivialref{thmt@@#3@data}%
+ \thmt@trivialref{thmt@@#3@data}{}%
\fi
%\def\@currenvir{#2}%
\csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[#1]\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx b/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx
new file mode 100644
index 00000000000..55559b3a1f8
--- /dev/null
+++ b/Master/texmf-dist/source/latex/thmtools/thmdef-shaded.dtx
@@ -0,0 +1,62 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2010 by Ulrich M. Schwarz
+% See file COPYING for more details.
+%\fi
+%
+%\iffalse (hide this from DocInput)
+%<*shaded>
+%\fi
+% \begin{macrocode}
+ \define@key{thmdef}{shaded}[{}]{%
+ \thmt@trytwice{}{%
+ \RequirePackage{shadethm}%
+ \RequirePackage{thm-patch}%
+ \addtotheorempreheadhook[\thmt@envname]{%
+ \setlength\shadedtextwidth{\linewidth}%
+ \kvsetkeys{thmt@shade}{#1}\begin{shadebox}}%
+ \addtotheorempostfoothook[\thmt@envname]{\end{shadebox}}%
+ }%
+ }
+% There are some parameters you could set the default for (try them as is,
+% first).
+% (i) shadethmcolor The shading color of the background. See the
+% documentation for the color package, but with a `gray' model, I find .97
+% looks good out of my printer, while a darker shade like .92 is needed
+% to make it copy well. (Black is 0, white is 1.)
+% (i*) shaderulecolor The shading color of the border of the shaded box.
+% See (i). If \shadeboxrule is set to 0pt then this won't print anyway.
+% (i**) shadeboxrule The width of the border around the shading. Set it to
+% 0pt (not just 0) to make it disappear.
+% (i***) shadeboxsep The length by which the shade box surrounds the text.
+\define@key{thmt@shade}{textwidth}{\setlength\shadedtextwidth{#1}}
+\define@key{thmt@shade}{bgcolor}{\thmt@definecolor{shadethmcolor}{#1}}
+\define@key{thmt@shade}{rulecolor}{\thmt@definecolor{shaderulecolor}{#1}}
+\define@key{thmt@shade}{rulewidth}{\setlength\shadeboxrule{#1}}
+\define@key{thmt@shade}{margin}{\setlength\shadeboxsep{#1}}
+
+\def\thmt@colorlet#1#2{%
+ %\typeout{don't know how to let color `#1' be like color `#2'!}%
+ \@xa\let\csname\string\color@#1\@xa\endcsname
+ \csname\string\color@#2\endcsname
+ % this is dubious at best, we don't know what a backend does.
+}
+\AtBeginDocument{%
+ \ifcsname colorlet\endcsname
+ \let\thmt@colorlet\colorlet
+ \fi
+}
+
+\def\thmt@drop@relax#1\relax{}
+\def\thmt@definecolor#1#2{%
+ \thmt@def@color{#1}#2\thmt@drop@relax
+ {gray}{0.5}%
+ \thmt@colorlet{#1}{#2}%
+ \relax
+}
+\def\thmt@def@color#1#2#{%
+ \definecolor{#1}}
+% \end{macrocode}
+%\iffalse (hide this from DocInput)
+%</shaded>
+%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thmdef-thmbox.dtx b/Master/texmf-dist/source/latex/thmtools/thmdef-thmbox.dtx
new file mode 100644
index 00000000000..8da999bfdaa
--- /dev/null
+++ b/Master/texmf-dist/source/latex/thmtools/thmdef-thmbox.dtx
@@ -0,0 +1,26 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2010 by Ulrich M. Schwarz
+% See file COPYING for more details.
+%\fi
+%
+%\iffalse (hide this from DocInput)
+%<*thmbox>
+%\fi
+% \begin{macrocode}
+\define@key{thmdef}{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]}%
+}%
+% \end{macrocode}
+%\iffalse (hide this from DocInput)
+%</thmbox>
+%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx
index 67106b76f21..0cb1696e9ff 100644
--- a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx
@@ -11,78 +11,79 @@
%
%\iffalse (hide this from DocInput)
%<*driver>
-\documentclass{ltxdoc}
-
-\let\pkg\textsf
-\def\thmtools{\pkg{thmtools}}
-\def\thmversion{2010/04/05 v0.1beta13}
-
-\usepackage[T1]{fontenc}
-\usepackage[widespace]{fourier}
-\usepackage[scaled=0.88]{helvet}
-\usepackage[scaled]{luximono}
-
-\usepackage{amsmath, amsthm}
-\usepackage{thm-patch, thm-kv, thm-autoref, thm-listof, thm-restate}
-\declaretheorem{remark}
-\declaretheorem{lemma}
-\declaretheorem[sibling=lemma, shaded, name={Rule of Thumb}]{ruleofthumb}
-\usepackage{color}
-\declaretheorem[shaded={bgcolor={rgb}{1,0,0},rulecolor={rgb}{0,1,0},rulewidth=2em,
- margin=1em, textwidth=5cm}]{eyesore}
-
+\makeatletter
+\ifx\documentclass\@twoclasserror\else
+ \expandafter\@firstofone
+\fi{%
+ \makeatother
+ %% we are either \RequirePackage'd
+ %% (which we won't support) or compiled directly.
+ %% If we are compiled directly, yield the manual.
+ %% Otherwise, this looks like a debugging session
+ %% that directly uses the dtx file instead of the sty.
+ \input{thmtools-manual.tex}
+ \endinput
+}
+%</driver>
+%<*thmtools>
+%\fi
+% \begin{macrocode}
+% common abbreviations and marker macros.
+\let\@xa\expandafter
+\let\@nx\noexpand
+\def\thmt@quark{\thmt@quark}
+\newtoks\thmt@toks
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\OnlyDescription
-\title{The \thmtools\ bundle\thanks{%
- This documents \thmtools\ version \thmversion.
- Newer releases might be available at http://absatzen.de/.
-}}
-\author{Ulrich M. Schwarz, \texttt{ulmi@absatzen.de}}
-\begin{document}
- \maketitle
- \begin{abstract}
- \thmtools\ is a collection of tools and enhancements for theorem
- environments.
- \end{abstract}
- \begin{remark}
- Each of the packages has its own documentation in a file named after the
- package itself. The only difference is that those documentations include
- the reasonably-well documented source code.
- \end{remark}
- \section*{\pkg{thm-kv}}
- \DocInput{thm-kv.dtx}
-
- \section*{\pkg{thm-restate}}
- \DocInput{thm-restate.dtx}
-
- \section*{\pkg{thm-autoref}}
- \DocInput{thm-autoref.dtx}
+% a scratch counter, mostly for fake hyperlinks
+\newcounter{thmt@dummyctr}%
+\def\theHthmt@dummyctr{dummy.\arabic{thmt@dummyctr}}%
+\def\thethmt@dummyctr{}%
- \section*{\pkg{thm-listof}}
- \DocInput{thm-listof.dtx}
-
- \section*{\pkg{thm-patch}}
- \DocInput{thm-patch.dtx}
+\newcommand\thmt@mkextendingkeyhandler[3]{%
+% #1: family
+% #2: prefix for file
+% #3: key hint for error
+ \kv@set@family@handler{#1}{%
+ \IfFileExists{#2-##1.sty}{%
+ \PackageInfo{thmtools}%
+ {Automatically pulling in `#2-##1'}%
+ \RequirePackage{#2-##1}%
+ \ifcsname KV@#1@##1\endcsname
+ \csname KV@#1@##1\endcsname{##2}%
+ \else
+ \PackageError{thmtools}%
+ {#3 `##1' not known}
+ {I don't know what that key does.\MessageBreak
+ I've even loaded the file `#2-##1.sty', but that didn't help.
+ }%
+ \fi
+ }{%
+ \PackageError{thmtools}%
+ {#3 `##1' not known}
+ {I don't know what that key does by myself,\MessageBreak
+ and no file `#2-##1.sty' to tell me seems to exist.
+ }%
+ }%
+ }
+}
- \section*{\pkg{aliasctr}}
- \DocInput{aliasctr.dtx}
+\RequirePackage{thm-patch, thm-kv,
+ thm-autoref, thm-listof,
+ thm-restate}
- \section*{\pkg{parseargs}}
- \DocInput{parseargs.dtx}
+% Glue code for the big players.
+\@ifpackageloaded{amsthm}{%
+ \RequirePackage{thm-amsthm}
+}{}
+\@ifpackageloaded{ntheorem}{%
+ \RequirePackage{thm-ntheorem}
+}{}
+\@ifclassloaded{beamer}{%
+ \RequirePackage{thm-beamer}
+}{}
+% \end{macrocode}
- \section*{\pkg{unique}}
- \DocInput{unique.dtx}
-\end{document}
-%</driver>
-%<*thmtools>
-%\fi
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thmtools}[2008/07/05 v0.1beta7 Tools for theorem typesetting (ulmi)]
-\RequirePackage{thm-kv, thm-autoref, thm-listof}
%\iffalse
%</thmtools>
%\fi
diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.ins b/Master/texmf-dist/source/latex/thmtools/thmtools.ins
index 388e0fbb186..852d3e3358f 100644
--- a/Master/texmf-dist/source/latex/thmtools/thmtools.ins
+++ b/Master/texmf-dist/source/latex/thmtools/thmtools.ins
@@ -1,8 +1,12 @@
%%
%% This is a bog-standard .ins file: thmtools.ins
%%
+\input VERSION.tex
+%\show\VERSION
+\def\dropext #1.#2\relax{#1}
\input docstrip.tex
-\keepsilent
+%\keepsilent
+\askonceonly
\preamble
This is a generated file.
@@ -10,13 +14,14 @@ 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.
+Copyright (C) 2008-\the\year 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
+^^J\noexpand\noexpand\noexpand\NeedsTeXFormat{LaTeX2e}^^J\noexpand\noexpand\noexpand\ProvidesPackage{\noexpand\expandafter\noexpand\dropext\outFileName\relax}[\VERSION]
\endpreamble
\generate{%
@@ -29,6 +34,11 @@ http://www.latex-project.org/lppl/lppl-1-3a.txt
\file{parseargs.sty}{\from{parseargs.dtx}{parseargs}}
\file{aliasctr.sty}{\from{aliasctr.dtx}{code}}
\file{unique.sty}{\from{unique.dtx}{code}}
+ \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{thmdef-shaded.sty}{\from{thmdef-shaded.dtx}{shaded}}
+ \file{thmdef-thmbox.sty}{\from{thmdef-thmbox.dtx}{thmbox}}
}
\Msg{*********************************************************}
\Msg{*}
diff --git a/Master/texmf-dist/source/latex/thmtools/unique.dtx b/Master/texmf-dist/source/latex/thmtools/unique.dtx
index cd60a7e8900..9afbd2cffa2 100644
--- a/Master/texmf-dist/source/latex/thmtools/unique.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/unique.dtx
@@ -10,31 +10,8 @@
% \fi
%
%\iffalse
-%<*driver>
-\documentclass{ltxdoc}
-\usepackage{unique}
-
-\usepackage[T1]{fontenc}
-\usepackage{fourier}
-\usepackage[scaled=0.87]{luximono, helvet}
-\newcommand\pkg{\textsf}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\GetFileInfo{unique.sty}
-\author{Ulrich M. Schwarz\thanks{ulmi at absatzen dot de}}
-\title{The \pkg{unique} package\thanks{%
- This documents \pkg{unique}~\fileversion, dated~\filedate.
- Newer versions might be found at http://absatzen.de
-}}
-\begin{document}
- \maketitle
- \DocInput{unique.dtx}
-\end{document}
-%</driver>
%<*code>
%\fi
-% \section{Usage}
% Two macros are provided: |\setuniqmark| takes a single parameter,
% the name, which should be a string of letters. |\ifuniqmark| takes
% three parameters: a name, a true-part and a false-part. The true
@@ -49,15 +26,25 @@
% fall back to numbering when you add another one.
%
% \StopEventually{}
-% \section{Implementation}
%
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{unique}[2007/07/29 v0.1 test for uniqueness (ulmi)]
+
+\DeclareOption{unq}{%
+ \newwrite\uniq@channel
+ \InputIfFileExists{\jobname.unq}{}{}%
+ \immediate\openout\uniq@channel=\jobname.unq
+ \AtEndDocument{%
+ \immediate\closeout\uniq@channel%
+ }
+}
+\DeclareOption{aux}{%
+ \let\uniq@channel\@auxout
+}
+
% \end{macrocode}
%
%
-% \iffalse $Id: unique.dtx,v 1.3 2008/03/09 18:59:17 ulmi Exp $\fi
+% \iffalse $Id: unique.dtx,v 1.4 2010/04/25 19:37:46 ulmi Exp $\fi
% \begin{macro}{\setuniqmark}
% Call this with a name to set the corresponding uniqmark. The name must
% be suitable for |\csname|-constructs, i.e. fully expansible to a
@@ -72,7 +59,7 @@
\global\@namedef{uniq@now@#1}{\uniq@ONE}%
\else
\expandafter\ifx\csname uniq@now@#1\endcsname\uniq@MANY\else
- \immediate\write\@auxout{%
+ \immediate\write\uniq@channel{%
\string\uniq@setmany{#1}%
}%
\ifuniq{#1}{%
@@ -178,6 +165,8 @@
\AtEndDocument{%
\immediate\write\@auxout{\string\uniq@maybesuggestrerun}%
}
+\ExecuteOptions{aux}
+\ProcessOptions\relax
% \end{macrocode}
%\iffalse
%</code>