diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx | 256 |
1 files changed, 188 insertions, 68 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx b/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx index 24852f67ff1..93b11f8ea17 100644 --- a/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/kvsetkeys.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2006, 2007, 2009, 2010 by +% Copyright (C) 2006, 2007, 2009-2011 by % Heiko Oberdiek <heiko.oberdiek at googlemail.com> % % This work may be distributed and/or modified under the @@ -80,7 +80,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: kvsetkeys 2010/03/01 v1.9 Key value parser (HO)} +\Msg{* Package: kvsetkeys 2011/04/07 v1.13 Key value parser (HO)} \Msg{************************************************************************} \keepsilent @@ -91,7 +91,7 @@ This is a generated file. -Copyright (C) 2006, 2007, 2009, 2010 by +Copyright (C) 2006, 2007, 2009-2011 by Heiko Oberdiek <heiko.oberdiek at googlemail.com> This work may be distributed and/or modified under the @@ -161,7 +161,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{kvsetkeys.drv}% - [2010/03/01 v1.9 Key value parser (HO)]% + [2011/04/07 v1.13 Key value parser (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2008/08/11] \begin{document} @@ -170,7 +170,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{1135} +% \CheckSum{1265} % % \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 @@ -191,7 +191,7 @@ and the derived files % \GetFileInfo{kvsetkeys.drv} % % \title{The \xpackage{kvsetkeys} package} -% \date{2010/03/01 v1.9} +% \date{2011/04/07 v1.13} % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}} % % \maketitle @@ -334,6 +334,13 @@ and the derived files % \hspace*{1.5em}\meta{processor}\,\M{key}\,\M{value} % \end{quote} % +% \begin{declcs}{kv@break} +% \end{declcs} +% Since version 2011/03/03 v1.11 \cs{kv@break} can be +% called inside the \meta{processor} +% of \cs{kv@parse} or \cs{kv@parse@normalized}, then +% the processing is stopped and the following entries discarded. +% % \subsection{Processing key value pairs} % % \begin{declcs}{kv@processor@default}\,\M{family}\,\M{key}\,\M{value} @@ -344,7 +351,9 @@ and the derived files % \xpackage{keyval}'s \cs{setkeys}. % In case of unknown keys \cs{setkeys} raise an error. % This processer, however, calls a handler instead, if it -% is provided by the family. +% is provided by the family. Both \meta{family} and \meta{key} +% may contain package \xpackage{babel}'s shorthands +% (since 2011/04/07 v1.13). % % The behaviour in pseudo code: % \begin{quote} @@ -418,6 +427,13 @@ and the derived files % \end{quote} % Also the entry is stored in the macro \cs{comma@entry}. % +% \begin{declcs}{comma@break} +% \end{declcs} +% Since version 2011/03/03 v1.11 \cs{comma@break} can be +% called inside the \meta{processor} +% of \cs{comma@parse} or \cs{comma@parse@normalized}, then +% the processing is stopped and the following entries discarded. +% % \section{Example} % % The following example prints a short piece of HTML code using @@ -486,14 +502,18 @@ and the derived files % \end{macrocode} % Reload check, especially if the package is not used with \LaTeX. % \begin{macrocode} -\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@kvsetkeys.sty\endcsname \ifx\x\relax % plain-TeX, first loading \else @@ -501,7 +521,6 @@ and the derived files \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.}% @@ -513,24 +532,27 @@ and the derived files \aftergroup\endinput \fi \fi -\endgroup +\endgroup% % \end{macrocode} % Package identification: % \begin{macrocode} -\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 % } +\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}% @@ -549,32 +571,41 @@ and the derived files \fi \expandafter\x\csname ver@kvsetkeys.sty\endcsname \ProvidesPackage{kvsetkeys}% - [2010/03/01 v1.9 Key value parser (HO)] + [2011/04/07 v1.13 Key value parser (HO)]% % \end{macrocode} % % \begin{macrocode} -\begingroup - \catcode123 1 % { - \catcode125 2 % } +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ \def\x{\endgroup \expandafter\edef\csname KVS@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\KVS@AtEnd{% \KVS@AtEnd - \catcode#1 \the\catcode#1\relax + \catcode#1=\the\catcode#1\relax }% - \catcode#1 #2\relax + \catcode#1=#2\relax } \TMP@EnsureCode{36}{3}% $ \TMP@EnsureCode{38}{4}% & @@ -582,10 +613,12 @@ and the derived files \TMP@EnsureCode{44}{12}% , \TMP@EnsureCode{46}{12}% . \TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{61}{12}% = +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] \TMP@EnsureCode{94}{7}% ^ (superscript) \TMP@EnsureCode{96}{12}% ` \TMP@EnsureCode{126}{13}% ~ (active) +\edef\KVS@AtEnd{\KVS@AtEnd\noexpand\endinput} % \end{macrocode} % % \subsection{Package loading} @@ -593,8 +626,14 @@ and the derived files % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax - \input infwarerr.sty\relax - \input etexcmds.sty\relax + \def\TMP@RequirePackage#1[#2]{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname ver@#1.sty\endcsname\relax + \input #1.sty\relax + \fi + }% + \TMP@RequirePackage{infwarerr}[2007/09/09]% + \TMP@RequirePackage{etexcmds}[2010/01/28]% \else \RequirePackage{infwarerr}[2007/09/09]% \RequirePackage{etexcmds}[2010/01/28]% @@ -883,6 +922,7 @@ $ \expandafter\endgroup }{% \KVS@Process#1=\KVS@Nil{#3}% }% + \KVS@MaybeBreak \KVS@IfEmpty{#2}{% }{% \KVS@Parse#2\KVS@Nil{#3}% @@ -896,6 +936,7 @@ $ \expandafter\endgroup % |#3|: processor % \begin{macrocode} \long\def\KVS@Process#1=#2\KVS@Nil#3{% + \let\KVS@MaybeBreak\relax \def\kv@key{#1}% \KVS@IfEmpty{#2}{% \let\kv@value\relax @@ -922,6 +963,25 @@ $ \let\kv@value\KVS@Global } % \end{macrocode} % \end{macro} +% \begin{macro}{\KVS@MaybeBreak} +% \begin{macrocode} +\let\KVS@MaybeBreak\relax +% \end{macrocode} +% \end{macro} +% \begin{macro}{\KVS@break} +% \begin{macrocode} +\def\KVS@break#1#2#3#4{% + \let\KVS@MaybeBreak\relax +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\kv@break} +% \begin{macrocode} +\def\kv@break{% + \let\KVS@MaybeBreak\KVS@break +} +% \end{macrocode} +% \end{macro} % % \subsection{Parsing comma lists} % @@ -954,6 +1014,7 @@ $ \let\kv@value\KVS@Global \def\comma@entry{#1}% #3{#1}% }% + \KVS@MaybeBreak \KVS@IfEmpty{#2}{% }{% \KVS@CommaParse#2\KVS@Nil{#3}% @@ -961,12 +1022,32 @@ $ \let\kv@value\KVS@Global } % \end{macrocode} % \end{macro} +% \begin{macro}{\comma@break} +% \begin{macrocode} +\def\comma@break{% + \let\KVS@MaybeBreak\KVS@break +} +% \end{macrocode} +% \end{macro} % % \subsection{Processing key value pairs} % % \begin{macro}{\kv@processor@default} % \begin{macrocode} -\long\def\kv@processor@default#1#2#3{% +\def\kv@processor@default#1#2{% + \begingroup + \csname @safe@activestrue\endcsname + \let\ifincsname\iftrue + \edef\KVS@temp{\endgroup + \noexpand\KVS@ProcessorDefault{#1}{#2}% + }% + \KVS@temp +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\KVS@ProcessorDefault} +% \begin{macrocode} +\long\def\KVS@ProcessorDefault#1#2#3{% & \unless\ifcsname KV@#1@#2\endcsname $ \begingroup\expandafter\expandafter\expandafter\endgroup $ \expandafter\ifx\csname KV@#1@#2\endcsname\relax @@ -998,15 +1079,12 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax % % \begin{macro}{\kv@set@family@handler} % \begin{macrocode} -\def\kv@set@family@handler#1{% - \KVS@SetFamilyHandler{#1}\@nil -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\KVS@SetFamilyHandler} -% \begin{macrocode} -\def\KVS@SetFamilyHandler#1\@nil#{% - \expandafter\def\csname KVS@#1@handler\endcsname##1##2% +\long\def\kv@set@family@handler#1#2{% + \begingroup + \csname @safe@activestrue\endcsname + \let\ifincsname\iftrue + \expandafter\endgroup + \expandafter\def\csname KVS@#1@handler\endcsname##1##2{#2}% } % \end{macrocode} % \end{macro} @@ -1034,6 +1112,7 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax #1 key `#3'% }{% The keyval family of the key `#3' is `#2'.\MessageBreak + The setting of the key is ignored because of the error.\MessageBreak \MessageBreak \@ehc }% @@ -1052,7 +1131,7 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax % \end{macro} % % \begin{macrocode} -\KVS@AtEnd +\KVS@AtEnd% %</package> % \end{macrocode} % @@ -1116,6 +1195,22 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax \advance\count@ 1 % \repeat } +\def\RangeCatcodeCheck#1#2#3{% + \count@=#1\relax + \loop + \ifnum#3=\catcode\count@ + \else + \errmessage{% + Character \the\count@\space + with wrong catcode \the\catcode\count@\space + instead of \number#3% + }% + \fi + \ifnum\count@<#2\relax + \advance\count@ 1 % + \repeat +} +\def\space{ } \expandafter\ifx\csname LoadCommand\endcsname\relax \def\LoadCommand{\input kvsetkeys.sty\relax}% \fi @@ -1126,15 +1221,20 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax \RangeCatcodeInvalid{123}{255}% \catcode`\@=12 % \catcode`\\=0 % - \catcode`\{=1 % - \catcode`\}=2 % - \catcode`\#=6 % - \catcode`\[=12 % - \catcode`\]=12 % \catcode`\%=14 % - \catcode`\ =10 % - \catcode13=5 % \LoadCommand + \RangeCatcodeCheck{0}{36}{15}% + \RangeCatcodeCheck{37}{37}{14}% + \RangeCatcodeCheck{38}{47}{15}% + \RangeCatcodeCheck{48}{57}{12}% + \RangeCatcodeCheck{58}{63}{15}% + \RangeCatcodeCheck{64}{64}{12}% + \RangeCatcodeCheck{65}{90}{11}% + \RangeCatcodeCheck{91}{91}{15}% + \RangeCatcodeCheck{92}{92}{0}% + \RangeCatcodeCheck{93}{96}{15}% + \RangeCatcodeCheck{97}{122}{11}% + \RangeCatcodeCheck{123}{255}{15}% \RestoreCatcodes } \Test @@ -1159,7 +1259,7 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax \makeatletter \chardef\KVS@TestMode=1 % \makeatother -\usepackage{kvsetkeys}[2010/03/01] +\usepackage{kvsetkeys}[2011/04/07] %<noetex>\let\unexpanded\SavedUnexpanded \usepackage{qstest} \IncludeTests{*} @@ -1659,6 +1759,26 @@ $ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax % \item % Support of \cs{par} inside values. % \end{Version} +% \begin{Version}{2011/01/30 v1.10} +% \item +% Already loaded package files are not input in \hologo{plainTeX}. +% \end{Version} +% \begin{Version}{2011/03/03 v1.11} +% \item +% \cs{kv@break} and \cs{comma@break} added. +% \end{Version} +% \begin{Version}{2011/04/05 v1.12} +% \item +% Error message with recovery action in help message +% (request by GL). +% \end{Version} +% \begin{Version}{2011/04/07 v1.13} +% \item +% \cs{kv@processor@default} supports package \xpackage{babel}'s +% shorthands. +% \item +% \cs{kv@set@family@handler} with shorthand support. +% \end{Version} % \end{History} % % \PrintIndex |