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 --- .../texmf-dist/source/latex/thmtools/aliasctr.dtx | 4 +- .../texmf-dist/source/latex/thmtools/parseargs.dtx | 149 +++++++++++++++++ .../source/latex/thmtools/thm-autoref.dtx | 33 ++-- Master/texmf-dist/source/latex/thmtools/thm-kv.dtx | 141 +++++++++++++++-- .../source/latex/thmtools/thm-listof.dtx | 63 ++++++-- .../texmf-dist/source/latex/thmtools/thm-patch.dtx | 176 +++++++++++++++------ .../source/latex/thmtools/thm-restate.dtx | 126 +++++++++------ .../texmf-dist/source/latex/thmtools/thmtools.dtx | 82 ++++++++++ .../texmf-dist/source/latex/thmtools/thmtools.ins | 4 + Master/texmf-dist/source/latex/thmtools/unique.dtx | 52 +++--- 10 files changed, 666 insertions(+), 164 deletions(-) create mode 100644 Master/texmf-dist/source/latex/thmtools/parseargs.dtx create mode 100644 Master/texmf-dist/source/latex/thmtools/thmtools.dtx (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx b/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx index 9807e4ff2ab..bd3f1667fda 100644 --- a/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx +++ b/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx @@ -33,14 +33,14 @@ % %<*code> %\fi -% \iffalse $Id: aliasctr.dtx,v 1.2 2007/07/29 09:29:23 ulmi Exp $\fi +% \iffalse $Id: aliasctr.dtx,v 1.3 2008/03/09 18:59:17 ulmi Exp $\fi % \section{Usage} % |\@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} diff --git a/Master/texmf-dist/source/latex/thmtools/parseargs.dtx b/Master/texmf-dist/source/latex/thmtools/parseargs.dtx new file mode 100644 index 00000000000..2ce98271bf4 --- /dev/null +++ b/Master/texmf-dist/source/latex/thmtools/parseargs.dtx @@ -0,0 +1,149 @@ +% \iffalse meta-comment +% +% 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. +% The license can be obtained from +% http://www.latex-project.org/lppl/lppl-1-3a.txt +% +% \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.2 2008/06/22 12:09:33 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} +% +%<*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 +% |\@parsecmd| will pick up its arguments from the running text, not from +% the rest of \emph{spec}. When it's done storing the arguments, +% |\@parsecmd| must call |\@parse| to continue with the next element of +% \emph{spec}. The process terminates when we run out of spec. +% +% Helper macros are provided for the three usual argument types: mandatory, +% 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} +\newcommand\parse[1]{% + \@parsespec{#1\parse@endquark}\@parse} + +\newcommand\@parse{% + \edef\p@tmp{\the\@parsespec}% + \ifx\p@tmp\parse@endquark + \expandafter\@gobble + \else +% \typeout{parsespec remaining: \the\@parsespec}% + \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} +% \typeout{attemping #1#2...}% + \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}% + }% +} +% \end{macrocode} +%\iffalse +% +%\fi diff --git a/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx b/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx index d76d743db4d..d8c6ea8b4f7 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx @@ -21,11 +21,25 @@ \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} % @@ -57,23 +71,18 @@ % \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage} % \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm} % -% \newcommand\thmrestate{\textsf{thm-patch}} -% \title{The \thmrestate\ package\thanks{% -% This file documents version~\fileversion\ of~\filedate, -% RCS ${}$Id: thm-autoref.dtx,v 1.3 2008/02/17 21:08:04 ulmi Exp ulmi ${}$. -% }} -% \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}} -% -% \maketitle -% -%\begin{abstract} -%\end{abstract} %\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/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/source/latex/thmtools/thm-kv.dtx b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx index 720ca24fabb..a24ef9beefc 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-kv.dtx @@ -16,17 +16,30 @@ \usepackage[T1]{fontenc} \usepackage{fourier} \usepackage[scaled=0.8]{helvet} -\usepackage{luximono} +\usepackage[scaled]{luximono} \usepackage{amsmath, amsthm} -\usepackage{thm-patch} +\usepackage{thm-kv} \newtheorem{lemma}{Lemma} -\GetFileInfo{thm-patch.sty} +\GetFileInfo{thm-kv.sty} +\providecommand\pkg{\textsf} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} - \DocInput{thm-patch.dtx} + + \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} % %<*kv> @@ -57,24 +70,49 @@ % \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage} % \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm} % -% \newcommand\thmrestate{\textsf{thm-kv}} -% \title{The \thmrestate\ package\thanks{% -% This file documents version~\fileversion\ of~\filedate, -% RCS ${}$Id: thm-kv.dtx,v 1.4 2008/02/17 21:08:04 ulmi Exp ulmi ${}$. -% }} -% \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}} -% -% \maketitle -% -%\begin{abstract} -%\end{abstract} %\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} % +%\StopEventually{} %\section{Implementation} % \begin{macrocode} \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} @@ -94,6 +132,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}% @@ -107,6 +160,8 @@ \newcommand\declaretheorem[2][]{% + \let\thmt@theoremdefiner\thmt@original@newtheorem + \def\thmt@envname{#2}% \thmt@setthmname{\MakeUppercase #2}% \thmt@setparent{}% \thmt@setsibling{}% @@ -121,8 +176,62 @@ \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}% } % \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}% + \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. +% \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]}% + }% +% \end{macrocode} +% \subsubsection{beamer} +% Nothing yet. +% \begin{macrocode} +% \end{macrocode} %\iffalse % %\fi diff --git a/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx b/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx index ef15b1854b0..9c5f33d7f7d 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-listof.dtx @@ -21,12 +21,26 @@ \usepackage{amsmath, amsthm} \usepackage{thm-patch} \newtheorem{lemma}{Lemma} -\GetFileInfo{thm-patch.sty} +\GetFileInfo{thm-listof.sty} +\providecommand\pkg{\textsf} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} - \DocInput{thm-patch.dtx} + + \newcommand\thmlistof{\textsf{thm-listof}} + \title{The \thmlistof\ package\thanks{% + This file documents version~\fileversion\ of~\filedate, + RCS ${}$Id: thm-listof.dtx,v 1.8 2008/05/10 15:34:06 ulmi Exp ${}$. + }} + \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}} + + \maketitle + +\begin{abstract} +\end{abstract} + + \DocInput{thm-listof.dtx} \end{document} % %<*listof> @@ -57,27 +71,47 @@ % \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage} % \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm} % -% \newcommand\thmrestate{\textsf{thm-patch}} -% \title{The \thmrestate\ package\thanks{% -% This file documents version~\fileversion\ of~\filedate, -% RCS ${}$Id: thm-listof.dtx,v 1.4 2008/02/17 21:08:04 ulmi Exp ulmi ${}$. -% }} -% \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}} +%\section{Usage} +% This package provides two main commands: +% \DescribeMacro{\listoftheorems} +% |\listoftheorems| will generate, well, a list of all theorems, lemmas, +% etc. in your document. This list is hyperlinked if you use \pkg{hyperref}, +% and it will list the optional argument to the theorem. +% \DescribeMacro{\listtheoremname} +% The heading name is stored in the macro |\listtheoremname| and is +% ``List of Theorems'' by default. All other formatting aspects are taken +% from |\listoffigures|. (As a matter of fact, |\listoffigures| is called +% internally.) % -% \maketitle +% \DescribeMacro{\ignoretheorems} +% |\ignoretheorems|\marg{remark,example,...} can be used to suppress some +% types of theorem from the LoTh. Be careful not to have spaces in the list, +% those are currently \emph{not} filtered out. % -%\begin{abstract} -%\end{abstract} -%\section{Usage} +% There's currently no interface to change the look of the list. If you're +% 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}[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 @@ -99,7 +133,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/source/latex/thmtools/thm-patch.dtx b/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx index a391ad45565..babae96b14f 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-patch.dtx @@ -21,11 +21,25 @@ \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.12 2008/06/22 12:11:29 ulmi Exp ulmi ${}$. + }} + \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}} + + \maketitle + +\begin{abstract} +\end{abstract} + \DocInput{thm-patch.dtx} \end{document} % @@ -57,67 +71,119 @@ % \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage} % \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm} % -% \newcommand\thmrestate{\textsf{thm-patch}} -% \title{The \thmrestate\ package\thanks{% -% This file documents version~\fileversion\ of~\filedate, -% RCS ${}$Id: thm-patch.dtx,v 1.6 2008/02/17 21:08:04 ulmi Exp ulmi ${}$. -% }} -% \author{Ulrich M. Schwarz\thanks{ulmi@absatzen.de}} +%\section{Usage} % -% \maketitle +% 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 +% the kernel, \pkg{theorem} and \pkg{amsthm}) way. % -%\begin{abstract} -%\end{abstract} -%\section{Usage} +% \textbf{Warning:} the new |\newtheorem| is a superset of the allowed +% syntax. For example, you can give a star and both optional arguments, +% even though you cannot have an unnumbered theorem that shares a counter +% and yet has a different reset-regimen. At some point, your command is +% re-assembled and passed on to the original |\newtheorem|. This might +% complain, or give you the usual ``Missing |\begin{document}|'' that +% marks too many arguments in the preamble. % +% \DescribeMacro{\addtotheorem(pre/post)(head/foot)hook} +% A call to |\addtotheorempreheadhook|\oarg{kind}\marg{code} will +% insert the code to be executed whenever a kind theorem is opened, before +% the actual call takes place. (I.e., before the header ``Kind 1.3 (Foo)'' +% is typeset.) There are also posthooks that are executed after this header, +% and the same for the end of the environment, even though nothing +% interesting ever happens there. These are useful to put +% |\begin{shaded}|\dots |\end{shaded}| around your theorems. +% Note that foothooks are executed LIFO (last addition first) and headhooks +% are executed FIFO (first addition first). There is a special kind called +% generic that is called for all theorems. This is the default if no kind +% is given. +% +% The added code may examine |\thmt@thmname| to get the title, +% |\thmt@envname| to get the environment's name, and |\thmt@optarg| to get +% the extra optional title, if any. +% +%\StopEventually{} %\section{Implementation} % \begin{macrocode} \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 @@ -138,7 +204,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 }% } @@ -146,28 +212,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% +} + % \end{macrocode} %\iffalse % diff --git a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx index 54e8ecc7325..cc42229c1a7 100644 --- a/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx +++ b/Master/texmf-dist/source/latex/thmtools/thm-restate.dtx @@ -21,11 +21,27 @@ \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.12 2008/03/09 20:06:09 ulmi Exp ${}$. + }} + \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} % @@ -57,25 +73,12 @@ % \DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand,\RequirePackage} % \DoNotIndex{\setcounter,\setkeys,\rlap,\setminus,\widthof,\mathrm} % -% \newcommand\thmrestate{\textsf{thm-restate}} -% \title{The \thmrestate\ package\thanks{% -% This file documents version~\fileversion\ of~\filedate, -% RCS ${}$Id: thm-restate.dtx,v 1.8 2008/02/17 21:08:04 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} %\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 -%type of the theorem, i.e. if you want \verb|\begin{lemma}| to be called on -%the inside, give \verb|lemma|. The second argument is the name of the macro +%type of the theorem, i.e. if you want |\begin{lemma}| to be called on +%the inside, give |lemma|. The second argument is the name of the macro %that the text should be stored in, for example \verb|mylemma|. Be careful %not to specify existing command names! The optional argument will become the %optional argument to your theorem command. Consider the following example: @@ -93,7 +96,7 @@ % \begin{lemma} % This is some other lemma of no import. % \end{lemma} -% And now, here's Mr. Zorn again: \zornlemma +% And now, here's Mr. Zorn again: \zornlemma* % \end{document} %\end{verbatim} %which yields @@ -107,24 +110,33 @@ % \end{lemma} % Actually, we have set a label in the environment, so we know that % it's Lemma~\ref{thm:zorn} on page~\ref{thm:zorn}. -% And now, here's Mr. Zorn again: \zornlemma +% And now, here's Mr. Zorn again: \zornlemma* % Since we prevent the label from being set again, we find that % it's still Lemma~\ref{thm:zorn} on page~\ref{thm:zorn}, even though -% it occurs later also. Maybe at some point, there'll be a way to control -% which instance gets its labels executed. +% it occurs later also. +% +% \DescribeEnv{restatable*} +% As you can see, we use the starred form |\mylemma*|. As in many cases in +% \LaTeX, the star means ``don't give a number'', since we want to retain +% the original number. There is also a starred variant of the |restatable| +% environment, where the first call doesn't determine the number, but a +% later call to |\mylemma| without star would. Since the number is carried +% around using \LaTeX' |\label| machanism, you'll need a rerun for things to +% settle. % % \subsection{Restrictions} % The only counter that is saved is the one for the theorem number. So, % putting floats inside a restatable is not advised. You cannot nest -% restatables either. The first occurrence is the priviledged one that -% determines the number and the label/page info, you cannot change that -% at the moment. hyperref will get confused, too, so currently, links -% won't work. +% restatables either. You \emph{can} use the |\restatable|\dots|\endrestatable| +% version, but everything up to the next matching |\end{...}| is scooped up. +% I've also probably missed many border cases. % +% +%\StopEventually{} %\section{Implementation} % \begin{macrocode} \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 @@ -132,12 +144,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 @@ -149,28 +161,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 } % \end{macrocode} %\iffalse diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.dtx b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx new file mode 100644 index 00000000000..4869e8da834 --- /dev/null +++ b/Master/texmf-dist/source/latex/thmtools/thmtools.dtx @@ -0,0 +1,82 @@ +% \iffalse meta-comment +% +% 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. +% The license can be obtained from +% http://www.latex-project.org/lppl/lppl-1-3a.txt +% +% \fi +% +%\iffalse (hide this from DocInput) +%<*driver> +\documentclass{ltxdoc} + +\let\pkg\textsf +\def\thmtools{\pkg{thmtools}} +\def\thmversion{2008/06/22 v0.1beta6} + +\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} +\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} + + \section*{\pkg{thm-listof}} + \DocInput{thm-listof.dtx} + + \section*{\pkg{thm-patch}} + \DocInput{thm-patch.dtx} + + \section*{\pkg{aliasctr}} + \DocInput{aliasctr.dtx} + + \section*{\pkg{parseargs}} + \DocInput{parseargs.dtx} + + \section*{\pkg{unique}} + \DocInput{unique.dtx} +\end{document} +% +%<*thmtools> +%\fi +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{thmtools}[2008/06/22 v0.1beta6 Tools for theorem typesetting (ulmi)] +\RequirePackage{thm-kv, thm-autoref, thm-listof} +%\iffalse +% +%\fi diff --git a/Master/texmf-dist/source/latex/thmtools/thmtools.ins b/Master/texmf-dist/source/latex/thmtools/thmtools.ins index 2a974e839e4..388e0fbb186 100644 --- a/Master/texmf-dist/source/latex/thmtools/thmtools.ins +++ b/Master/texmf-dist/source/latex/thmtools/thmtools.ins @@ -20,11 +20,13 @@ http://www.latex-project.org/lppl/lppl-1-3a.txt \endpreamble \generate{% + \file{thmtools.sty}{\from{thmtools.dtx}{thmtools}} \file{thm-restate.sty}{\from{thm-restate.dtx}{restate}} \file{thm-patch.sty}{\from{thm-patch.dtx}{patch}} \file{thm-autoref.sty}{\from{thm-autoref.dtx}{autoref}} \file{thm-listof.sty}{\from{thm-listof.dtx}{listof}} \file{thm-kv.sty}{\from{thm-kv.dtx}{kv}} + \file{parseargs.sty}{\from{parseargs.dtx}{parseargs}} \file{aliasctr.sty}{\from{aliasctr.dtx}{code}} \file{unique.sty}{\from{unique.dtx}{code}} } @@ -33,6 +35,7 @@ http://www.latex-project.org/lppl/lppl-1-3a.txt \Msg{* To finish the installation you have to move the} \Msg{* following files into a directory searched by TeX:} \Msg{*} +\Msg{* \space\space thmtools.sty} \Msg{* \space\space thm-restate.sty} \Msg{* \space\space thm-patch.sty} \Msg{* \space\space thm-autoref.sty} @@ -40,6 +43,7 @@ http://www.latex-project.org/lppl/lppl-1-3a.txt \Msg{* \space\space thm-kv.sty} \Msg{* \space\space aliasctr.sty} \Msg{* \space\space unique.sty} +\Msg{* \space\space parseargs.sty} \Msg{*} \Msg{* Happy TeXing!} \Msg{*********************************************************} diff --git a/Master/texmf-dist/source/latex/thmtools/unique.dtx b/Master/texmf-dist/source/latex/thmtools/unique.dtx index ee045b08e40..cd60a7e8900 100644 --- a/Master/texmf-dist/source/latex/thmtools/unique.dtx +++ b/Master/texmf-dist/source/latex/thmtools/unique.dtx @@ -1,33 +1,11 @@ % \iffalse meta-comment % -% Copyright (C) 2005-7 by Ulrich M. Schwarz -% -%Redistribution and use in source and binary forms, with or without -%modification, are permitted provided that the following conditions -%are met: -%1. Redistributions of source code must retain the above copyright -% notice, this list of conditions and the following disclaimer. -%2. Redistributions in binary form must reproduce the above copyright -% notice, this list of conditions and the following disclaimer in the -% documentation and/or other materials provided with the distribution. -%3. All advertising materials mentioning features or use of this software -% must display the following acknowledgement: -% This product includes software developed by Ulrich M. Schwarz -%4. Neither the name of the author nor the names of his contributors -% may be used to endorse or promote products derived from this software -% without specific prior written permission. -% -%THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -%INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -%FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -%AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -%OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -%SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -%INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -%CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -%ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -%POSSIBILITY OF SUCH DAMAGE. +% Copyright (C) 2005-8 by Ulrich M. Schwarz % +% This file may be distributed and/or modified under the conditions of +% the LaTeX Project Public License, version 1.3a. +% The license can be obtained from +% http://www.latex-project.org/lppl/lppl-1-3a.txt % % \fi % @@ -56,14 +34,30 @@ % %<*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 +% part is executed if and only if there was exactly one call to +% |\setuniqmark| with the given name during the previous \LaTeX\ run. +% +% Example application: legal documents are often very strongly numbered. +% However, if a section has only a single paragraph, this paragraph is +% not numbered separately, this only occurs from two paragraphs onwards. +% +% It's also possible to not-number the single theorem in your paper, but +% 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)] % \end{macrocode} % -% \section{Implementation and Usage} % -% \iffalse $Id: unique.dtx,v 1.2 2008/02/10 10:23:32 ulmi Exp $\fi +% \iffalse $Id: unique.dtx,v 1.3 2008/03/09 18:59:17 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 -- cgit v1.2.3