diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/kvoptions.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/kvoptions.sty | 153 |
1 files changed, 90 insertions, 63 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/kvoptions.sty b/Master/texmf-dist/tex/latex/oberdiek/kvoptions.sty index 5ba1a34682a..bf0eecf4b0a 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/kvoptions.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/kvoptions.sty @@ -30,19 +30,24 @@ %% kvoptions.sty, kvoptions.pdf, kvoptions.ins, kvoptions.drv, %% kvoptions-patch.sty, example-mycolorsetup.sty, %% kvoptions-test1.tex, kvoptions-test2.tex, -%% kvoptions-test3.tex. +%% kvoptions-test3.tex, kvoptions-test4.tex, +%% kvoptions-test4.sty. %% %% No we don't need the option 'color'. %% With color support option 'emphcolor' will dynamically %% change the color of \emph statements. -\begingroup - \catcode44 12 % , - \catcode45 12 % - - \catcode46 12 % . - \catcode58 12 % : - \catcode64 11 % @ - \catcode123 1 % { - \catcode125 2 % } +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \catcode64=11 % @ + \catcode123=1 % { + \catcode125=2 % } \expandafter\let\expandafter\x\csname ver@kvoptions.sty\endcsname \ifx\x\relax % plain-TeX, first loading \else @@ -50,7 +55,6 @@ \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \else - \catcode35 6 % # \expandafter\ifx\csname PackageInfo\endcsname\relax \def\x#1#2{% \immediate\write-1{Package #1 Info: #2.}% @@ -62,21 +66,24 @@ \aftergroup\endinput \fi \fi -\endgroup -\begingroup - \catcode35 6 % # - \catcode40 12 % ( - \catcode41 12 % ) - \catcode44 12 % , - \catcode45 12 % - - \catcode46 12 % . - \catcode47 12 % / - \catcode58 12 % : - \catcode64 11 % @ - \catcode91 12 % [ - \catcode93 12 % ] - \catcode123 1 % { - \catcode125 2 % } +\endgroup% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode40=12 % ( + \catcode41=12 % ) + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode47=12 % / + \catcode58=12 % : + \catcode64=11 % @ + \catcode91=12 % [ + \catcode93=12 % ] + \catcode123=1 % { + \catcode125=2 % } \expandafter\ifx\csname ProvidesPackage\endcsname\relax \def\x#1#2#3[#4]{\endgroup \immediate\write-1{Package: #3 #4}% @@ -95,29 +102,38 @@ \fi \expandafter\x\csname ver@kvoptions.sty\endcsname \ProvidesPackage{kvoptions}% - [2010/02/22 v3.7 Keyval support for LaTeX options (HO)] -\begingroup - \catcode123 1 % { - \catcode125 2 % } + [2010/12/23 v3.10 Keyval support for LaTeX options (HO)]% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ \def\x{\endgroup \expandafter\edef\csname KVO@AtEnd\endcsname{% - \catcode35 \the\catcode35\relax - \catcode64 \the\catcode64\relax - \catcode123 \the\catcode123\relax - \catcode125 \the\catcode125\relax + \endlinechar=\the\endlinechar\relax + \catcode13=\the\catcode13\relax + \catcode32=\the\catcode32\relax + \catcode35=\the\catcode35\relax + \catcode61=\the\catcode61\relax + \catcode64=\the\catcode64\relax + \catcode123=\the\catcode123\relax + \catcode125=\the\catcode125\relax }% }% -\x -\catcode35 6 % # -\catcode64 11 % @ -\catcode123 1 % { -\catcode125 2 % } +\x\catcode61\catcode48\catcode32=10\relax% +\catcode13=5 % ^^M +\endlinechar=13 % +\catcode35=6 % # +\catcode64=11 % @ +\catcode123=1 % { +\catcode125=2 % } \def\TMP@EnsureCode#1#2{% \edef\KVO@AtEnd{% \KVO@AtEnd - \catcode#1 \the\catcode#1\relax + \catcode#1=\the\catcode#1\relax }% - \catcode#1 #2\relax + \catcode#1=#2\relax } \TMP@EnsureCode{1}{14}% ^^A (comment) \TMP@EnsureCode{2}{14}% ^^A (comment) @@ -131,22 +147,17 @@ \TMP@EnsureCode{46}{12}% . \TMP@EnsureCode{47}{12}% / \TMP@EnsureCode{58}{12}% : -\TMP@EnsureCode{61}{12}% = \TMP@EnsureCode{62}{12}% > +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] \TMP@EnsureCode{94}{7}% ^ (superscript) \TMP@EnsureCode{96}{12}% ` +\edef\KVO@AtEnd{\KVO@AtEnd\noexpand\endinput} \@ifundefined{define@key}{% \RequirePackage{keyval}\relax }{} +\RequirePackage{ltxcmds}[2010/12/02] \RequirePackage{kvsetkeys}[2007/09/29] -\@ifundefined{@onelevel@sanitize}{% - \def\@onelevel@sanitize#1{% - \edef#1{\expandafter\strip@prefix\meaning#1}% - }% -}{} -\@ifundefined{strip@prefix}{% - \def\strip@prefix#1>{}% -}{} \@ifundefined{@x@protect}{% \def\@x@protect#1\fi#2#3{% \fi\protect#1% @@ -162,7 +173,7 @@ \DeclareOption{debugshow}{\catcode\@ne=9 } \DeclareOption{patch}{% \AtEndOfPackage{% - \RequirePackage{kvoptions-patch}[2010/02/22]% + \RequirePackage{kvoptions-patch}[2010/12/23]% }% } \ProcessOptions\relax @@ -182,14 +193,25 @@ \@currname.\@currext\endcsname{#1}% } \def\KVO@prefix{% - \@ifundefined{KVO@prefix@\@currname.\@currext}{% + \ltx@ifundefined{KVO@prefix@\@currname.\@currext}{% \@currname @% }{% \csname KVO@prefix@\@currname.\@currext\endcsname }% } +\define@key{KVO}{setkeys}{% + \expandafter\def\csname KVO@setkeys@% + \@currname.\@currext\endcsname{#1}% +} +\def\KVO@setkeys{% + \ltx@IfUndefined{KVO@setkeys@\@currname.\@currext}{% + \setkeys + }{% + \csname KVO@setkeys@\@currname.\@currext\endcsname + }% +} \newcommand*{\SetupKeyvalOptions}{% - \setkeys{KVO}% + \kvsetkeys{KVO}% } \newcommand*{\DeclareBoolOption}[2][false]{% \KVO@ifdefinable{if\KVO@prefix#2}{% @@ -268,7 +290,7 @@ } \def\KVO@boolkey#1#2#3#4#5{% \edef\KVO@param{#5}% - \@onelevel@sanitize\KVO@param + \ltx@onelevel@sanitize\KVO@param \ifx\KVO@param\KVO@true \expandafter\@firstofone \else @@ -299,8 +321,8 @@ } \def\KVO@true{true} \def\KVO@false{false} -\@onelevel@sanitize\KVO@true -\@onelevel@sanitize\KVO@false +\ltx@onelevel@sanitize\KVO@true +\ltx@onelevel@sanitize\KVO@false \newcommand*{\DeclareStringOption}[2][]{% \@ifnextchar[{% \KVO@DeclareStringOption{#1}{#2}@% @@ -337,7 +359,7 @@ \x }% } -\newcommand*{\DeclareVoidOption}[1]{% +\newcommand*{\DeclareVoidOption}[2]{% \begingroup \let\next\@gobbletwo \KVO@ifdefinable{\KVO@prefix#1}{% @@ -360,7 +382,12 @@ }% }% \x - \@namedef{\KVO@prefix#1}% + \begingroup + \toks@{#2}% + \expandafter\endgroup + \expandafter\def + \csname\KVO@prefix#1\expandafter\endcsname + \expandafter{\the\toks@}% }% } \def\KVO@VOID@{@VOID@} @@ -416,7 +443,7 @@ } \newcommand*{\DisableKeyvalOption}[3][]{% \begingroup - \setkeys{KVOdyn}{#1}% + \kvsetkeys{KVOdyn}{#1}% \def\x{\endgroup}% \@ifundefined{KVO@action@\KVOdyn@action}{% \PackageError{kvoptions}{% @@ -590,7 +617,7 @@ }% ,% }% - \@onelevel@sanitize\KVO@CurrentOption + \ltx@onelevel@sanitize\KVO@CurrentOption \else \edef\KVO@temp{% \KVO@temp @@ -623,7 +650,7 @@ }{% \@ifundefined{KVO@default@\@currname.\@currext}{% \ifx\KVO@Patch Y% - \@onelevel@sanitize\CurrentOption + \ltx@onelevel@sanitize\CurrentOption \fi \ifx\@unusedoptionlist\@empty \global\let\@unusedoptionlist\CurrentOption @@ -672,7 +699,7 @@ }% \edef\KVO@temp{\endgroup \noexpand\KVO@calldefault{\the\toks\tw@}% - \noexpand\setkeys{#1}{\the\toks@}% + \noexpand\KVO@setkeys{#1}{\the\toks@}% }% \KVO@temp \let\CurrentOption\@empty @@ -729,7 +756,7 @@ }% \edef\KVO@temp{\endgroup \noexpand\KVO@calldefault{\the\toks\tw@}% - \noexpand\setkeys{#1}{\the\toks@}% + \noexpand\KVO@setkeys{#1}{\the\toks@}% }% \KVO@temp \let\CurrentOption\@empty @@ -770,7 +797,7 @@ \@ifstar{}\@gobble }% \fi -\KVO@AtEnd +\KVO@AtEnd% \endinput %% %% End of file `kvoptions.sty'. |