diff options
author | Karl Berry <karl@freefriends.org> | 2009-07-21 22:31:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-07-21 22:31:18 +0000 |
commit | becf9bfec772c5af4610a0dc6f6840cdc2e6627a (patch) | |
tree | 084c959153bbb923eed65327eeb0ed9574c63803 /Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx | |
parent | a2fd4ec211630f47a2a28ef4ced1e05b2a528fc2 (diff) |
oberdiek update (22jul09)
git-svn-id: svn://tug.org/texlive/trunk@14365 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 | 124 |
1 files changed, 114 insertions, 10 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx b/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx index a4b97417ec9..b4d0fd44084 100644 --- a/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/kvoptions.dtx @@ -73,7 +73,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: kvoptions 2009/04/10 v3.1 Keyval support for LaTeX options (HO)} +\Msg{* Package: kvoptions 2009/07/17 v3.2 Keyval support for LaTeX options (HO)} \Msg{************************************************************************} \keepsilent @@ -148,7 +148,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{kvoptions.drv}% - [2009/04/10 v3.1 Keyval support for LaTeX options (HO)]% + [2009/07/17 v3.2 Keyval support for LaTeX options (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2008/08/11] \begin{document} @@ -157,7 +157,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{1991} +% \CheckSum{2103} % % \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 @@ -178,7 +178,7 @@ and the derived files % \GetFileInfo{kvoptions.drv} % % \title{The \xpackage{kvoptions} package} -% \date{2009/04/10 v3.1} +% \date{2009/07/17 v3.2} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -295,6 +295,17 @@ and the derived files % knows the family name already and you can use the star form % without mandatory argument. % +% \subsubsection{\cs{ProcessLocalKeyvalOptions}} +% +% \begin{declcs}{ProcessLocalKeyvalOptions}\,\M{family}\\ +% \cs{ProcessLocalKeyvalOptions} \* +% \end{declcs} +% This macro has the same syntax and works similar as +% \cs{ProcessKeyvalOptions}. However it ignores +% global options and only processes the local package options. +% Therefore it only can be used inside a package. +% An error is thrown, if it is used inside a class. +% % Neither of the following macros are necessary for % \cs{ProcessKeyvalOptions{}}. They just help the package/class % author in common tasks. @@ -654,7 +665,7 @@ and the derived files % Package identification % ----------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{example-mycolorsetup}[2009/04/10 Managing my colors] +\ProvidesPackage{example-mycolorsetup}[2009/07/17 Managing my colors] \RequirePackage{ifpdf} \RequirePackage{kvoptions} @@ -1028,7 +1039,7 @@ and the derived files \fi \expandafter\x\csname ver@kvoptions.sty\endcsname \ProvidesPackage{kvoptions}% - [2009/04/10 v3.1 Keyval support for LaTeX options (HO)] + [2009/07/17 v3.2 Keyval support for LaTeX options (HO)] % \end{macrocode} % % \paragraph{Catcodes} @@ -1122,7 +1133,7 @@ and the derived files % \begin{macrocode} \DeclareOption{patch}{% \AtEndOfPackage{% - \RequirePackage{kvoptions-patch}[2009/04/10]% + \RequirePackage{kvoptions-patch}[2009/07/17]% }% } % \end{macrocode} @@ -1555,11 +1566,11 @@ and the derived files \ifKVOdyn@global\global\fi \let \expandafter\noexpand\csname KV@#1@#2\endcsname - \@gobble + \noexpand\@gobble \ifKVOdyn@global\global\fi \let \expandafter\noexpand\csname KV@#1@#2@default\endcsname - \@empty + \noexpand\@empty }% ^^A\PackageInfo{kvoptions}{% ^^A [option] key `#2' of family `#1'\MessageBreak @@ -1785,6 +1796,92 @@ and the derived files } % \end{macrocode} % +% \subsection{\cs{ProcessLocalKeyvalOptions}} +% +% \begin{macro}{\ProcessLocalKeyvalOptions} +% If the optional star is given, we get the family +% name and expand it for safety. +% \begin{macrocode} +\newcommand*{\ProcessLocalKeyvalOptions}{% + \@ifstar{% + \begingroup + \edef\x{\endgroup + \noexpand\KVO@ProcessLocalKeyvalOptions{\KVO@family}% + }% + \x + }% + \KVO@ProcessLocalKeyvalOptions +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\KVO@ProcessLocalKeyvalOptions#1{% + \let\@tempc\relax + \let\KVO@temp\@empty +% \end{macrocode} +% Check if \cs{ProcessLocalKeyvalOptions} is called inside +% a package. +% \begin{macrocode} + \ifx\@currext\@pkgextension + \else + \PackageError{kvoptions}{% + \string\ProcessLocalKeyvalOptions is intended for packages only% + }\@ehc + \fi +% \end{macrocode} +% The package options are put into toks register \cs{toks@}. +% \begin{macrocode} + \begingroup + \toks\tw@{}% + \@ifundefined{opt@\@currname.\@currext}{% + \toks@\expandafter{\KVO@temp}% + }{% + \toks@\expandafter\expandafter\expandafter{% + \csname opt@\@currname.\@currext\endcsname + }% +% \end{macrocode} +% Without default action we pass all options to \cs{setkeys}. +% Otherwise we have to check which options are known. +% These are passed to \cs{setkeys}. For the others the default +% action is performed. +% \begin{macrocode} + \@ifundefined{KVO@default@\@currname.\@currext}{% + \toks@\expandafter\expandafter\expandafter{% + \expandafter\KVO@temp\the\toks@ + }% + }{% + \edef\CurrentOption{\the\toks@}% + \toks@\expandafter{\KVO@temp}% + \@for\CurrentOption:=\CurrentOption\do{% + \@ifundefined{% + KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil + }{% + \toks\tw@\expandafter{% + \the\toks\expandafter\tw@\expandafter,\CurrentOption + }% + }{% + \toks@\expandafter{% + \the\expandafter\toks@\expandafter,\CurrentOption + }% + }% + }% + }% + \fi + }% + \edef\KVO@temp{\endgroup + \noexpand\KVO@calldefault{\the\toks\tw@}% + \noexpand\setkeys{#1}{\the\toks@}% + }% + \KVO@temp +% \end{macrocode} +% Some cleanup of \cs{ProcessOptions}. +% \begin{macrocode} + \let\CurrentOption\@empty + \AtEndOfPackage{\let\@unprocessedoptions\relax}% +} +% \end{macrocode} +% % \subsubsection{Helper macros} % % \begin{macro}{\KVO@getkey} @@ -1905,7 +2002,7 @@ and the derived files \noexpand\endinput } \ProvidesPackage{kvoptions-patch}% - [2009/04/10 v3.1 LaTeX patch for keyval options (HO)]% + [2009/07/17 v3.2 LaTeX patch for keyval options (HO)]% % \end{macrocode} % % Check for \eTeX. @@ -2849,6 +2946,13 @@ and the derived files % \item % Space by line end removed in definition of internal macro. % \end{Version} +% \begin{Version}{2009/07/17 v3.2} +% \item +% \cs{ProcessLocalKeyvalOptions} added. +% \item +% \cs{DisableKeyvalOption} with the \texttt{action=ignore} option +% fixed (Joseph Wright). +% \end{Version} % \end{History} % % \PrintIndex |