diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-27 22:38:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-27 22:38:54 +0000 |
commit | 2607d53137ede06e9780342b225218743e100bb4 (patch) | |
tree | c6c88c805dd21a5bbb6ad6f26d3d53c517f4b866 /Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx | |
parent | fb0d58de45c0fc32bab09a839c186de46f75628e (diff) |
oberdiek update from tds zip (28aug06)
git-svn-id: svn://tug.org/texlive/trunk@2054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx | 86 |
1 files changed, 56 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx b/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx index 66bfb7f615c..fa95c2254a7 100644 --- a/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx @@ -8,7 +8,7 @@ % version. The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of -% LaTeX version 2003/12/01 or later. +% LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status "maintained". % @@ -29,7 +29,7 @@ % (b) Without kvoptions.ins: % tex kvoptions.dtx % (c) If you insist on using LaTeX -% latex \install=y\input{kvoptions.dtx} +% latex \let\install=y\input{kvoptions.dtx} % (quote the arguments according to the demands of your shell) % % Documentation: @@ -68,7 +68,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: kvoptions 2006/06/01 v2.2 Connects package keyval with LaTeX options (HO)} +\Msg{* Package: kvoptions 2006/08/22 v2.4 Connects package keyval with LaTeX options (HO)} \Msg{************************************************************************} \keepsilent @@ -86,7 +86,7 @@ version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of -LaTeX version 2003/12/01 or later. +LaTeX version 2005/12/01 or later. This work has the LPPL maintenance status "maintained". @@ -131,7 +131,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{kvoptions.drv}% - [2006/06/01 v2.2 Connects package keyval with LaTeX options (HO)] + [2006/08/22 v2.4 Connects package keyval with LaTeX options (HO)] \documentclass{ltxdoc} \usepackage{holtxdoc} \begin{document} @@ -140,7 +140,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{1488} +% \CheckSum{1519} % % \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 @@ -161,7 +161,7 @@ and the derived files % \GetFileInfo{kvoptions.drv} % % \title{The \xpackage{kvoptions} package} -% \date{2006/06/01 v2.2} +% \date{2006/08/22 v2.4} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -222,7 +222,7 @@ and the derived files % \begin{tabular}[t]{@{}l@{}} % \cs{DeclareVoidOption}\\ % \cs{DeclareStringOption}\\ -% \cs{DeclareBooleanOption}\\ +% \cs{DeclareBoolOption}\\ % \cs{DeclareComplementaryOption}\\ % \cs{DisableKeyvalOption} % \end{tabular} @@ -301,12 +301,12 @@ and the derived files % \rule{0pt}{1.2\ht\csname @arstrutbox\endcsname}^^A % |family| & \meta{\cs{\@currname}} & (|foobar|) % & \cs{ProcessKeyvalOptions*} \\ -% &&& \cs{DeclareBooleanOption} \\ +% &&& \cs{DeclareBoolOption} \\ % &&& \cs{DeclareStringOption} \\ % \hline % \rule{0pt}{1.2\ht\csname @arstrutbox\endcsname}^^A % |prefix| & \meta{\cs{\@currname}}|@| & (|foobar@|) -% & \cs{DeclareBooleanOption} \\ +% & \cs{DeclareBoolOption} \\ % &&& \cs{DeclareStringOption} \\ % &&& \cs{DeclareVoidOption} % \end{tabular} @@ -360,20 +360,20 @@ and the derived files % |}| % \end{quote} % -% \subsubsection{\cs{DeclareBooleanOption}} +% \subsubsection{\cs{DeclareBoolOption}} % -% \begin{declcs}{DeclareBooleanOption}\,\O{init}\,\M{key} +% \begin{declcs}{DeclareBoolOption}\,\O{init}\,\M{key} % \end{declcs} % A boolean switch is generated, initialized by value \meta{init} % and the corresponding key \meta{key} is defined. If the % initialization value is not given, |false| is used as default. % -% The internal actions of \cs{DeclareBooleanOption} are shown below. +% The internal actions of \cs{DeclareBoolOption} are shown below. % The example is given for a package author who has the following % two lines in his package/class: % \begin{quote} % |\ProvidesPackage{foobar}|\\ -% |\DeclareBooleanOption{verbose}| +% |\DeclareBoolOption{verbose}| % \end{quote} % First a new switch is created: % \begin{quote} @@ -419,7 +419,7 @@ and the derived files % The option \meta{key} shares the switch of option \meta{parent}. % Example: % \begin{quote} -% |\DeclareBooleanOption{draft}|\\ +% |\DeclareBoolOption{draft}|\\ % |\DeclareComplementaryOption{final}{draft}| % \end{quote} % Then |final| sets the switch of \xoption{draft} to |false|, and @@ -548,7 +548,7 @@ and the derived files % \begin{quote} %\begin{verbatim} %\ProvidesPackage{foobar} -%\DeclareBooleanOption{color} +%\DeclareBoolOption{color} %\DeclareStringOption[red]{emphcolor} %\ProcessKeyvalOptions* % @@ -595,7 +595,7 @@ and the derived files % \cs{DeclareStringOption} % & \prefix & holds the string\\ % \Hline -% \cs{DeclareBooleanOption} +% \cs{DeclareBoolOption} % & \cs{if}\meta{prefix}\meta{key}& boolean switch\\ % &\prefix false& disable switch\\ % &\prefix true& enable switch\\ @@ -624,7 +624,7 @@ and the derived files % Package identification % ----------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{example-mycolorsetup}[2006/06/01 Managing my colors] +\ProvidesPackage{example-mycolorsetup}[2006/08/22 Managing my colors] \RequirePackage{ifpdf} \RequirePackage{kvoptions} @@ -639,9 +639,9 @@ and the derived files % Use a shorter family name and prefix % Option print -\DeclareBooleanOption{print} +\DeclareBoolOption{print} % is the same as - % \DeclareBooleanOption[false]{print} + % \DeclareBoolOption[false]{print} % Option driver \ifpdf @@ -815,7 +815,7 @@ and the derived files % The name of this option follows the convention of packages % \xpackage{multicol}, \xpackage{tabularx}, and \xpackage{tracefnt}. % Currently it prints the setting of boolean options, declared -% by \cs{DeclareBooleanOption} in the \xfile{.log} file, if that +% by \cs{DeclareBoolOption} in the \xfile{.log} file, if that % boolean option is used. % You can activate the option by % \begin{itemize} @@ -926,7 +926,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{kvoptions} - [2006/06/01 v2.2 Connects package keyval with LaTeX options (HO)] + [2006/08/22 v2.4 Connects package keyval with LaTeX options (HO)] % \end{macrocode} % % \paragraph{External resources.} @@ -997,7 +997,7 @@ and the derived files % \end{macro} % % \begin{macro}{\KVO@prefix} -% The value settings of options, declared by \cs{DeclareBooleanOption} +% The value settings of options, declared by \cs{DeclareBoolOption} % and \cs{DeclareStringOption} need to be saved in macros. % in the first case this is a switch \cs{if}\meta{prefix}\meta{key}, % in the latter case a macro \cs{}\meta{prefix}\meta{key}. @@ -1027,9 +1027,9 @@ and the derived files % \end{macrocode} % \end{macro} % -% \subsubsection{\cs{DeclareBooleanOption}} +% \subsubsection{\cs{DeclareBoolOption}} % -% \begin{macro}{\DeclareBooleanOption} +% \begin{macro}{\DeclareBoolOption} % Usually options of boolean type can be given by the % user without value and this means a setting to \emph{true}. % We follow this convention here. Also it simplifies the @@ -1044,7 +1044,7 @@ and the derived files % the user from accidently redefining of \TeX's primitives % and other macros. % \begin{macrocode} -\newcommand*{\DeclareBooleanOption}[2][false]{% +\newcommand*{\DeclareBoolOption}[2][false]{% \KVO@ifdefinable{if\KVO@prefix#2}{% \KVO@ifdefinable{\KVO@prefix#2true}{% \KVO@ifdefinable{\KVO@prefix#2false}{% @@ -1108,7 +1108,7 @@ and the derived files \expandafter\let\csname\KVO@prefix#1true\expandafter\endcsname \csname\KVO@prefix#2false\endcsname % \end{macrocode} -% The same code part as in \cs{DeclareBooleanOption} can +% The same code part as in \cs{DeclareBoolOption} can % now be used. % \begin{macrocode} \begingroup @@ -1335,7 +1335,7 @@ and the derived files family=KVOdyn,% prefix=KVOdyn@% } -\DeclareBooleanOption[true]{global} +\DeclareBoolOption[true]{global} \DeclareComplementaryOption{local}{global} \DeclareStringOption[undef]{action} \let\KVOdyn@name\relax @@ -1849,6 +1849,24 @@ and the derived files } % \end{macrocode} % +% Variant of \cs{ExecuteOptions} that better protects \cs{CurrentOption}. +% \begin{macrocode} +\def\CurrentOption@SaveLevel{0} +\def\ExecuteOptions{% + \expandafter\KVO@ExecuteOptions + \csname CurrentOption@\CurrentOption@SaveLevel\endcsname +} +\def\KVO@ExecuteOptions#1#2{% + \let#1\CurrentOption + \edef\CurrentOption@SaveLevel{\the\numexpr\CurrentOption@SaveLevel+1}% + \@for\CurrentOption:=#2\do{% + \csname ds@\CurrentOption\endcsname + }% + \edef\CurrentOption@SaveLevel{\the\numexpr\CurrentOption@SaveLevel-1}% + \let\CurrentOption#1% +} +% \end{macrocode} +% % \begin{macrocode} \def\KVO@fileswith@pti@ns#1[#2]#3[#4]{% \ifx#1\@clsextension @@ -2162,8 +2180,6 @@ and the derived files % these. For example, \teTeX\ users run \verb|texhash| or % \verb|mktexlsr|. % -% Now the installation is complete. -% % \subsection{Some details for the interested} % % \paragraph{Attached source.} @@ -2285,6 +2301,16 @@ and the derived files % \item % Fixes for option \xoption{patch}. % \end{Version} +% \begin{Version}{2006/08/17 v2.3} +% \item +% \cs{DeclareBooleanOption} renamed to \cs{DeclareBoolOption} +% to avoid a name clash with package \cs{ifoption}. +% \end{Version} +% \begin{Version}{2006/08/22 v2.4} +% \item +% Option \xoption{patch}: \cs{ExecuteOptions} does not +% change meaning of \cs{CurrentOption} at all. +% \end{Version} % \end{History} % % \PrintIndex |