diff options
author | Karl Berry <karl@freefriends.org> | 2012-11-22 23:36:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-11-22 23:36:05 +0000 |
commit | 6348770c313c5104acd5b60d68377af2621c9a2d (patch) | |
tree | 2ea0217daba84f82e5c145bcd667f47be6e9e466 /Master/texmf-dist/tex/latex/ltxkeys | |
parent | fc2a68380059c28818ca479985c96b7d4af1dca4 (diff) |
ltxkeys (22nov12)
git-svn-id: svn://tug.org/texlive/trunk@28332 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ltxkeys')
-rw-r--r-- | Master/texmf-dist/tex/latex/ltxkeys/ltxkeys.sty | 630 |
1 files changed, 348 insertions, 282 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxkeys/ltxkeys.sty b/Master/texmf-dist/tex/latex/ltxkeys/ltxkeys.sty index 4a1efbd718e..8109dd19a35 100644 --- a/Master/texmf-dist/tex/latex/ltxkeys/ltxkeys.sty +++ b/Master/texmf-dist/tex/latex/ltxkeys/ltxkeys.sty @@ -1,5 +1,5 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'ltxkeys.sty', version 0.0.3b, October 14, 2012. % +% This is file 'ltxkeys.sty', version 0.0.3c, 2012/11/17. % % % % This package and accompanying files may be distributed and/or % % modified under the conditions of the LaTeX Project Public License, % @@ -21,7 +21,7 @@ \@ifpackageloaded{catoptions}{% \@ifpackagelater{catoptions}{2012/10/14}{}{% \@latex@error{Loaded version of catoptions package is - not current}\@ehc + not current}\@ehd }% }{% \RequirePackage{catoptions}[2012/10/14]% @@ -29,24 +29,24 @@ \UseNormalCatcodes \StyleFilePurpose{A robust key-value parser (AM)} \StyleFileRCSInfo -$Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ +$Id: ltxkeys.sty,v 0.0.3c 2012/11/17 09:00:00 Ahmed Musa Exp $ \ProvidesPackage{ltxkeys}[\StyleFileInfo] \NeedsTeXFormat{LaTeX2e}[2011/06/27] \SetStyleFileMessages[ltxkeys@]{info}{warn}{err} \cpt@setupsafeactivesedef -\catcode`\&=3 -\new@def\ltxkeys@afterfi#1\ltxkeys@fi{\fi#1} -\new@def\ltxkeys@after@i#1\ltxkeys@else#2\ltxkeys@fi{\fi#1} -\new@def\ltxkeys@after@ii#1\ltxkeys@else#2\ltxkeys@fi{\fi#2} -\newletcs\ltxkeys@else\else -\newletcs\ltxkeys@fi\fi -\new@def*\ltxkeys@ehc{% +\catcode`\&=3\relax +\new@def\ltxkeys@afterfi#1\fi{\fi#1} +\new@def\ltxkeys@afterelsei#1\else#2\fi{\fi#1} +\new@def\ltxkeys@afterelseii#1\else#2\fi{\fi#2} +\new@def*\ltxkeys@ehd{% \ifx\protect\string\ltxkeys@afterfi A serious error has occurred.\MsgBrk Try typing <return>\space to proceed.\MsgBrk If that fails, type X and then <return>\space to quit. - \ltxkeys@fi + \fi } +\new@def*\ltxkeys@truetoks{true} +\new@def*\ltxkeys@falsetoks{false} \robust@def*\ltxkeys@specialhandler{% \cpt@testopt\ltxkeys@sp@cialhandler{}% } @@ -61,7 +61,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \new@def*\ltxkeys@quark{\@gobble\ltxkeys@quark} \new@def*\ltxkeys@antiquark{\@gobble\ltxkeys@antiquark} \new@def*\ltxkeys@cdr#1#2\ltxkeys@nil{#2} -\new@def*\ltxkeys@spcdr#1#2\ltxkeys@nil{\detokenize{#2}} +\new@def*\ltxkeys@spcdr#1#2#3\ltxkeys@nil{\detokenize{#2}} \new@def\ltxkeys@ifxFT#1#2{\ltxkeys@ifxTF{#1}{#2}\cptiiofii\cptiofii} \new@def\ltxkeys@ifxTF#1#2{% \expandafter\cptswap\cpt@car#1\ltxkeys@quark\car@nil @@ -87,7 +87,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@d@bug#1#2{% \wlog{\ifcpt@st^^J\fi ltxkeys debug [#1] #2.}% } -\cptnewvariables{if}[ltxkeys@]{break,st,pl,cl,sw,sv,nv,noval,pxop,exop, +\cptnewvariables{if}[ltxkeys@]{break,st,pl,cl,sw,sv,nv,novalue,pxop,exop, preset,disable,ini,kf,rm,ssk,dec,dep,twk,tracingkeys,useempty,chdef, swa,reservenopath,global,protected,inkeycmd}[false] \cptnewvariables{if}{inputvalid}[false] @@ -153,6 +153,14 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% } +\robust@def*\ltxkeys@striplaststar#1*\@empty#2\ltxkeys@nil#3{\edef#3{#1}} +\robust@def*\ltxkeys@ifrejname#1{% + \ifcase0\ifx\key@type\ltxkeys@rej1\else + \ifx\key@name\ltxkeys@rej1\fi\fi\relax + \else + #1% + \fi +} \robust@def*\ltxkeys@testst#1{% \cpt@ifstar{\ltxkeys@sttrue#1}{\ltxkeys@stfalse#1}% } @@ -175,27 +183,28 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ } \robust@def\ltxkeys@trimspaces#1#2{% \begingroup - \ifcase\if.\ltxkeys@spcdr#2.0\ltxkeys@nil\else1\fi - \if\expandafter\cpt@car\string#2\car@nil - \@backslashchar0\else1\fi\relax\else - \ltxkeys@err{'\detokenize{#2}' has illegal form}\ltxkeys@ehc + \ifcase0% + % 1. When #2 of \ltxkeys@trimspaces is empty token, #1, #2, #3 of + % \ltxkeys@spcdr will be '.', 'x', <empty>. + % 2. No one will give #2 of \ltxkeys@trimspaces as a dot (.). So + % the test is fairly robust. + \if.\ltxkeys@spcdr#2.x\ltxkeys@nil\else1\fi + \if\expandafter\cpt@car\string#2\car@nil\@backslashchar\else1\fi\relax + \else + \ltxkeys@err{'\detokenize{#2}' has illegal form}\ltxkeys@ehd \fi \ltxkeys@tr@mspaces{#1}{#2}% } -\long\def\ltxkeys@tr@mspaces#1#2{% - \edef\trimmed{% - \expandcsonce{\romannumeral-`\q\ltxkeys@trimspace.#1& &}% - }% - \ltxkeys@ifxTF#2\trimmed{% +\robust@def\ltxkeys@tr@mspaces#1#2{% + \edef\ltxkeys@trimmed{\cpttrimspace{#1}}% + \ltxkeys@ifxTF#2\ltxkeys@trimmed{% \expandafter\endgroup\expandafter\edef\expandafter #2\expandafter{\expandafter\unexpanded\expandafter{#2}}% }{% - \let#2=\trimmed + \let#2=\ltxkeys@trimmed \expandafter\ltxkeys@tr@mspaces\expandafter{#2}#2% }% } -\long\def\ltxkeys@trimspace#1 &{\ltxkeys@tr@mspace#1&} -\long\def\ltxkeys@tr@mspace#1{\expandafter\noexpand\@gobble#1} \robust@def*\ltxkeys@trimspacesset#1{% \def\@do##1##2,{% \ifnot@nil{##1}{\ltxkeys@trimspaces{##1}##2\@do}% @@ -225,7 +234,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@splita##1/##2/{% \ltxkeys@trimspacesset{{##1}\key@type,{##2}\key@name}% \ltxkeys@ifrejname{% - \ltxkeys@err{Wrong syntax for attributes of a key}\ltxkeys@ehc + \ltxkeys@err{Wrong syntax for attributes of a key}\ltxkeys@ehd }% \ltxkeys@splitb.% }% @@ -234,8 +243,8 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@splitc.% }% \def\ltxkeys@splitc##1/{% - \edef\key@macro{\unexpanded\expandafter{\@gobble##1}}% - \ltxkeys@stripdotcode\key@macro + \edef\key@callback{\unexpanded\expandafter{\@gobble##1}}% + \ltxkeys@stripdotcode\key@callback \ltxkeys@splitd.% }% \def\ltxkeys@splitd##1/##2\ltxkeys@nil{% @@ -244,7 +253,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@splita#1/^?^/^?^/^?^/^?^/^?^/\ltxkeys@nil \let\do\cpt@csexit \cptexpanded{\endgroup - \do\key@type\do\key@name\do\key@default\do\key@macro + \do\key@type\do\key@name\do\key@default\do\key@callback \do\key@dependants }% } @@ -303,7 +312,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifdefboolTF{cpt@choicefd} {\noexpand\@secondoftwo}{\noexpand\@firstoftwo}% \else - \ltxkeys@err{Invalid number '#1'}\ltxkeys@ehc + \ltxkeys@err{Invalid number '#1'}\ltxkeys@ehd \fi }% } @@ -375,7 +384,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \advance\@tempcnta\@ne }% - \ltxkeys@parse*1[;]\ltxkeys@tempa + \ltxkeys@listparse*1[;]\ltxkeys@tempa \endtoksgroup } \robust@def*\ltxkeys@ifeltcountTF{\cpt@teststopt\ltxkeys@ifeltcount,} @@ -389,7 +398,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@do##1{% \cptpushnumber\eltnum }% - \expandafter\ltxkeys@parse\reserved@a1[#1]{#4}% + \expandafter\ltxkeys@listparse\reserved@a1[#1]{#4}% \aftercsname\endgroup{@\ifnum\eltnum#2\numexpr#3% first\else second\fi oftwo}% } @@ -430,25 +439,25 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% } -\provide@def\all@to@endif#1\endif{#1} -\provide@def\first@to@endif#1#2\endif{#1} +\new@def\ltxkeys@alltoendif#1\endif{#1} +\new@def\ltxkeys@firsttoendif#1#2\endif{#1} \new@def*\ltxkeys@ifcassenumcmpTF#1#2#3{% \ifdim#1pt#2pt % \expandafter\cptiofii\else\expandafter\cptiiofii\fi } \new@def\ltxkeys@ifcasse#1{% \ifstrcmpTF{#1}\elseif{% - \all@to@endif + \ltxkeys@alltoendif }{% \ifstrcmpTF{#1}\endif{}{\ltxkeys@ifcasse@a{#1}}% }% } \new@def\ltxkeys@ifcasse@a#1#2{% \ifstrcmpTF{#2}\elseif{% - \all@to@endif + \ltxkeys@alltoendif }{% \ifstrcmpTF{#2}\endif{}{% - \ltxkeystestcmd{#1}{#2}\first@to@endif{\ltxkeys@ifcasse@b{#1}}% + \ltxkeystestcmd{#1}{#2}\ltxkeys@firsttoendif{\ltxkeys@ifcasse@b{#1}}% }% }% } @@ -493,7 +502,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \s@expandarg\ltxkeys@remove@b#3% }% - \ltxkeys@parse1[##1]{#4}% + \ltxkeys@listparse1[##1]{#4}% \csv@@normalize*[##1]#3% }% \s@expandarg\ltxkeys@remove@a{\detk{#1}}% @@ -643,7 +652,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \cptpushnumber#2% }% }% - \cptexpandsecond{\ltxkeys@parse0}{[\ltxkeys@ccparser]}{#4}% + \cptexpandsecond{\ltxkeys@listparse0}{[\ltxkeys@ccparser]}{#4}% \cptpassexpanded{% \endgroup \cpt@csexit\ltxkeys@userinput @@ -665,7 +674,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ } \robust@def*\ltxkeys@nomatcherr{% \ltxkeys@error{User input '\ltxkeys@userinput' not in list - of nominations ||\ltxkeys@nominations||}\ltxkeys@ehc + of nominations ||\ltxkeys@nominations||}\ltxkeys@ehd } \robust@def*\ltxkeys@ifoneincsvlist{\cpt@teststopt\ltxkeys@ifoneincsvl@st,} \robust@def*\ltxkeys@ifoneincsvl@st[#1]#2#3{% @@ -709,7 +718,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ifnum\cpt@cnta>\numexpr#2-1\relax\loopbreak\fi }% - \ltxkeys@parse*1[#1]\ltxkeys@tempa + \ltxkeys@listparse*1[#1]\ltxkeys@tempa \ifnum\cpt@cnta>\numexpr#2-1\relax \edef\ltxkeys@nritems{\the\cpt@cnta}% \else @@ -795,7 +804,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{}% \ifnum\cpt@cnta>\numexpr#1-1\relax\loopbreak\fi }% - \ltxkeys@parse*1\ltxkeys@tempa + \ltxkeys@listparse*1\ltxkeys@tempa \ifnum\cpt@cnta>\numexpr#1-1\relax \edef\ltxkeys@nritems{\the\cpt@cnta}% \else @@ -816,9 +825,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ only in style files.}% }% } -\robust@def*\ltxkeys@commanormalize#1#2{% - \edef#2{\cptcommanormalize{#1}}% -} +\robust@def*\ltxkeys@commanormalize#1#2{\edef#2{\cptcommanormalize{#1}}} \robust@def*\ltxkeys@commanormalizeset{% \let\normelt\ltxkeys@commanormalize \ltxkeys@normalizeset @@ -839,9 +846,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \expandafter\@do\reserved@a,\@nil,% \undefcs\normelt } -\robust@def*\ltxkeys@normalizecsset{% - \cpt@testopt\ltxkeys@n@rmalizecsset,% -} +\robust@def*\ltxkeys@normalizecsset{\cpt@testopt\ltxkeys@n@rmalizecsset,} \robust@def*\ltxkeys@n@rmalizecsset[#1]#2{% \cptfor#2\dofor{\csv@@normalize[#1]##1}% } @@ -857,12 +862,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\elta##1{\noexpandcsn{\cptgobblescape#1@list@##1}}% \def\eltb##1{\cptexpandnext{\elta{b}##1}{########1}% #2\ltxkeys@parser@nil#2?{}}% - \def\eltc{\ltxkeys@ifxTF!\unexpanded{{####1}{####4}% - {\unexpanded{####4}}}}% + \def\eltc{\ltxkeys@ifxTF!\unexpanded{{####1}{####4}{\unexpanded{####4}}}}% \cptexpanded{\endgroup - \def#1####1{% - \ifstrcmpTF!{####1}{\elta{a}}{\eltb+}% - }% + \def#1####1{\ifstrcmpTF!{####1}{\elta{a}}{\eltb+}}% \def\elta{a}####1{\eltb!}% \def\elta{b}####1####2#2####3?####4####5{% \ltxkeys@ifxTF\ltxkeys@parser@nil{####2}{\eltc}{% @@ -875,8 +877,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ } \endgroup -\robust@def*\ltxkeys@parse{\cpt@testst\ltxkeys@parse@a} -\robust@def*\ltxkeys@parse@a#1{% +% Break out of the loop using \loopbreak. +\robust@def*\ltxkeys@listparse{\cpt@testst\ltxkeys@listparse@a} +\robust@def*\ltxkeys@listparse@a#1{% \begingroup \def\reserved@a##1##2{\endgroup \def\ltxkeys@nlz{##1}\def\ltxkeys@inkv{##2}% @@ -884,38 +887,40 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \cptexpandsecond\reserved@a{% \ifcase#1{01}{01}\or{00}{01}\or{01}{00}\or{00}{00}\else{01}{01}\fi }% - \cpt@testopt\ltxkeys@parse@b,% + \cpt@testopt\ltxkeys@listparse@b,% } -\robust@def*\ltxkeys@parse@b[#1]#2{% - \cpt@stchoose{cpt@st}{#2}\ltxkeys@arg\ltxkeys@parse - \cptpushfunctions\ltxkeys@parse{% +\robust@def*\ltxkeys@listparse@b[#1]#2{% + \cpt@stchoose{cpt@st}{#2}\ltxkeys@listitem\ltxkeys@listparse + \cptpushfunctions\ltxkeys@listparse{% \\\ifloopbreak\\\ifltxkeys@useempty\\\ltxkeys@doo - \\\ltxkeys@parse@c\\\ltxkeys@parse@d\\\ltxkeys@loopcbk + \\\ltxkeys@listparse@c\\\ltxkeys@listparse@d\\\ltxkeys@loopcbk + \\\stopprocessinglistkey }\cpt@csvdepth + \let\stopprocessinglistkey\loopbreak \ifdefTF\ltxkeys@do {\let\ltxkeys@doo\ltxkeys@do}{\cpt@notdeferr\ltxkeys@do}% - \def\ltxkeys@parse@c{% + \def\ltxkeys@listparse@c{% \ifboolTF{loopbreak} - {\gobble@to@sentinel\ltxkeys@nil#1}{\ltxkeys@parse@d.}% + {\gobble@to@sentinel\ltxkeys@nil#1}{\ltxkeys@listparse@d.}% }% - \def\ltxkeys@parse@d##1#1{% - \edef\ltxkeys@arg{\expandcsonce{\@gobble##1}}% - \ltxkeys@ifxTF\ltxkeys@arg\ltxkeys@nnil{}{% - \ltxkeys@ifcsemptyTF\ltxkeys@arg{% + \def\ltxkeys@listparse@d##1#1{% + \edef\ltxkeys@listitem{\expandcsonce{\@gobble##1}}% + \ltxkeys@ifxTF\ltxkeys@listitem\ltxkeys@nnil{}{% + \ltxkeys@ifcsemptyTF\ltxkeys@listitem{% \ifboolFT{ltxkeys@useempty}{}{\ltxkeys@doo{}}% }{% - \s@expandarg\ltxkeys@doo\ltxkeys@arg + \s@expandarg\ltxkeys@doo\ltxkeys@listitem }% - \relax\ltxkeys@parse@c + \relax\ltxkeys@listparse@c }% }% \ifswitchTF{ltxkeys@nlz}{% - \usename{\if\ltxkeys@inkv kv\else - csv\fi @@normalize}*[#1]\ltxkeys@arg + \usename{\if\ltxkeys@inkv kv\else csv\fi @@normalize}*[#1]% + \ltxkeys@listitem }{}% \loopbreakfalse - \expandafter\ltxkeys@parse@c\ltxkeys@arg#1\ltxkeys@nil#1% - \cptpopfunctions\ltxkeys@parse\cpt@csvdepth + \expandafter\ltxkeys@listparse@c\ltxkeys@listitem#1\ltxkeys@nil#1% + \cptpopfunctions\ltxkeys@listparse\cpt@csvdepth \ifnum\cpt@csvdepth=\z@pt\undefcs\ltxkeys@do\fi } \def\ltxkeys@keyprefixhook{} @@ -1023,7 +1028,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\temp@err##1{% \ltxkeys@err{Multiple ##1 in \noexpandcsn {ltxkeys@set\ifltxkeys@rm rm\fi keys}% - without '+' suffix}\ltxkeys@ehc + without '+' suffix}\ltxkeys@ehd }% \ltxkeys@ifeltcountTF[,](>)\@ne{#2}{% \temp@err{prefixes}% @@ -1058,7 +1063,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \toks@{#1}% \defpass\ltxkeys@tempa##1]{% \toks1\expandafter{\@gobble##1}% - \cptexpandsecond{\endgroup}{\the\toks@[{\the\toks1}]}% + \cptexpandsecond\endgroup{\the\toks@[{\the\toks1}]}% }.% } \robust@def*\ltxkeys@testopt@@a#1{\ltxkeys@testst{\ltxkeys@testopt@@b#1}} @@ -1126,8 +1131,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \letcstocsn\reserved@e{\ltxkeys@hdr#1keys}% \ifdefTF\reserved@e{% \xifinsetTF{,\cptoxdetok{#2},}{,\cptoxdetok\reserved@e,}{}{% - \csn@xdef{\ltxkeys@hdr#1keys}% - {\csliststack,\reserved@e\expandcsonce{#2}}% + \csn@xdef{\ltxkeys@hdr#1keys}{% + \csliststack,\reserved@e\expandcsonce{#2}% + }% }% }{% \csn@xdef{\ltxkeys@hdr#1keys}{\expandcsonce{#2}}% @@ -1138,12 +1144,14 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \letcstocsn\reserved@e{\ltxkeys@hdr @savedvaluelist}% \ifdefTF\reserved@e{% \oifinset@sp@TF,\ltxkeys@tempa\reserved@e{}{% - \csn@xdef{\ltxkeys@hdr @savedvaluelist}% - {\csliststack,\reserved@e\expandcsonce\ltxkeys@tempa}% + \csn@xdef{\ltxkeys@hdr @savedvaluelist}{% + \csliststack,\reserved@e\expandcsonce\ltxkeys@tempa + }% }% }{% - \csn@xdef{\ltxkeys@hdr @savedvaluelist}% - {\expandcsonce\ltxkeys@tempa}% + \csn@xdef{\ltxkeys@hdr @savedvaluelist}{% + \expandcsonce\ltxkeys@tempa + }% }% } \new@def*\ltxkeys@currtriple{% @@ -1192,7 +1200,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \begingroup \edef\ltxkeys@tempa{\cpttrimspaces{#1}}% \oifinset@sp@TF,\ltxkeys@tempa\ltxkeys@badkeynamelist{% - \ltxkeys@err{Bad key name '\ltxkeys@tempb'}\ltxkeys@ehc + \ltxkeys@err{Bad key name '\ltxkeys@tempb'}\ltxkeys@ehd }{}% \endgroup } @@ -1280,7 +1288,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@do##1{% \expandafter\ltxkeys@ordkey@c\ltxkeys@loopcbk{##1}% }% - \ltxkeys@parse1{#1}% + \ltxkeys@listparse1{#1}% }{% \ltxkeys@ordkey@c{#1}{#2}{#3}% }% @@ -1294,6 +1302,81 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@saveinitialkeyvals{}\ltxkeys@tkey{#2}% \@namedef{\ltxkeys@hdr\ltxkeys@tkey}##1{#3}% } + +\robust@def*\ltxkeys@denyusevaluepointer#1{% + \xifinsetTF{\detokenize{\usevalue}}{\detokenize{#1}}{% + \ltxkeys@err{Pointer '\string\usevalue' not allowed when + defining keys}\@ehd + }{}% +} +% List processor keys: +\robust@def*\ltxkeys@getlistseparator#1{% + \xifinsetTF{\detokenize{\listsep}}{\detokenize{#1}}{% + \def\reserved@a##1\listsep##2##3\ltxkeys@nil{% + \ifblankTF{##2}{% + \def\ltxkeys@listsep{,}% + }{% + \edef\ltxkeys@listsep{\cpttrimspace{##2}}% + }% + \edef\ltxkeys@tempb{\cpttrimspace{##1}\cpttrimspace{##3}}% + }% + \reserved@a#1\ltxkeys@nil + }{% + \def\ltxkeys@listsep{,}% + \edef\ltxkeys@tempb{\cpttrimspace{#1}}% + }% +} +% \ltxkeyslistkey[<pref>]{<fam>}{<key>}[<dft>]{<fn>} +\robust@def*\ltxkeys@listkey{% + \ltxkeys@swfalse + \def\ltxkeys@macpref{}% + \ltxkeys@testopt@a\ltxkeys@listkey@a +} +\newletcs\ltxkeys@listkeys\ltxkeys@listkey +\robust@def*\ltxkeys@newlistkey{\ltxkeys@chdeftrue\ltxkeys@listkey} +\newletcs\ltxkeys@newlistkeys\ltxkeys@newlistkey +\robust@def*\ltxkeys@listkey@a#1{% + \ltxkeys@debug{==}{Lisp key '\ltxkeys@tkey' is being defined}% + \cpt@ifbrack{% + \ltxkeys@bracedefault{\ltxkeys@sttrue\ltxkeys@listkey@b{#1}}% + }{% + \ltxkeys@stfalse\ltxkeys@listkey@b{#1}[]% + }% +} +\robust@def*\ltxkeys@listkey@b#1[#2]#3{% + \let\ifltxkeys@keyst\ifltxkeys@st + \edef\ltxkeys@loopcbk##1{{##1}\unexpanded{{#2}{#3}}}% + \ifinsetTF,{#1}{% + \def\ltxkeys@do##1{% + \expandafter\ltxkeys@listkey@c\ltxkeys@loopcbk{##1}% + }% + \ltxkeys@listparse1{#1}% + }{% + \ltxkeys@listkey@c{#1}{#2}{#3}% + }% +} +\robust@def*\ltxkeys@listkey@c#1#2#3{% + \ltxkeys@denyusevaluepointer{#1}% + \ltxkeys@findpointers{#1}% + \ltxkeys@checkdefkey + \ifdefboolTF{ltxkeys@keyst}{% + \ltxkeys@definedefault\ltxkeys@tkey{#2}% + }{}% + \ltxkeys@saveinitialkeyvals{}\ltxkeys@tkey{#2}% + \ltxkeys@getlistseparator{#3}% + \def\reserved@a{\csn@def{\ltxkeys@hdr\ltxkeys@tkey @auxcbk}####1}% + \expandafter\reserved@a\expandafter{\ltxkeys@tempb}% + \csn@edef{\ltxkeys@hdr\ltxkeys@tkey}##1{% + \def\noexpand\ltxkeys@listcount{0}% + \edef\noexpand\ltxkeys@tempa{\noexpand\ltxkeys@stripallouterbraces{##1}}% + \def\noexpand\ltxkeys@do####1{% + \noexpand\cptpushnumber\noexpand\ltxkeys@listcount + \noexpandcsn{\ltxkeys@hdr\ltxkeys@tkey @auxcbk}{####1}% + }% + \ltxkeys@listparse*1[\ltxkeys@listsep]\noexpand\ltxkeys@tempa + }% +} + \robust@def*\ltxkeys@cmdkey{% \ltxkeys@swfalse \ltxkeys@testopt@e\ltxkeys@cmdkey@a{cmd}% @@ -1308,7 +1391,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ifinsetTF,{#2}{% \def\ltxkeys@do##1{\ltxkeys@loopcbk{##1}}% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@cmdkey@b{#1}{#2}{#3}{#4}% }% @@ -1339,7 +1422,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifblankTF{#3}{}{% \xifstrcmpTF{#3}{true}{}{% \xifstrcmpTF{#3}{false}{}{% - \ltxkeys@err{Bad boolean value '#3'}\ltxkeys@ehc + \ltxkeys@err{Bad boolean value '#3'}\ltxkeys@ehd }% }% }% @@ -1369,7 +1452,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ifinsetTF,{#2}{% \def\ltxkeys@do##1{\ltxkeys@loopcbk{##1}}% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@loopcbk{#2}% }% @@ -1382,7 +1465,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ifinsetTF,{#2}{% \def\ltxkeys@do##1{\ltxkeys@loopcbk{##1}}% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@loopcbk{#2}% }% @@ -1447,7 +1530,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ % #3: default value \robust@def*\ltxkeys@biboolkeys@d#1#2#3{% \ltxkeys@ifeltcountTF[,](=)\tw@{#2}{}{% - \ltxkeys@error{Biboolean keys '#2' not equal to 2}\ltxkeys@ehc + \ltxkeys@error{Biboolean keys '#2' not equal to 2}\ltxkeys@ehd }% \ltxkeys@commanormalize{#2}\ltxkeys@keys \def\ltxkeys@tempa##1,##2\ltxkeys@nil##3##4{% @@ -1565,7 +1648,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ifinsetTF,{#2}{% \def\ltxkeys@do##1{\ltxkeys@loopcbk{##1}}% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@stylekey@c{#1}{#2}{#3}{#4}{#5}% }% @@ -1597,7 +1680,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% } -% #1: style type, '1' (*-form) or '0' (plain, non-*-form). +% #1: style type: '1' (*-form) or '0' (plain, non-*-form). % #2: <macro prefix> \robust@def*\ltxkeys@setdependants#1#2{% \letcstocsn\ltxkeys@tempa{\ltxkeys@hdr\ltxkeys@tkey @dependants}% @@ -1620,7 +1703,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@s@td@pendants{##1}% \ltxkeys@s@td@p@ndants{#1}% }% - \cptexpandsecond{\ltxkeys@parse0}{[\ltxkeys@keyparser]}{#3}% + \cptexpandsecond{\ltxkeys@listparse0}{[\ltxkeys@keyparser]}{#3}% % We're in a group: so \ifblankTF can be temporarily redefined: \let\ifblankTF\relax \cptpassexpanded{% @@ -1644,16 +1727,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ltxkeys@depfalse } -\robust@def*\ltxkeys@striplaststar#1*\@empty#2\ltxkeys@nil#3{% - \edef#3{#1}% -} -\robust@def*\ltxkeys@ifrejname#1{% - \ifcase0\ifx\key@type\ltxkeys@rej1\else - \ifx\key@name\ltxkeys@rej1\fi\fi\relax\else#1\fi -} \robust@def*\ltxkeys@s@td@pendants#1{% \begingroup - \def\key@name{}\def\key@default{}\def\key@macro{}% + \def\key@name{}\def\key@default{}\def\key@callback{}% % '#1' may come with nested parameters that will make it % impossible to include '#1' directly in \temp@err. % So we put '#1' in a token register: @@ -1661,7 +1737,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@splita##1/##2/{% \ifblankTF{##1##2}{% % No keys to read (remove forward slashes): - \ltxkeys@err{Something is wrong with dependant keys}\ltxkeys@ehc + \ltxkeys@err{Something is wrong with dependant keys}\ltxkeys@ehd \expandafter\gobble@to@sentinel\expandafter \ltxkeys@nil\ltxkeys@keyparser }{% @@ -1672,21 +1748,21 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \key@type\@empty*\@empty\ltxkeys@nil\key@type \xifstrcmpFT\key@type{sty}{}{% \ltxkeys@err{A dependant key can't have dependants: - ||\the\@temptokena||}\ltxkeys@ehc + ||\the\@temptokena||}\ltxkeys@ehd }% \xifinsetTF\key@type{,ord,cmd,bool,choice,}{}{% \ltxkeys@err{Invalid key type '\key@type' in dependant key(s) - ||\the\@temptokena||}\ltxkeys@ehc + ||\the\@temptokena||}\ltxkeys@ehd }% \ifblankTF{##2}{% \ltxkeys@err{Empty key name in dependant key(s) - ||\the\@temptokena||}\ltxkeys@ehc + ||\the\@temptokena||}\ltxkeys@ehd }{% \ltxkeys@findpointers{##2}% \let\key@name\ltxkeys@tkey }% \ltxkeys@ifrejname{% - \ltxkeys@err{Wrong syntax for dependant keys}\ltxkeys@ehc + \ltxkeys@err{Wrong syntax for dependant keys}\ltxkeys@ehd }% \ltxkeys@splitb.% }% @@ -1697,14 +1773,14 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \xifstrcmpTF{\cptoxdetok\key@default}{\detokenize{\parentval}}{% \edef\key@default{\expandcstwice\key@default}% }{}% - \edef\key@macro{\unexpanded{##2}}% - \ltxkeys@stripdotcode\key@macro + \edef\key@callback{\unexpanded{##2}}% + \ltxkeys@stripdotcode\key@callback }% \ltxkeys@splita#1/^?^/^?^/^?^/\ltxkeys@nil \let\do\cpt@csexit \cptpassexpanded{% \endgroup - \do\key@type\do\key@name\do\key@default\do\key@macro + \do\key@type\do\key@name\do\key@default\do\key@callback }% } \robust@def*\ltxkeys@s@td@p@ndants#1{% @@ -1722,7 +1798,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \the\toks1\oifblankTF{\the\toks1}{}{\ltxkeys@keyparser}% \key@type/\expandcsonce\key@name \ifx\key@default\ltxkeys@rej\else/\expandcsonce\key@default\fi - \ifx\key@macro\ltxkeys@rej\else/\expandcsonce\key@macro\fi + \ifx\key@callback\ltxkeys@rej\else/\expandcsonce\key@callback\fi }% \else \toks2{\the\toks2\oifblankTF{\the\toks2}{}{,}% @@ -1767,7 +1843,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ % #4 alt values \robust@def*\ltxkeys@choicekey@b#1#2[#3]#4{% \ifblankTF{#4}{% - \ltxkeys@err{Choice key can't have empty nominations}\ltxkeys@ehc + \ltxkeys@err{Choice key can't have empty nominations}\ltxkeys@ehd }{}% % Make \ltxkeys@chclist for the choice key: \ltxkeys@makechclist{#4}{0}% @@ -1810,7 +1886,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@do##1{% \ltxkeys@loopcbk{##1}% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@loopcbk{#2}% }% @@ -1825,7 +1901,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@do##1{% \ltxkeys@loopcbk{##1}% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@loopcbk{#2}% }% @@ -1889,7 +1965,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{}% \else \ltxkeys@err{Invalid number '#2' while - in \string\ltxkeys@makechclist}\ltxkeys@ehc + in \string\ltxkeys@makechclist}\ltxkeys@ehd \fi }% \def\ltxkeys@do##1{% @@ -1900,12 +1976,12 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% \expandafter\ifinsetTF\expandafter{\ltxkeys@keyparser}{#1}{% - \cptexpandsecond{\ltxkeys@parse1}{[\ltxkeys@keyparser]}{#1}% + \cptexpandsecond{\ltxkeys@listparse1}{[\ltxkeys@keyparser]}{#1}% }{% \ifinsetTF{,}{#1}{% - \ltxkeys@parse1[,]{#1}% + \ltxkeys@listparse1[,]{#1}% }{% - \ltxkeys@parse1[,]{#1,}% + \ltxkeys@listparse1[,]{#1,}% }% }% \postgroupdef\ltxkeys@chclist\endgroup @@ -1942,12 +2018,12 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \csliststack,\ltxkeys@keynames\expandcsonce\ltxkeys@tempa }% }% - \ifblankTF{#1}{}{\ltxkeys@parse3{#1}}% + \ifblankTF{#1}{}{\ltxkeys@listparse3{#1}}% \postgroupdef\ltxkeys@keynames\endgroup } \robust@def*\ltxkeys@getkeyvalue#1=#2\ltxkeys@nil#3{% \ifinsetTF{=\ltxkeys@nil}{#2\ltxkeys@nil}{% - \ltxkeys@novalfalse + \ltxkeys@novaluefalse \begingroup \def\ltxkeys@tempa##1=##2\ltxkeys@nil{\endgroup % \s@expandarg\ltxkeys@trimspaces{\@gobble##1}#3% @@ -1956,7 +2032,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ltxkeys@tempa.#2\ltxkeys@nil }{% - \ltxkeys@novaltrue\def#3{}% + \ltxkeys@novaluetrue\def#3{}% }% } \robust@def*\ltxkeys@splitkeyval#1\ltxkeys@nil#2#3{% @@ -2009,7 +2085,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ {Only defined keys can be made '#1option' keys.}% }% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% } % Make defined keys option-keys from their <pref> and <fam>. % The starred (*) variant makes non-option keys. @@ -2021,7 +2097,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifcsndefTF{#1@#2@initialkeyvals}{% \letcstocsn\ltxkeys@tempa{#1@#2@initialkeyvals}% }{% - \ltxkeys@err{No initial key-values for family '#2'}\ltxkeys@ehc + \ltxkeys@err{No initial key-values for family '#2'}\ltxkeys@ehd }% \s@expandarg\ltxkeys@getkeynames\ltxkeys@tempa \ltxkeys@ifcsemptyTF\ltxkeys@keynames{}{% @@ -2080,7 +2156,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ {Only defined keys can be made #1-keys.}% }% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% \letcsntocs{\ltxkeys@hdr#1keys}\ltxkeys@rsvda } \robust@def*\ltxkeys@rem@vehandledkeys#1#2{% @@ -2103,7 +2179,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ {I couldn't delete #1-keys.}% }% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }{% \ltxkeys@err{No #1 keys for family '\ltxkeys@tfam'}% {No #1 keys exist for prefix '\ltxkeys@ttpref' and @@ -2202,15 +2278,8 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifblankTF{#1}{% \ltxkeys@twkfalse }{% - \ltxkeys@ifinlistTF(1){% - \ltxkeys@setaliaskey,\setaliaskey - }{% - #2% - }{% - \ltxkeys@twktrue - }{% - \ltxkeys@twkfalse - }% + \ltxkeys@ifinlistTF(1){\ltxkeys@setaliaskey,\setaliaskey}{#2}% + {\ltxkeys@twktrue}{\ltxkeys@twkfalse}% }% \begingroup \edef\elt{\ifblankTF{#1}{}{\unexpanded{#1}}}% @@ -2276,7 +2345,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@splitc##1/##2/##3/##4\ltxkeys@nil{% \ifblankTF{##1}{% \ltxkeys@err{Empty key name while in - \string\ltxkeys@definekeys}\ltxkeys@ehc + \string\ltxkeys@definekeys}\ltxkeys@ehd }{% \ltxkeys@findpointers{##1}% \let\key@name\ltxkeys@tkey @@ -2286,7 +2355,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{}{% \ltxkeys@err{Key '\key@name' already defined in family \MsgBrk '\iflacus#2\dolacus???\else#2\fi' with prefix - '\iflacus#1\dolacus???\else#1\fi'}\ltxkeys@ehc + '\iflacus#1\dolacus???\else#1\fi'}\ltxkeys@ehd }% \fi \oifblankTF{\@gobble##2}{% @@ -2294,11 +2363,11 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{% \ltxkeys@remdottrimspaces{##2}\key@default }% - \edef\key@macro{\unexpanded{##3}}% - \ltxkeys@stripdotcode\key@macro + \edef\key@callback{\unexpanded{##3}}% + \ltxkeys@stripdotcode\key@callback \cptexpandsecond\ltxkeys@accumkeyvals{% {\ifx\key@default\ltxkeys@rej\else\expandcsonce\key@default\fi}% - {\ifx\key@macro\ltxkeys@rej\else\expandcsonce\key@macro\fi}% + {\ifx\key@callback\ltxkeys@rej\else\expandcsonce\key@callback\fi}% }% \def\defwith{\ltxkeys@boolkey}% \oifstrcmpTF\key@default{true}{}{% @@ -2313,7 +2382,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifx\macro@pref\@empty\else[\macro@pref]\fi {\expandcsonce\key@name}% \ifx\key@default\ltxkeys@rej\else[\expandcsonce\key@default]\fi - \ifx\key@macro\ltxkeys@rej{}\else{\expandcsonce\key@macro}\fi + \ifx\key@callback\ltxkeys@rej{}\else{\expandcsonce\key@callback}\fi }% }% }% @@ -2327,7 +2396,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \expandafter\ltxkeys@splitb\ltxkeys@tempa/^?^/^?^/\ltxkeys@nil }% }% - \cptexpandsecond{\ltxkeys@parse1}{[\ltxkeys@keyparser]}{#4}% + \cptexpandsecond{\ltxkeys@listparse1}{[\ltxkeys@keyparser]}{#4}% % Define and initialize the keys here directly: \cptexpandsecond\endgroup{% \the\toks@ @@ -2376,15 +2445,12 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@makehdr{#3}% \ltxkeys@dectrue \begingroup - \ltxkeys@trimspacesset{% - {#2}\key@pref,{#3}\key@fam,{#4}\macro@pref - }% - \def\key@vals{}% - \toks@{}% + \ltxkeys@trimspacesset{{#2}\key@pref,{#3}\key@fam,{#4}\macro@pref}% + \def\key@vals{}\toks@{}% \def\ltxkeys@splita##1/##2/{% \ifescapedTF{##1}{% \ltxkeys@err{Key type can't be a macro: '\detokenize{##1}'}% - \ltxkeys@ehc + \ltxkeys@ehd }{}% \ltxkeys@trimspacesset{{##1}\key@type,{##2}\key@name}% \xifstrcmpTF\key@type{choice}{% @@ -2394,19 +2460,19 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@err{The syntax of \noexpand\ltxkeys@definekeys may \MsgBrk have been used for \string\ltxkeys@declarekeys. \MsgBrk This may have come from \noexpand\ltxkeyscmd or - \MsgBrk \string\ltxkeysenv}\ltxkeys@ehc + \MsgBrk \string\ltxkeysenv}\ltxkeys@ehd }{}% \ifx\key@type\@empty \ltxkeys@err{Empty key type in \string\ltxkeys@declarekeys} - \ltxkeys@ehc + \ltxkeys@ehd \fi \ifx\key@name\@empty \ltxkeys@err{Empty key name in \string\ltxkeys@declarekeys}% - \ltxkeys@ehc + \ltxkeys@ehd \fi \ltxkeys@ifrejname{% \ltxkeys@err{Wrong use syntax for \string\ltxkeys@declarekeys}% - \ltxkeys@ehc + \ltxkeys@ehd }% \ifltxkeys@inkeycmd \xifstrcmpFT\key@type{ord}{}{\def\key@type{cmd}}% @@ -2422,7 +2488,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifcsndefFT{\ltxkeys@hdr\key@name}{}{% \ltxkeys@err{Key '\key@name' already defined in family \MsgBrk '\iflacus#3\dolacus???\else#3\fi' with prefix - '\iflacus#2\dolacus???\else#2\fi'}\ltxkeys@ehc + '\iflacus#2\dolacus???\else#2\fi'}\ltxkeys@ehd }% \fi \ltxkeys@splitb.% @@ -2440,36 +2506,42 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@debug{!!}{Boolean key '\key@name' has no default; 'true' used}% \else - \begingroup - \def\ltxkeys@true{true}\def\ltxkeys@false{false}% - \ifcase0\ifx\key@default\ltxkeys@true\else\ifx\key@default - \ltxkeys@false\else1\fi\fi\relax\else + \ifcase0% + \ifx\key@default\ltxkeys@truetoks\else + \ifx\key@default\ltxkeys@falsetoks\else1\fi\fi\relax + \else \ltxkeys@err{Invalid default value for boolean key - '\key@name'}\ltxkeys@ehc + '\key@name'}\ltxkeys@ehd \fi - \endgroup \fi }{}% - \edef\key@macro{\unexpanded{##2}}% - \ltxkeys@stripdotcode\key@macro - \expandafter\ltxkeys@striplaststar\key@type - \@empty*\@empty\ltxkeys@nil\key@@type - \xifinsetFT{,sty,}{,\key@@type,}{}{% + \edef\key@callback{\unexpanded{##2}}% + \ltxkeys@stripdotcode\key@callback + \expandafter\ltxkeys@striplaststar\key@type\@empty*\@empty + \ltxkeys@nil\key@type@aux + \xifinsetTF{,\key@type@aux,}{,sty,}{% \ltxkeys@trimspaces{##3}\key@dependants \ltxkeys@ifxTF\key@dependants\ltxkeys@rej{% \def\key@dependants{}% }{% \expandafter\ltxkeys@declarekeys@e\expandafter{\key@dependants}% }% + }{% + \xifinsetTF{,\key@type@aux,}{,bool,choice,}{% + \ltxkeys@trimspaces{##3}\key@bicallback + \ltxkeys@ifxTF\key@bicallback\ltxkeys@rej{% + \let\key@bicallback\ltxkeys@keyvalerr + }{}% + }{}% }% \cptexpandsecond\ltxkeys@accumkeyvals{% {\ifx\key@default\ltxkeys@rej\else\expandcsonce\key@default\fi}% - {\ifx\key@macro\ltxkeys@rej\else\expandcsonce\key@macro\fi}% + {\ifx\key@callback\ltxkeys@rej\else\expandcsonce\key@callback\fi}% }% - \def\dkey@macro{% - \ifx\key@macro\ltxkeys@rej{}\else{\expandcsonce\key@macro}\fi + \def\key@callback@aux{% + \ifx\key@callback\ltxkeys@rej{}\else{\expandcsonce\key@callback}\fi }% - \def\dkey@default{% + \def\key@default@aux{% \ifx\key@default\ltxkeys@rej\else[\expandcsonce\key@default]\fi }% \s@expandarg\ltxkeys@declarekeys@d\key@type @@ -2483,22 +2555,22 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \toks@{\the\toks@ \cptmakecs{ltxkeys@twk\ifltxkeys@twk true\else false\fi}% \ifcase\currmatch\relax - \ltxkeys@cmdkey\ltxkeys@tempa\dkey@default\dkey@macro + \ltxkeys@cmdkey\ltxkeys@tempa\key@default@aux\key@callback@aux \or - \ltxkeys@boolkey+\ltxkeys@tempa\dkey@default - \dkey@macro{\ltxkeys@keyvalerr}% + \ltxkeys@boolkey+\ltxkeys@tempa\key@default@aux + \key@callback@aux{\expandcsonce\key@bicallback}% \or - \ltxkeys@ordkey\ltxkeys@tempa\dkey@default\dkey@macro + \ltxkeys@ordkey\ltxkeys@tempa\key@default@aux\key@callback@aux \or \ltxkeys@choicekey*+\ltxkeys@tempa [\unexpanded{\userinput\order}]{\expandcsonce\ltxkeys@alt}% - \dkey@default\dkey@macro{\ltxkeys@keyvalerr}% + \key@default@aux\key@callback@aux{\expandcsonce\key@bicallback}% \or - \ltxkeys@stylekey\ltxkeys@tempa\dkey@default - (\expandcsonce\key@dependants)\dkey@macro + \ltxkeys@stylekey\ltxkeys@tempa\key@default@aux + (\expandcsonce\key@dependants)\key@callback@aux \or - \ltxkeys@stylekey*\ltxkeys@tempa\dkey@default - (\expandcsonce\key@dependants)\dkey@macro + \ltxkeys@stylekey*\ltxkeys@tempa\key@default@aux + (\expandcsonce\key@dependants)\key@callback@aux \else \cptgaddtolist\noexpand\ltxkeys@badkeytypes{\key@type}% \fi @@ -2521,14 +2593,14 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@tempa#1/\unexpanded{##1}% }% }% - \cptexpandsecond{\ltxkeys@parse0}{[\ltxkeys@keyparser]}{#5}% + \cptexpandsecond{\ltxkeys@listparse0}{[\ltxkeys@keyparser]}{#5}% }% \def\ltxkeys@do##1{% \ifblankTF{##1}{}{% \ltxkeys@splita##1/^?^/^?^/^?^/^?^/\ltxkeys@nil }% }% - \cptexpandsecond{\ltxkeys@parse0} + \cptexpandsecond{\ltxkeys@listparse0} {[\ltxkeys@keyparser]{\expandcsonce\ltxkeys@tempa}}% \cptexpandsecond\endgroup{% \the\toks@ @@ -2536,7 +2608,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \edef\noexpand\key@vals{\ox@unexpanded\key@vals}% }% \ifx\ltxkeys@badkeytypes\@empty\else - \cpt@err{Invalid key types '\ltxkeys@badkeytypes'}\ltxkeys@ehc + \cpt@err{Invalid key types '\ltxkeys@badkeytypes'}\ltxkeys@ehd \fi % Initialize keys: \ltxkeys@ifcsemptyTF\key@vals{}{% @@ -2544,19 +2616,14 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \ltxkeys@decfalse } -\robust@def\ltxkeys@declarekeys@d#1{% +\robust@def*\ltxkeys@declarekeys@d#1{% \ltxkeys@findmatch - {#1}{cmd:0,bool:1,ord:2,choice:3,sty:4,syt*:5}% - {\def\currmatch{-1}}% + {#1}{cmd:0,bool:1,ord:2,choice:3,sty:4,syt*:5}{\def\currmatch{-1}}% } -\robust@def\ltxkeys@declarekeys@e#1{% - \ifblankTF{#1}{% - \def\key@dependants{}\cptgobbletorelax - }{}% +% \ltxkeys@declarekeys@e{<dependant key specs>} +\robust@def*\ltxkeys@declarekeys@e#1{% + \ifblankTF{#1}{\def\key@dependants{}\cptgobbletorelax}{}% \begingroup - \ifinsetTF{>}{#1}{}{% - \ltxkeys@warn{Missing '>' in dependants of key '\ltxkeys@tkey'}% - }% \def\ltxkeys@splita##1>##2>{% \def\key@type{##1}% \edef\key@name{\unexpanded{##2}}% @@ -2564,24 +2631,24 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \def\ltxkeys@splitb##1>##2>##3\ltxkeys@nil{% \edef\key@default{\expandcsonce{\@gobble##1}}% - \edef\key@macro{\unexpanded{##2}}% - \ltxkeys@stripdotcode\key@macro + \edef\key@callback{\unexpanded{##2}}% + \ltxkeys@stripdotcode\key@callback \ltxkeys@ifrejname{% \ltxkeys@err{Wrong syntax for dependants keys in - \MsgBrk\string\ltxkeys@declarekeys}\ltxkeys@ehc + \MsgBrk\string\ltxkeys@declarekeys}\ltxkeys@ehd }% \edef\key@dependants{% \expandafter\csliststack\ltxkeys@keyparser\key@dependants \key@type/\expandcsonce\key@name \ifx\key@default\ltxkeys@rej\else/\expandcsonce\key@default\fi - \ifx\key@macro\ltxkeys@rej\else/\expandcsonce\key@macro\fi + \ifx\key@callback\ltxkeys@rej\else/\expandcsonce\key@callback\fi }% }% \def\key@dependants{}% \def\ltxkeys@do##1{% \ltxkeys@splita##1>^?^>^?^>^?^>\ltxkeys@nil }% - \ltxkeys@parse1[,]{#1}% + \ltxkeys@listparse1[,]{#1}% \postgroupdef\key@dependants\endgroup \cpt@relax } @@ -2596,12 +2663,12 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@savexf@milyk@ys#1(#2)#3{% \ifblankTF{#1}{% \ltxkeys@err{Empty set-identifier for \string\xfamilykeys: - ||\detokenize{#3}||}\ltxkeys@ehc + ||\detokenize{#3}||}\ltxkeys@ehd }{}% \ltxkeys@trimspaces{#1}\ltxkeys@tempb \ifcsndefTF{xfamilykeys@id@\ltxkeys@tempb}{% \ltxkeys@err{xfamilykeys identifier '\ltxkeys@tempb' - already in use}\ltxkeys@ehc + already in use}\ltxkeys@ehd }{}% \cpt@stchoose{cpt@st}{#3}\ltxkeys@tempa\ltxkeys@savexfamilykeys \ifblankTF{#2}{}{% @@ -2611,7 +2678,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@tempa#2/\unexpanded{##1}% }% }% - \cptexpandsecond{\def\ltxkeys@tempa{}\ltxkeys@parse1}% + \cptexpandsecond{\def\ltxkeys@tempa{}\ltxkeys@listparse1}% {[\ltxkeys@keyparser]{\expandcsonce\ltxkeys@tempa}}% }% \cptexpandsecond{\endgroup\csn@edef} @@ -2626,7 +2693,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \edef\defwith{\ltxkeys@declarekeys\ifcpt@st*\fi}% \ifblankTF{#1}{% \ltxkeys@err{Invalid empty xfamilykeys identifier - \MsgBrk in \string\ltxkeys@definexfamilykeys}\ltxkeys@ehc + \MsgBrk in \string\ltxkeys@definexfamilykeys}\ltxkeys@ehd }{}% \ltxkeys@trimspaces{#1}\ltxkeys@tempa \ifcsndefTF{xfamilykeys@id@\ltxkeys@tempa}{% @@ -2634,7 +2701,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@d@fin@xfamilykeys\expandafter{\ltxkeys@tempa}}{KV}% }{% \ltxkeys@err{Unknown xfamilykeys identifier '\ltxkeys@tempa' - \MsgBrk in \string\ltxkeys@definexfamilykeys}\ltxkeys@ehc + \MsgBrk in \string\ltxkeys@definexfamilykeys}\ltxkeys@ehd }% } \robust@def*\ltxkeys@d@fin@xfamilykeys#1[#2]#3{% @@ -2643,25 +2710,25 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@d@fin@xf@milykeys#1#2#3[#4]#5{% \def\ltxkeys@na{#5}% \def\ltxkeys@splita##1/##2/{% - \ltxkeys@trimspacesset{{##1}\key@type,{##2}\key@n@me}% + \ltxkeys@trimspacesset{{##1}\key@type,{##2}\key@name@aux}% \xifstrcmpTF\key@type{choice}{% - \expandafter\ltxkeys@splitchoice\expandafter{\key@n@me}% + \expandafter\ltxkeys@splitchoice\expandafter{\key@name@aux}% }{% - \let\key@name\key@n@me + \let\key@name\key@name@aux }% \ltxkeys@splitb.% }% \def\ltxkeys@splitb##1/##2/##3/##4\ltxkeys@nil{% \edef\key@default{\expandcsonce{\@gobble##1}}% - \edef\key@macro{\unexpanded{##2}}% + \edef\key@callback{\unexpanded{##2}}% \edef\key@dependants{\unexpanded{##3}}% \oifinset@sp@TF,\key@name\ltxkeys@na{}{% \let\do\expandcsonce \edef\ltxkeys@tempa{% \expandafter\csliststack\ltxkeys@keyparser - \ltxkeys@tempa\key@type/\do\key@n@me + \ltxkeys@tempa\key@type/\do\key@name@aux \ifx\key@default\ltxkeys@rej\else/\do\key@default\fi - \ifx\key@macro\ltxkeys@rej\else/\do\key@macro\fi + \ifx\key@callback\ltxkeys@rej\else/\do\key@callback\fi \ifx\key@dependants\ltxkeys@rej\else/\do\key@dependants\fi }% }% @@ -2670,7 +2737,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \def\ltxkeys@do##1{% \ltxkeys@splita##1/^?^/^?^/^?^/^?^/\ltxkeys@nil }% - \cptexpandsecond{\ltxkeys@parse1} + \cptexpandsecond{\ltxkeys@listparse1} {[\ltxkeys@keyparser]{\expandcsnonce{xfamilykeys@id@#1}}}% \cptexpandsecond\endgroup {\defwith[#2]{#3}[#4]{\expandcsonce\ltxkeys@tempa}}% @@ -2703,7 +2770,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@splitkeyval##1\ltxkeys@nil\ltxkeys@tkey\ltxkeys@tval \ifcsndefFT{\ltxkeys@hdr\ltxkeys@tkey}{% \ltxkeys@err{Key '\ltxkeys@currtriple' is undefined.}% - \ltxkeys@ehc + \ltxkeys@ehd }{% \ifcsndefTF{\ltxkeys@hdr#1setkeys@alreadysaved}{}{% \csn@def{\ltxkeys@hdr#1setkeys@alreadysaved}{}% @@ -2713,7 +2780,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \xifinsetTF{,\cptoxdetok\ltxkeys@tkey,}% {,\cptsxdetok{\usename{\ltxkeys@hdr#1setkeys@alreadysaved},}}{% \ltxkeys@err{Double entry for key '\ltxkeys@currtriple' in\MsgBrk - #1set key list}\ltxkeys@ehc + #1set key list}\ltxkeys@ehd }{% \edef\ltxkeys@rsvda{\csliststack,\ltxkeys@rsvda \ltxkeys@tkey\ltxkeys@ifcsemptyTF\ltxkeys@tval{}% @@ -2723,7 +2790,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% }% - \ltxkeys@parse3{#2}% + \ltxkeys@listparse3{#2}% % '...@alreadysaved' saves key names irrespective % of value, for testing if a preset key is being saved twice: \ltxkeys@ifcsemptyTF\ltxkeys@rsvda{}{% @@ -2748,14 +2815,14 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@removeppsetkeys#1#2{% \ifcsndefFT{\ltxkeys@hdr#1setkeys}{% \ltxkeys@err{No #1set keys defined for prefix '\ltxkeys@ttpref' - and family '\ltxkeys@tfam'}\ltxkeys@ehc + and family '\ltxkeys@tfam'}\ltxkeys@ehd }{% \def\ltxkeys@rsvda{}\def\ltxkeys@rsvdb{}% \def\ltxkeys@do##1{% \ltxkeys@splitkeyval##1=\ltxkeys@nil\ltxkeys@tkey\ltxkeys@tval \ifcsndefFT{\ltxkeys@hdr\ltxkeys@tkey}{% \ltxkeys@err{Key '\ltxkeys@currtriple' is undefined}% - \ltxkeys@ehc + \ltxkeys@ehd }{% \xifinsetTF{,\cptoxdetok\ltxkeys@tkey=\cptoxdetok\ltxkeys@tval,}% {,\cptsxdetok{\usename{\ltxkeys@hdr#1setkeys}},}{% @@ -2766,11 +2833,11 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \expandcsonce\ltxkeys@tkey}% }{% \ltxkeys@err{Key '\ltxkeys@currtriple' not a #1set key}% - \ltxkeys@ehc + \ltxkeys@ehd }% }% }% - \ltxkeys@parse3{#2}% + \ltxkeys@listparse3{#2}% \ltxkeys@ifcsemptyTF\ltxkeys@rsvda{}{% \cptpassexpanded{% \cptfilterremovekv\noexpandcsn{\ltxkeys@hdr#1setkeys}% @@ -2788,7 +2855,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@undefppsetkeys#1{% \ifcsndefFT{\ltxkeys@hdr#1setkeys}{% \ltxkeys@err{No #1set keys defined for prefix '\ltxkeys@ttpref' - and family '\ltxkeys@tfam'}\ltxkeys@ehc + and family '\ltxkeys@tfam'}\ltxkeys@ehd }{% \usename{\ifltxkeys@cl g\fi undefcsn}{\ltxkeys@hdr#1setkeys}% \usename{\ifltxkeys@cl g\fi undefcsn}% @@ -2801,7 +2868,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@commanormalize{#1}\ltxkeys@tempa \xifinsetTF{,}{\cptoxdetok\ltxkeys@tempa}{% \ltxkeys@err{\noexpand\ltxkeys@setaliaskey doesn't - accept key list}\ltxkeys@ehc + accept key list}\ltxkeys@ehd }{% \cptexpandarg\cpt@testopt{\ltxkeys@s@taliaskey\ltxkeys@tempa}{}% }% @@ -2816,7 +2883,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ {\expandcsonce\y}% }{% \ltxkeys@err{\noexpand\ltxkeys@setaliaskey - or \noexpand\setaliaskey nested}\ltxkeys@ehc + or \noexpand\setaliaskey nested}\ltxkeys@ehd }{}% \cptexpandsecond\ltxkeys@setkeys{% [\ltxkeys@ttpref]{\ltxkeys@tfam}{% @@ -2830,7 +2897,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@trimspaces{##1}\key@name \ifstrcmpTF{##2}{.}{% \ltxkeys@err{Invalid alternate value list for key '#1'} - \ltxkeys@ehc + \ltxkeys@ehd }{% \ifmacroTF{##2}{% \edef\ltxkeys@alt{\expandcsonce{##2}}% @@ -2886,9 +2953,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@tempc\nofilter }{}% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }% - \ltxkeys@parse1{#1}% + \ltxkeys@listparse1{#1}% \ltxkeys@getkeynames{#3}% \cptexpandsecond{\endgroup\ltxkeys@setkeys*+[#1]{#2}}% {[\ltxkeys@keynames]{\expandcsonce\ltxkeys@resa}}% @@ -2912,7 +2979,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \edef#1{\csliststack,#1\unexpanded{##1}}% }% }% - \cptexpandargonce{\def#1{}\ltxkeys@parse3}{#1}% + \cptexpandargonce{\def#1{}\ltxkeys@listparse3}{#1}% \cpt@relax \postgroupdef#1\endgroup } @@ -2929,7 +2996,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \xifinsetTF{,}\ltxkeys@fams{% \ifltxkeys@pl\else \ltxkeys@err{Multiple key families: you need + prefix - \MsgBrk for command \string\ltxkeys@launchkeys}\ltxkeys@ehc + \MsgBrk for command \string\ltxkeys@launchkeys}\ltxkeys@ehd \fi }{}% \cptexpandsecond\ltxkeys@in@ti@lizekeys @@ -2946,9 +3013,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \cptexpandargonce{\cptfiltermergecsv[,]\ltxkeys@resa} \ltxkeys@tempc\nofilter }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs \cptexpandargonce{\endgroup\expandafter\undefcs\expandafter \ltxkeys@cmdpf\expandafter\ltxkeys@setkeys \ltxkeys@cmdpf[#1]{#2}}\ltxkeys@resa @@ -2974,9 +3041,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@makehdr{####1}% \ltxkeys@nonl@un@hk@ys }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs } \robust@def*\ltxkeys@nonl@un@hk@ys{% \ifcsndefTF{\ltxkeys@hdr poxkeys}{}{% @@ -2992,13 +3059,16 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }{}% }% - \ltxkeys@parse*0\ltxkeys@keys + \ltxkeys@listparse*0\ltxkeys@keys \letcsntocs{\ltxkeys@hdr poxkeys}\ltxkeys@tempc } \robust@def*\ltxkeys@setkeys{% \ltxkeys@rmfalse \ltxkeys@teststpl{\ltxkeys@testopt@c\ltxkeys@setkeys@a}% } +% Don't call \ltxkeysusekeys \ltxkeyssetkeys, since +% \ltxkeyssetkeys is used in mkii. +\newletcs\ltxkeysusekeys\ltxkeys@setkeys \newletcs\ltxkeys@setkey\ltxkeys@setkeys \robust@def*\ltxkeys@setrmkeys{% \ltxkeys@rmtrue @@ -3015,7 +3085,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \xifinsetTF{\x\detokenize{#2}\x} {\x.\x,\x;\x:\x+\x-\x=\x*\x^\x_\x/\x|\x[\x(\x)\x]\x}{% \ltxkeys@err{Invalid key list '#2': Something is wrong} - \ltxkeys@ehc + \ltxkeys@ehd }{}% \endgroup \ifcsndefTF{\ltxkeys@hdr executedkeys}{}{% @@ -3069,9 +3139,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ {\expandcsnonce{\ltxkeys@hdr#1setkeys}}}}% }% }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs \oifblankTF{\the\toks@}{% \endgroup \ltxkeys@debug{==}{No #1-set keys found}% @@ -3093,12 +3163,12 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@getkeyvalue##1=\ltxkeys@nil\ltxkeys@tval \ltxkeys@setkeys@c##1=\ltxkeys@nil }% - \ltxkeys@parse3{#2}% + \ltxkeys@listparse3{#2}% } \robust@def*\ltxkeys@setkeys@c#1=#2\ltxkeys@nil{% \ifinsetTF{\needvalue}{#1}{% \ltxkeys@err{\noexpand\needvalue pointer not allowed - \MsgBrk when setting keys}\ltxkeys@ehc + \MsgBrk when setting keys}\ltxkeys@ehd }{}% \ltxkeys@findp@inters\savevalue{#1}\ltxkeys@tkey{% \ltxkeys@svtrue @@ -3107,10 +3177,10 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \let\CurrentKey\ltxkeys@tkey \ltxkeys@ifcsemptyTF\ltxkeys@tkey{% - \ifltxkeys@noval\else + \ifltxkeys@novalue\else \ltxkeys@err{No key specified for value '\expandcsonce\ltxkeys@tval' - \MsgBrk in families '\ltxkeys@fams'}\ltxkeys@ehc + \MsgBrk in families '\ltxkeys@fams'}\ltxkeys@ehd \fi }{% \oifinset@sp@TF,\ltxkeys@tkey\ltxkeys@nakeys{}{% @@ -3133,9 +3203,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@makehdr\ltxkeys@tfam \ltxkeys@setkeys@e }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs }{% \def\ltxkeys@do##1{% \def\CurrentPref{##1}% @@ -3147,10 +3217,10 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@setkeys@e \ifltxkeys@kf\loopbreak\fi }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams \ifltxkeys@kf\loopbreak\fi }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs }% }% \ifboolTF{ltxkeys@kf}{% @@ -3179,9 +3249,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{% \ifboolTF{ltxkeys@st}{% \ifltxkeys@tracingkeys - \ltxkeys@getinnoval + \ltxkeys@getinnovalue \ltxkeys@debug{==}{Undefined key \ltxkeys@currtriple, - \InnocentVal, saved in \cptmakes{\ltxkeys@hdr rmkeys}}% + \InnocentVal, saved in \cptmakecs{\ltxkeys@hdr rmkeys}}% \fi \cptexpandargonce{\aftercsname{\cptfiltermergekv[,]}% {\ltxkeys@hdr rmkeys}}\CurrentKeyval\nofilter @@ -3197,7 +3267,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }{% \ltxkeys@debug{==}{Key \ltxkeys@currtriple, saved as undefined}% - \ltxkeys@getinnoval + \ltxkeys@getinnovalue \cptexpandarg{\cptfiltermergecsv[;]\ltxkeys@undefinedkeys}{% \ltxkeys@ttpref,\ltxkeys@tfam,\ltxkeys@tkey,\InnocentVal }\nofilter @@ -3208,7 +3278,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ } \robust@def*\ltxkeys@setkeys@e{% \ifboolTF{ltxkeys@tracingkeys}{% - \ltxkeys@getinnovalnopad + \ltxkeys@getinnovaluenopad \ltxkeys@debug{==}{Setting\@space\ifltxkeys@preset preset\@space\fi key: \ltxkeys@currtriple,\InnocentVal}% }{}% @@ -3248,7 +3318,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifboolTF{ltxkeys@sv}{% \ltxkeys@addtosavedvalue\ltxkeys@tkey\ltxkeys@tval }{}% - \ifboolTF{ltxkeys@noval}{% + \ifboolTF{ltxkeys@novalue}{% \ifcsndefTF{\ltxkeys@hdr needvaluekeys}{\ltxkeys@testneedvaluekey}{}% \ifcsndefTF{\ltxkeys@hdr\ltxkeys@tkey @default}{% \ltxkeys@debug{==}{\ifltxkeys@preset Preset key\else Key\fi\@space @@ -3257,7 +3327,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \usename{\ltxkeys@hdr\ltxkeys@tkey @default}\ltxkeys@nil }{% \ltxkeys@err{No value specified for key '\ltxkeys@tkey'} - \ltxkeys@ehc + \ltxkeys@ehd }% }{% \s@expandarg\ltxkeys@replacepointers\ltxkeys@tval @@ -3299,7 +3369,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% \xaftercsname\reserved@a{\ltxkeys@hdr\ltxkeys@tkey @default}\ltxkeys@nil \ifboolTF{ltxkeys@tracingkeys}{% - \ltxkeys@getinnovalnopad + \ltxkeys@getinnovaluenopad \ltxkeys@debug{==}{% \ifltxkeys@preset Preset key\else Key\fi\@space '\ltxkeys@tkey', macro being executed now% @@ -3309,7 +3379,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifmacroTF{#1}{% \expandafter#1\expandafter{\ltxkeys@tval}\relax }{% - \ltxkeys@err{Faulty key macro '\detokenize{#1}'}\ltxkeys@ehc + \ltxkeys@err{Faulty key macro '\detokenize{#1}'}\ltxkeys@ehd }% \cpt@popstate\ltxkeys@setkeys\ltxkeys@keydepth \ltxkeys@debug{++}{% @@ -3342,7 +3412,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \edef\ltxkeys@tval{\unexpanded{#1}}% \ifltxkeys@swa \ifltxkeys@tracingkeys - \ltxkeys@getinnovalnopad + \ltxkeys@getinnovaluenopad \ltxkeys@debug{++}{Key '\ltxkeys@tkey', value inherited from '\ltxkeys@tempb'}% \fi @@ -3366,7 +3436,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% }{% - \ltxkeys@err{No value recorded for key '#2'}\ltxkeys@ehc + \ltxkeys@err{No value recorded for key '#2'}\ltxkeys@ehd \ltxkeys@r@placepointers }% }% @@ -3377,7 +3447,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@st@revalue#1#2{% \ifinsetFT{,}{#1}{}{% \ltxkeys@err{Illegal multiple keys for - \string\ltxkeys@storevalue}\ltxkeys@ehc + \string\ltxkeys@storevalue}\ltxkeys@ehd }% \ifescapedTF{#2}{}{\cpt@notescapederr{#2}}% \ltxkeys@getsavedvalue{#1}{% @@ -3400,9 +3470,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \let#2=\reserved@a }% } -\robust@def*\ltxkeys@getinnoval{\ltxkeys@swatrue\ltxkeys@g@tinnoval} -\robust@def*\ltxkeys@getinnovalnopad{\ltxkeys@swafalse\ltxkeys@g@tinnoval} -\robust@def*\ltxkeys@g@tinnoval{% +\robust@def*\ltxkeys@getinnovalue{\ltxkeys@swatrue\ltxkeys@g@tinnovalue} +\robust@def*\ltxkeys@getinnovaluenopad{\ltxkeys@swafalse\ltxkeys@g@tinnovalue} +\robust@def*\ltxkeys@g@tinnovalue{% \begingroup \ltxkeys@ifcsemptyTF\ltxkeys@tval{% \def\InnocentVal{???}% @@ -3435,7 +3505,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \postgroupdef\InnocentVal\endgroup } \robust@def*\ltxkeys@keyvalerr{% - \ltxkeys@getinnovalnopad + \ltxkeys@getinnovaluenopad \ltxkeys@err{Erroneous value '\InnocentVal' for key or option \MsgBrk'\ltxkeys@tkey'}{Invalid key value encountered.}% } @@ -3445,7 +3515,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ } \robust@def*\ltxkeys@unkn@wnkeyhandler[#1]#2#3{% \begintoksgroup - \toks1{##1##2##3##4{\ltxkeys@getinnovalnopad#3}}% + \toks1{##1##2##3##4{\ltxkeys@getinnovaluenopad#3}}% \def\ltxkeys@do##1{% \ltxkeys@makepf{##1}% \def\ltxkeys@do####1{% @@ -3456,9 +3526,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% }% - \ltxkeys@parse1{#2}% + \ltxkeys@listparse1{#2}% }% - \ltxkeys@parse1{#1}% + \ltxkeys@listparse1{#1}% \endtoksgroup } \robust@def*\ltxkeys@logunknownkeys{% @@ -3498,13 +3568,13 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \expandafter\align@do\ltxkeys@tempc\\\\\\\\\\\\\\\\\\\@@ \edef\ltxkeys@msg{\expandcsonce\ltxkeys@msg####1\ltxkeys@skipb}% }% - \ltxkeys@parse1{##1,##2,##3,##4}% + \ltxkeys@listparse1{##1,##2,##3,##4}% \typeout{\ltxkeys@msg}% }% \def\ltxkeys@do##1{% \ltxkeys@splita##1\ltxkeys@nil }% - \ltxkeys@parse*0[;]\ltxkeys@tempa + \ltxkeys@listparse*0[;]\ltxkeys@tempa \typeout{\ltxkeys@skipa*******************}% \endgroup } @@ -3530,9 +3600,9 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@makehdr{####1}% \ltxkeys@dis@bl@k@ys }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs } \robust@def*\ltxkeys@dis@bl@k@ys{% \begingroup @@ -3568,7 +3638,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ family '\ltxkeys@tfam'}% }% }% - \ltxkeys@parse*0\ltxkeys@keys + \ltxkeys@listparse*0\ltxkeys@keys \cptpassexpanded{\endgroup \csn@def{\ltxkeys@hdr disabledkeys}{\ltxkeys@dkeys}% \noexpand\ltxkeys@disabletrue @@ -3578,7 +3648,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ } \robust@def*\ltxkeys@nostarform#1#2{% \if\detokenize{#1*.}% - \ltxkeys@err{No star (*) form of command \string#2}\ltxkeys@ehc + \ltxkeys@err{No star (*) form of command \string#2}\ltxkeys@ehd \fi } \robust@def*\ltxkeys@declareoption{% @@ -3699,7 +3769,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \robust@def*\ltxkeys@processoptions{% \ifcsndefTF{\@currname @\@currext @ltxkeys@beginprocessopt}{% \ltxkeys@err{\noexpand\ltxkeys@processoptions issued twice - in same \@cls@pkg '\@currname'}\ltxkeys@ehc + in same \@cls@pkg '\@currname'}\ltxkeys@ehd }{% \csn@def{\@currname @\@currext @ltxkeys@beginprocessopt}{}% }% @@ -3736,7 +3806,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% \ltxkeys@ifcsemptyTF\ltxkeys@classoptionslist{} - {\ltxkeys@parse*0\ltxkeys@classoptionslist}% + {\ltxkeys@listparse*0\ltxkeys@classoptionslist}% }% }% \edef\ltxkeys@tempa{\cpt@optionlist{\@currname.\@currext}}% @@ -3758,7 +3828,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% }% - \ltxkeys@parse*0\ltxkeys@keynames + \ltxkeys@listparse*0\ltxkeys@keynames \ifcsndefFT{\ltxkeys@hdr optionkeys}{}{% \letcstocsn\ltxkeys@tempb{\ltxkeys@hdr poxkeys}% \ifdefTF\ltxkeys@tempb{}{\def\ltxkeys@tempb{}}% @@ -3769,13 +3839,13 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }% }% }% - \aftercsname{\ltxkeys@parse*0}{\ltxkeys@hdr optionkeys}% + \aftercsname{\ltxkeys@listparse*0}{\ltxkeys@hdr optionkeys}% \gletcsntocs{\ltxkeys@hdr poxkeys}\ltxkeys@tempb }% }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs \undefcs\ltxkeys@poxlist \csn@def{\ltxkeys@hdr rmkeys}{}% \ltxkeys@pxopfalse @@ -3802,7 +3872,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ltxkeys@ifk@yd@f }% }% - \ltxkeys@parse*0\ltxkeys@prefs + \ltxkeys@listparse*0\ltxkeys@prefs \ltxkeys@ifchcfd#1\endgroup } \robust@def*\ltxkeys@ifk@yd@f{% @@ -3812,7 +3882,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \cpt@choicefdtrue\loopbreak }{}% }% - \ltxkeys@parse*0\ltxkeys@fams + \ltxkeys@listparse*0\ltxkeys@fams } \robust@def*\ltxkeysglobal{\ltxkeys@globaltrue} \robust@def*\ltxkeysprotected{\ltxkeys@protectedtrue} @@ -3916,13 +3986,13 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \advance\@tempcnta\@ne \ifnum\@tempcnta>#1\relax \ltxkeys@err{Number of delimiters exceeds - number of parameters}\ltxkeys@ehc + number of parameters}\ltxkeys@ehd \fi \xifinsetTF{,\expandcsonce\ltxkeys@tempa,}% {,1,2,3,4,5,6,7,8,9,}{}{% \ltxkeys@err{Invalid delimiter syntax: \MsgBrk no digit [1-9] found before - delimiter}\ltxkeys@ehc + delimiter}\ltxkeys@ehd }% \csn@edef{d\ltxkeys@tempa}{\cpttrimspace{##2}}% \@do @@ -3934,7 +4004,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \ifx\ltxkeys@tempb\@gobble\else \expandafter\ifx\csname d1\endcsname\@empty\else \ltxkeys@err{First argument of command \string#2 is - \MsgBrk already delimited by '[]'}\ltxkeys@ehc + \MsgBrk already delimited by '[]'}\ltxkeys@ehd \fi \fi \fi @@ -3968,7 +4038,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \usename{#1@\cpttrimspace{##1}}% }{% \ltxkeys@err{Key '\cpttrimspace{##1}' not defined by - command '\@backslashchar#1'}\ltxkeys@ehc + command '\@backslashchar#1'}\ltxkeys@ehd }% }% \def\ifkeyval##1\then{% @@ -3976,7 +4046,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ \usename{if#1@\cpttrimspace{##1}}% }{% \ltxkeys@err{Key '\cpttrimspace{##1}' not defined by - command '\@backslashchar#1'}\ltxkeys@ehc + command '\@backslashchar#1'}\ltxkeys@ehd }% }% \def\ifkeyvalTF##1{% @@ -4216,7 +4286,7 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{% \ifblankTF{#1}{% \ltxkeys@err{Invalid empty value for 'keydepthlimit'} - \ltxkeys@ehc + \ltxkeys@ehd }{% \xdef\cpt@optionstacklimit{\number0#1}% }% @@ -4226,23 +4296,19 @@ $Id: ltxkeys.sty,v 0.0.3b 2012/10/14 09:00:00 Ahmed Musa Exp $ }{% \ltxkeys@setaliaskey{keydepthlimit}% } -\ltxkeys@declarebooloption[KV]<ltxkeys>[ltxkeys@]{pathkeys}[true]{% - \ifltxkeys@pathkeys - \ltxkeys@afterprocessoptions{\RequirePackage{pathkeys}}% - \fi +\ltxkeys@declarebooloptions[KV]<ltxkeys>[ltxkeys@]{% + tracingkeys,reservenopath +}[true]{} +\ltxkeys@declarebooloption[KV]<ltxkeys>[ltxkeys@]{allowemptypath}[true]{% + \ifltxkeys@allowemptypath\ltxkeys@useemptytrue\fi } -\ltxkeys@declarebooloptions[KV]<ltxkeys>[ltxkeys@] - {tracingkeys,reservenopath}[true]{} -\ltxkeys@declarebooloption[KV]<ltxkeys>[ltxkeys@]{allowemptypath} - [true]{\ifltxkeys@allowemptypath\ltxkeys@useemptytrue\fi} -\ltxkeys@executeoptions[KV]<ltxkeys> - {keyparser,keydepthlimit=4}\relax +\ltxkeys@executeoptions[KV]<ltxkeys>{keyparser,keydepthlimit=4}\relax \ltxkeys@processoptions*[KV]<ltxkeys>\relax \cpt@optioncleanup\ltxkeys@processedoptions -\robust@def*\ltxkeys@options#1{% +\robust@def*\setltxkeysoptions#1{% \ifblankTF{#1}{}{\ltxkeys@setkeys[KV]{ltxkeys}{#1}}% } |