summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-05-25 23:24:12 +0000
committerKarl Berry <karl@freefriends.org>2010-05-25 23:24:12 +0000
commit4f3e4613ddeb2c1d348b92e964efe670915184c8 (patch)
tree0a13254141e5b110e0f2135730fd054e67e8adff /Master/texmf-dist/tex/latex
parent30ffebfa9605d5de08c5f6158caa022ac3a8cb4a (diff)
skeyval update (25may10)
git-svn-id: svn://tug.org/texlive/trunk@18494 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/skeyval/skeyval.sty1099
1 files changed, 669 insertions, 430 deletions
diff --git a/Master/texmf-dist/tex/latex/skeyval/skeyval.sty b/Master/texmf-dist/tex/latex/skeyval/skeyval.sty
index 78727c65eb1..e82d269e76f 100644
--- a/Master/texmf-dist/tex/latex/skeyval/skeyval.sty
+++ b/Master/texmf-dist/tex/latex/skeyval/skeyval.sty
@@ -1,6 +1,6 @@
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
% %
-% This is file 'skeyval.sty', version 0.71. %
+% This is file 'skeyval.sty', version 0.72. %
% %
% This package and accompanying files may be distributed and/or %
% modified under the conditions of the LaTeX Project Public License, %
@@ -49,10 +49,12 @@
\AtEndOfPackage{%
\SKV@AfterPackageEnd{%
\SKV@restorecodes
- \SKV@Undef?{\SKV@setcode\SKV@restorecodes}%
+ \SKV@Undef!{\SKV@setcode\SKV@restorecodes}%
}%
}
\SKV@setcode{010}{12}% ^^J
+\SKV@setcode{032}{10}% SP
+\SKV@setcode{033}{12}% !
\SKV@setcode{036}{03}% $
\SKV@setcode{038}{03}% &
\SKV@setcode{040}{12}% (
@@ -64,6 +66,8 @@
\SKV@setcode{047}{12}% /
\SKV@setcode{058}{12}% :
\SKV@setcode{059}{12}% ;
+\SKV@setcode{060}{12}% >
+\SKV@setcode{062}{12}% <
\SKV@setcode{063}{12}% ?
\SKV@setcode{091}{12}% [
\SKV@setcode{093}{12}% ]
@@ -71,7 +75,7 @@
\SKV@setcode{126}{13}% ~
\def\SKV@rcsid$#1: #2 #3 #4 #5${#4 v#3}
\ProvidesPackage{skeyval}[%
- \SKV@rcsid $Id: skeyval.sty,v 0.71 2010/05/05 09:00:00 Ahmed Musa $
+ \SKV@rcsid $Id: skeyval.sty,v 0.72 2010/05/21 09:00:00 Ahmed Musa $
Extensions to the xkeyval parser (AM)
]
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
@@ -86,6 +90,7 @@
\newcount\SKV@depth
\protected\def\@nil{\@nil}
\def\@nnil{\@nil}
+\def\@space{ }
\long\def\@firstofthree#1#2#3{#1}
\long\def\@secondofthree#1#2#3{#2}
\long\def\@thirdofthree#1#2#3{#3}
@@ -117,9 +122,7 @@
\def\SKV@unifdefined#1{\@nameuse{SKV@\SKV@ifdefined{#1}{2}{1}of2}}
\def\SKV@ifcsname#1{\@nameuse{SKV@\ifcsname#1\endcsname1\else2\fi of2}}
\def\SKV@unifcsname#1{\@nameuse{SKV@\SKV@ifcsname{#1}{2}{1}of2}}
-\def\SKV@iftest#1#2{\@nameuse{if#1}#2\relax\expandafter\@firstoftwo
- \else\expandafter\@secondoftwo\fi}
-\def\SKV@uniftest#1#2{\SKV@iftest{#1}{#2}\@secondoftwo\@firstoftwo}
+\def\SKV@ifnum#1#2#3{\@nameuse{SKV@\ifnum#1#2#3 1\else2\fi of2}}
\protected\def\SKV@AtEndAfterPackageEnd#1{\AtEndOfPackage
{\SKV@AfterPackageEnd{#1}}}
\begingroup
@@ -176,29 +179,35 @@
\SKV@ifx{#1}\relax{\aftergroup\@firstofone}%
{\aftergroup\SKV@notdefinable}%
}{%
- \edef\resvd@b{\expandafter\SKV@carcube\resvd@a xxx\@nil}%
- \SKV@ifx\resvd@b\@qend{\aftergroup\SKV@notdefinable}%
- {\SKV@ifx\resvd@a\@qrelax{\aftergroup\SKV@notdefinable}%
- {\aftergroup\@firstofone}}%
+ \edef\resvd@b{\unexpanded\expandafter{\csname end\resvd@a\endcsname}}%
+ \expandafter\SKV@ifx\resvd@b\relax{%
+ \SKV@ifx\resvd@a\@qrelax{\aftergroup\SKV@notdefinable}%
+ {\aftergroup\@firstofone}
+ }{\aftergroup\SKV@notdefinable}%
}%
\endgroup
}
\def\SKV@csifdefinable#1{\begingroup\expandafter\endgroup
\expandafter\SKV@ifdefinable\csname#1\endcsname}
\newcommand*\@ifpackagecurrent[2]{%
- \@nameuse{SKV@\SKV@iftest{num}{\SKV@threexp\@parse@version
+ \@nameuse{SKV@\ifnum\SKV@threexp\@parse@version
\csname ver@#1.\@pkgextension\endcsname//00\@nil
- <\expandafter\@parse@version#2//00\@nil}{2}{1}of2}}
+ <\expandafter\@parse@version#2//00\@nil2\else1\fi of2}%
+}
\newcommand*\@ifpackagenotcurrent[2]{%
\@nameuse{SKV@\@ifpackagecurrent{#1}{#2}{2}{1}of2}}
-\@ifpackageloaded{xkeyval}{%
- \@ifpackagecurrent{xkeyval}{2008/08/13}{}{%
- \PackageError{skeyval}{Your loaded version of xkeyval
- package is not current}{You need version 2.6a
- (or higher) of xkeyval package.
- }%
- \endinput
- }%
+\newcommand*\@ifloadedandcurrent[2]{%
+ \begingroup
+ \@ifpackageloaded{#1}{%
+ \@ifpackagecurrent{#1}{#2}{\aftergroup\@firstofthree}{%
+ \aftergroup\@secondofthree}}{\aftergroup\@thirdofthree}%
+ \endgroup
+}
+\@ifloadedandcurrent{xkeyval}{2008/08/13}{}{%
+ \PackageError{skeyval}%
+ {Your loaded version of xkeyval package is not current}%
+ {You need version 2.6a (or higher) of xkeyval package.}%
+ \endinput
}{\RequirePackage{xkeyval}[2008/08/13]}
\newcommand*\SKV@ifdefinable@n[1]{%
\XKV@sp@deflist\SKV@tempa{#1}%
@@ -212,62 +221,56 @@
\SKV@csifdefinable\SKV@tempa\relax
}%
}
-\SKV@ifdefinable@n{SKV@def,SKV@@def,SKV@pdef,SKV@@pdef,
- SKV@gdef,SKV@@gdef,SKV@pgdef,SKV@@pgdef,SKV@edef,
- SKV@@edef,SKV@pedef,SKV@@pedef,SKV@redef,SKV@@redef,
- SKV@csredef,SKV@predef,SKV@@predef,SKV@cspredef,
- SKV@providedef,SKV@@providedef,SKV@providerobustdef,
- SKV@@providerobustdef
-}
-\protected\def\SKV@def{\@star@or@long\SKV@@def}
-\def\SKV@@def#1{\SKV@ifdefinable#1{\l@ngrel@x\def#1}}
-\protected\def\SKV@gdef{\@star@or@long\SKV@@gdef}
-\def\SKV@@gdef#1{\SKV@ifdefinable#1{\l@ngrel@x\gdef#1}}
-\protected\def\SKV@edef{\@star@or@long\SKV@@edef}
-\def\SKV@@edef#1{\SKV@ifdefinable#1{\l@ngrel@x\edef#1}}
-\protected\def\SKV@pdef{\@star@or@long\SKV@@pdef}
-\def\SKV@@pdef#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\def#1}}
-\protected\def\SKV@pgdef{\@star@or@long\SKV@@pgdef}
-\def\SKV@@pgdef#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\gdef#1}}
-\protected\def\SKV@pedef{\@star@or@long\SKV@@pedef}
-\def\SKV@@pedef#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\edef#1}}
-\protected\def\SKV@pxdef{\@star@or@long\SKV@@pxdef}
-\def\SKV@@pxdef#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\xdef#1}}
-\protected\def\SKV@redef{\@star@or@long\SKV@@redef}
-\def\SKV@@redef#1{%
+\SKV@ifdefinable@n{SKV@def,SKV@d@f,SKV@pdef,SKV@pd@f}
+\protected\def\SKV@def{\@star@or@long\SKV@d@f}
+\def\SKV@d@f#1{\SKV@ifdefinable#1{\l@ngrel@x\def#1}}
+\protected\def\SKV@pdef{\@star@or@long\SKV@pd@f}
+\def\SKV@pd@f#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\def#1}}
+\SKV@pdef*\SKV@gdef{\@star@or@long\SKV@gd@f}
+\SKV@def*\SKV@gd@f#1{\SKV@ifdefinable#1{\l@ngrel@x\gdef#1}}
+\SKV@pdef*\SKV@edef{\@star@or@long\SKV@ed@f}
+\SKV@def*\SKV@ed@f#1{\SKV@ifdefinable#1{\l@ngrel@x\edef#1}}
+\SKV@pdef*\SKV@pgdef{\@star@or@long\SKV@pgd@f}
+\SKV@def*\SKV@pgd@f#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\gdef#1}}
+\SKV@pdef*\SKV@pedef{\@star@or@long\SKV@ped@f}
+\SKV@def*\SKV@ped@f#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\edef#1}}
+\SKV@pdef*\SKV@pxdef{\@star@or@long\SKV@pxd@f}
+\SKV@def*\SKV@pxd@f#1{\SKV@ifdefinable#1{\l@ngrel@x\protected\xdef#1}}
+\SKV@pdef*\SKV@redef{\@star@or@long\SKV@red@f}
+\SKV@def*\SKV@red@f#1{%
\SKV@ensurescape{#1}%
\SKV@unifdefined{#1}{}{%
\SKV@ifx{#1}\relax{}{%
- \SKV@vbsmsg{info}{Command '\string#1' redefined\on@line}%
+ \SKV@vbmsg{info}{Command '\string#1' redefined\on@line}%
}%
}%
\l@ngrel@x\def#1%
}
-\protected\def\SKV@csredef{\SKV@aftercs\SKV@redef}
-\protected\def\SKV@predef{\@star@or@long\SKV@@predef}
-\def\SKV@@predef#1{%
+\SKV@pdef*\SKV@csredef{\SKV@aftercs\SKV@redef}
+\SKV@pdef*\SKV@predef{\@star@or@long\SKV@pred@f}
+\SKV@def*\SKV@pred@f#1{%
\SKV@ensurescape{#1}%
\SKV@unifdefined{#1}{}{%
\SKV@ifx{#1}\relax{}{%
- \SKV@vbsmsg{info}{Command '\string#1' redefined\on@line}%
+ \SKV@vbmsg{info}{Command '\string#1' redefined\on@line}%
}%
}%
\l@ngrel@x\protected\def#1%
}
-\protected\def\SKV@cspredef{\SKV@aftercs\SKV@predef}
-\SKV@def\SKV@vbsmsg#1#2{%
+\SKV@pdef*\SKV@cspredef{\SKV@aftercs\SKV@predef}
+\SKV@def*\SKV@vbmsg#1#2{%
\begingroup
\def\@i{info}\def\@ii{warn}\def\@iii{#1}%
- \csname SKV@\ifSKV@verbose1\else2\fi of2\endcsname
+ \@nameuse{SKV@\ifSKV@verbose1\else2\fi of2}%
{\SKV@ifx\@i\@iii
{\SKV@info{#2}}%
{\SKV@ifx\@ii\@iii{\SKV@warn{#2}}{}}%
}{}%
\endgroup
}
-\define@boolkeys[KV]{skeyval@i}[SKV@]{tempsw,st,pl,ask,rt,
- lt,sk,loc,uv}[true]
-\setkeys[KV]{skeyval@i}{tempsw,st,pl,ask,rt,lt,sk,loc,uv}
+\define@boolkeys[KV]{skeyval@i}[SKV@]{st,pl,cl,rt,
+ lt,sw,sk,loc,uv}[true]
+\setkeys[KV]{skeyval@i}{st,pl,cl,rt,lt,sw,sk,loc,uv}
\define@boolkey+[KV]{skeyval}[SKV@]{verbose}[true]{}{%
\SKV@inputerr{#1}{verbose}%
}
@@ -279,16 +282,22 @@
\SKV@pdef\SKV@afterfi#1\fi{\fi#1}
\SKV@pdef\SKV@afterelsefi#1\else#2\fi{\fi#1}
\SKV@pdef\SKV@afterfifi#1\fi#2\fi{\fi#2\fi#1}
+\SKV@def*\SKV@badargerr#1#2{%
+ \SKV@err{Invalid #2 argument for command '\@backslashchar#1'}%
+ {Bad #2 argument for command '\@backslashchar#1'.\SKV@MB
+ You need to look again at user instruction\SKV@MB
+ for command '\@backslashchar#1'.}%
+}
\SKV@def*\SKV@state#1#2#3{%
\ifcase#1\relax
\def\SKV@ste{XKV@prefix,XKV@fams,XKV@tkey,XKV@na,ifXKV@st,%
ifXKV@pl,ifXKV@knf,CurrentOption,ifSKV@sk}%
\SKV@ifempty{#3}{\advance\XKV@depth\@ne}{}%
\or
- \def\SKV@ste{ifSKV@st,ifSKV@pl,ifSKV@ask,ifSKV@rt,ifSKV@lt}%
+ \def\SKV@ste{ifSKV@st,ifSKV@pl,ifSKV@cl,ifSKV@rt,ifSKV@lt}%
\SKV@ifempty{#3}{\advance\SKV@depth\@ne}{}%
\else
- \SKV@err{Unknown state identifier}%
+ \SKV@err{Unknown state identifier '#1'}%
{I expected '\string#1' to be number 0 or 1.}%
\fi
\XKV@for@o\SKV@ste\SKV@ste{%
@@ -305,24 +314,53 @@
\SKV@def*\SKV@savstate{\SKV@state{1}{@\romannumeral\SKV@depth}{}}
\SKV@def*\SKV@resstate{\SKV@state{1}{}{@\romannumeral\SKV@depth}}
\def\XKV@srstate#1#2{\SKV@state{0}{#1}{#2}}
-\SKV@def*\SKV@scantoksa{\SKV@testopt\SKV@sc@ntoksa{,}}
+\SKV@def*\SKV@scantoksa{\SKV@savstate\SKV@testoptf\SKV@sc@ntoksa}
\SKV@def\SKV@sc@ntoksa[#1]#2{%
+ \ifSKV@cl\let\gl@l@x\global\else\let\gl@l@x\relax\fi
\SKV@for[#1]{#2}\SKV@resvda{%
- \SKV@expnext\SKV@ensurescape\SKV@resvda
+ \ifSKV@pl
+ \SKV@ifcsdef\SKV@resvda{}{%
+ \SKV@err{Command '\SKV@csexpox\SKV@resvda' undefined}%
+ {I can't scan contents of undefined command
+ '\SKV@csexpox\SKV@resvda'}%
+ }%
+ \SKV@expnext\SKV@ensurenoscape\SKV@resvda
+ \expandafter\let\expandafter\SKV@resvdb%
+ \csname\SKV@resvda\endcsname
+ \else
+ \expandafter\SKV@ifdef\SKV@resvda{}{%
+ \SKV@err{Command '\SKV@expox\SKV@resvda' undefined}%
+ {I can't scan contents of undefined command
+ '\SKV@expox\SKV@resvda'}%
+ }%
+ \SKV@expnext\SKV@ensurescape\SKV@resvda
+ \expandafter\let\expandafter\SKV@resvdb\SKV@resvda
+ \fi
+ \SKV@noexpparse\SKV@resvdb
\begingroup
- \let\@xp\expandafter
- \edef\SKV@resvdb##1##2{##1{##2{\SKV@expox\SKV@resvda}}}%
- \everyeof{\noexpand}\endlinechar\m@ne
- \SKV@resvdb{\@xp\xdef\SKV@resvda}{\scantokens\@xp}%
+ \edef\SKV@resvdb##1##2{##1{##2{\SKV@expox\SKV@resvdb}}}%
+ \everyeof{\noexpand}\endlinechar\m@ne\makeatletter
+ \SKV@resvdb{\xdef\SKV@resvdb}{\scantokens\expandafter}%
\endgroup
+ \ifSKV@pl
+ \gl@l@x\SKV@aftercs\let\SKV@resvda\SKV@resvdb
+ \else
+ \gl@l@x\expandafter\let\SKV@resvda\SKV@resvdb
+ \fi
}%
+ \SKV@resstate
}
-\SKV@def*\SKV@emptycmds{\SKV@savstate\SKV@testoptd\SKV@em@tycmds}
+\SKV@def*\SKV@emptycmds{\SKV@savstate\SKV@testoptf\SKV@em@tycmds}
\SKV@def\SKV@em@tycmds[#1]#2{%
- \ifSKV@st\let\glob@lrel@x\global\else\let\glob@lrel@x\relax\fi
+ \ifSKV@cl\let\gl@l@x\global\else\let\gl@l@x\relax\fi
\SKV@for[#1]{#2}\SKV@resvda{%
- \SKV@expnext\SKV@ensurescape\SKV@resvda
- \glob@lrel@x\expandafter\let\SKV@resvda\@empty
+ \ifSKV@pl
+ \SKV@expnext\SKV@ensurenoscape\SKV@resvda
+ \gl@l@x\SKV@aftercs\let\SKV@resvda\@empty
+ \else
+ \SKV@expnext\SKV@ensurescape\SKV@resvda
+ \gl@l@x\expandafter\let\SKV@resvda\@empty
+ \fi
}%
\SKV@resstate
}
@@ -348,10 +386,14 @@
\SKV@pdef\SKV@expargs#1#2#3#4\@nil{%
\begingroup
\protected@edef\SKV@tempa{\endgroup
- \ifcase#1\relax\unexpanded{#2}{#3}%
- \or\unexpanded{#2#3}{#4}%
- \or\unexpanded{#2}{#3}{#4}%
- \or\unexpanded{#2}#3\unexpanded{#4}%
+ \ifcase#1\relax
+ \unexpanded{#2}{#3}%
+ \or
+ \unexpanded{#2#3}{#4}%
+ \or
+ \unexpanded{#2}{#3}{#4}%
+ \or
+ \unexpanded{#2}#3\unexpanded{#4}%
\else
\SKV@err{Unknown expansion type '\string#1' for
\string\SKV@expargs}{I expected your first
@@ -393,6 +435,7 @@
\SKV@pdef*\SKV@ifstar{\SKV@ifchar{*}}
\SKV@pdef*\SKV@ifplus{\SKV@ifchar{+}}
\SKV@pdef*\SKV@ifask{\SKV@ifchar{?}}
+\SKV@pdef*\SKV@ifclam{\SKV@ifchar{!}}
\SKV@pdef*\SKV@ifright{\SKV@ifchar{>}}
\SKV@pdef*\SKV@ifleft{\SKV@ifchar{<}}
\SKV@pdef*\SKV@if@brack#1#2{\SKV@ifnextchar[{#1}{#2}}
@@ -402,7 +445,7 @@
\SKV@pdef*\SKV@testopta#1{\SKV@t@stopta{\SKV@t@st@pta{#1}}}
\SKV@pdef*\SKV@t@stopta#1{\SKV@ifstar{\SKV@sttrue#1}{\SKV@stfalse#1}}
\SKV@pdef*\SKV@t@st@pta#1{\SKV@ifplus{\SKV@pltrue#1}{\SKV@plfalse#1}}
-\SKV@pdef*\SKV@t@st@p@a#1{\SKV@ifask{\SKV@asktrue#1}{\SKV@askfalse#1}}
+\SKV@pdef*\SKV@t@st@p@a#1{\SKV@ifclam{\SKV@cltrue#1}{\SKV@clfalse#1}}
\SKV@pdef*\SKV@testoptb#1{\SKV@t@stopta{\SKV@t@st@pta{\SKV@t@st@p@a{#1}}}}
\SKV@pdef*\SKV@t@stoptb#1{\SKV@t@stopta{\SKV@t@st@pta{#1}}}
\SKV@pdef*\SKV@testoptc#1{\SKV@t@st@pta{\SKV@t@st@p@a{#1}}}
@@ -432,27 +475,47 @@
\SKV@pdef*\csnewbox{\SKV@csalloc{box}}
\SKV@pdef*\csnewwrite{\SKV@csalloc{write}}
\SKV@pdef*\csnewread{\SKV@csalloc{read}}
-\SKV@pdef*\NewWrites{\SKV@testopt\SKV@NewWrites{}}
+\SKV@pdef*\NewWrites{\SKV@swtrue\SKV@testopt\SKV@NewWrites{}}
+\SKV@pdef*\DefWrites{\SKV@swfalse\SKV@testopt\SKV@NewWrites{}}
\SKV@def*\SKV@NewWrites[#1]#2{%
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
- \SKV@csifdefinable{#1\SKV@tempa}{%
- \csnewwrite{#1\SKV@tempa}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Write stream '\@backslashchar
+ #1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \csnewwrite{#1\SKV@tempa}%
}%
}
-\SKV@pdef*\NewReads{\SKV@testopt\SKV@NewReads{}}
+\SKV@pdef*\NewReads{\SKV@swtrue\SKV@testopt\SKV@NewReads{}}
+\SKV@pdef*\DefReads{\SKV@swfalse\SKV@testopt\SKV@NewReads{}}
\SKV@def*\SKV@NewReads[#1]#2{%
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
- \SKV@csifdefinable{#1\SKV@tempa}{%
- \csnewread{#1\SKV@tempa}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Read stream '\@backslashchar
+ #1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \csnewread{#1\SKV@tempa}%
}%
}
-\SKV@pdef*\NewIfs{\SKV@testopt\SKV@NewIfs{}}
+\SKV@pdef*\NewIfs{\SKV@swtrue\SKV@testopt\SKV@NewIfs{}}
+\SKV@pdef*\DefIfs{\SKV@swfalse\SKV@testopt\SKV@NewIfs{}}
\SKV@def*\SKV@NewIfs[#1]#2{\SKV@testopt{\SKV@N@wIfs[#1]{#2}}{false}}
\SKV@def*\SKV@N@wIfs[#1]#2[#3]{%
+ \ifSKV@sw
+ \SKV@getswstate\NewIfs{#3}%
+ \else
+ \SKV@getswstate\DefIfs{#3}%
+ \fi
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
\begingroup
@@ -462,10 +525,16 @@
{\SKV@oifstrequal{\SKV@tempa}{tog}{\SKV@swnameerr{tog}}%
{\SKV@oifstrequal{\SKV@tempa}{switch}{\SKV@swnameerr{switch}}%
{}}}}}\endgroup
- \SKV@csifdefinable{if#1\SKV@tempa}{%
- \SKV@aftercs\SKV@N@wIf@{if#1\SKV@tempa}%
- \@nameuse{#1\SKV@tempa#3}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{if#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{if#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Boolean '\@backslashchar
+ if#1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \SKV@aftercs\SKV@N@wIf@{if#1\SKV@tempa}%
+ \@nameuse{#1\SKV@tempa\SKV@swval}%
}%
}
\SKV@def*\SKV@N@wIf@#1{%
@@ -483,11 +552,16 @@
\SKV@aftercs\def{\expandafter\@gobbletwo\string#1%
\expandafter\@gobbletwo\string#2}{\let#1#2}%
}
-\SKV@pdef*\NewBooleans{\SKV@testopt\SKV@NewBooleans{}}
+\SKV@pdef*\NewBooleans{\SKV@swtrue\SKV@testopt\SKV@NewBooleans{}}
+\SKV@pdef*\DefBooleans{\SKV@swfalse\SKV@testopt\SKV@NewBooleans{}}
\SKV@def*\SKV@NewBooleans[#1]#2{%
- \SKV@testopt{\SKV@N@wBooleans[#1]{#2}}{false}}
-\SKV@def*\SKV@N@wBooleans[#1]#2[#3]{%
- \SKV@getswstate\NewBooleans{#3}%
+ \SKV@testopt{\SKV@B@oleans[#1]{#2}}{false}}
+\SKV@def*\SKV@B@oleans[#1]#2[#3]{%
+ \ifSKV@sw
+ \SKV@getswstate\NewBooleans{#3}%
+ \else
+ \SKV@getswstate\DefBooleans{#3}%
+ \fi
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
\SKV@oifstrequal{\SKV@tempa}{tog}{%
@@ -497,72 +571,120 @@
\SKV@err{'switch' not allowed as a boolean name}\@ehc
}{}%
}%
- \SKV@csifdefinable{if#1\SKV@tempa}{%
- \csnewif{if#1\SKV@tempa}%
- \@nameuse{#1\SKV@tempa\SKV@resvd}%
+ \SKV@ifstrnotequal{#1\SKV@tempa}{x}{}{%
+ \SKV@err{'\string\ifx' is a TeX primitive}%
+ {Why do you want to redefine '\string\ifx'? This is dangerous.}%
}%
+ \ifSKV@sw
+ \SKV@csifdefinable{if#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{if#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Switch '\@backslashchar if#1\SKV@tempa'
+ redefined\on@line}%
+ }%
+ \fi
+ \csnewif{if#1\SKV@tempa}%
+ \@nameuse{#1\SKV@tempa\SKV@swval}%
}%
}
-\SKV@pdef*\NewTogs{\SKV@testopt\SKV@NewTogs{}}
+\SKV@pdef*\NewTogs{\SKV@swtrue\SKV@testopt\SKV@NewTogs{}}
+\SKV@pdef*\DefTogs{\SKV@swfalse\SKV@testopt\SKV@NewTogs{}}
\SKV@def*\SKV@NewTogs[#1]#2{\SKV@testopt{\SKV@NewT@gs[#1]{#2}}{false}}
\SKV@def*\SKV@NewT@gs[#1]#2[#3]{%
- \SKV@getswstate\NewTogs{#3}%
+ \ifSKV@sw
+ \SKV@getswstate\NewTogs{#3}%
+ \else
+ \SKV@getswstate\DefTogs{#3}%
+ \fi
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
\edef\SKV@tempa{#1\SKV@tempa}%
- \SKV@expnext\newtog\SKV@tempa
- \@nameuse{tog\SKV@resvd\SKV@expnext}\SKV@tempa
+ \ifSKV@sw
+ \SKV@expnext\newtog\SKV@tempa
+ \else
+ \SKV@expnext\deftog\SKV@tempa
+ \fi
+ \SKV@expargs{0}{\@nameuse{tog\SKV@swval}}\SKV@tempa\@nil
}%
}
-\SKV@pdef*\NewToks{\SKV@testopt\SKV@NewToks{}}
+\SKV@pdef*\NewToks{\SKV@swtrue\SKV@testopt\SKV@NewToks{}}
+\SKV@pdef*\DefToks{\SKV@swfalse\SKV@testopt\SKV@NewToks{}}
\SKV@def*\SKV@NewToks[#1]#2{%
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
- \SKV@csifdefinable{#1\SKV@tempa}{%
- \csnewtoks{#1\SKV@tempa}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Token register '\@backslashchar
+ #1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \csnewtoks{#1\SKV@tempa}%
}%
}
-\SKV@pdef*\NewCounts{\SKV@testopt\SKV@NewCounts{}}
+\SKV@pdef*\NewCounts{\SKV@swtrue\SKV@testopt\SKV@NewCounts{}}
+\SKV@pdef*\DefCounts{\SKV@swfalse\SKV@testopt\SKV@NewCounts{}}
\SKV@def*\SKV@NewCounts[#1]#2{%
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
- \SKV@csifdefinable{#1\SKV@tempa}{%
- \csnewcount{#1\SKV@tempa}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Counter register '\@backslashchar
+ #1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \csnewcount{#1\SKV@tempa}%
}%
}
-\SKV@pdef*\NewDimens{\SKV@testopt\SKV@NewDimens{}}
+\SKV@pdef*\NewDimens{\SKV@swtrue\SKV@testopt\SKV@NewDimens{}}
+\SKV@pdef*\DefDimens{\SKV@swfalse\SKV@testopt\SKV@NewDimens{}}
\SKV@def*\SKV@NewDimens[#1]#2{%
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
- \SKV@csifdefinable{#1\SKV@tempa}{%
- \csnewdimen{#1\SKV@tempa}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Dimension register '\@backslashchar
+ #1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \csnewdimen{#1\SKV@tempa}%
}%
}
-\SKV@pdef*\NewBoxes{\SKV@testopt\SKV@NewBoxes{}}
+\SKV@pdef*\NewBoxes{\SKV@swtrue\SKV@testopt\SKV@NewBoxes{}}
+\SKV@pdef*\DefBoxes{\SKV@swfalse\SKV@testopt\SKV@NewBoxes{}}
\SKV@def*\SKV@NewBoxes[#1]#2{%
\SKV@for[,]{#2}\SKV@tempa{%
\SKV@expnext\SKV@ensurenoscape\SKV@tempa
- \SKV@csifdefinable{#1\SKV@tempa}{%
- \csnewbox{#1\SKV@tempa}%
- }%
+ \ifSKV@sw
+ \SKV@csifdefinable{#1\SKV@tempa}\relax
+ \else
+ \SKV@ifcsundef{#1\SKV@tempa}{}{%
+ \SKV@vbmsg{warn}{Box register '\@backslashchar
+ #1\SKV@tempa' redefined\on@line}%
+ }%
+ \fi
+ \csnewbox{#1\SKV@tempa}%
}%
}
\SKV@def\SKV@expnext#1#2{%
\SKV@ifblank{#1}{%
- \SKV@err{Arguments of '\string\SKV@expnext' can't be empty}\@ehc
+ \SKV@badargerr{SKV@expnext}{first}%
}{%
\SKV@ifblank{#2}{%
- \SKV@err{Arguments of '\string\SKV@expnext' can't be empty}\@ehc
+ \SKV@badargerr{SKV@expnext}{second}%
}{%
- \SKV@iftest{cat}{$\detokenize\expandafter{\SKV@cdr#1\@nil}$}{%
+ \ifcat$\detokenize\expandafter{\SKV@cdr#1\@nil}$%
+ \SKV@afterelsefi
\expandafter#1\expandafter{#2}%
- }{%
- \SKV@err{Invalid arguments '\string#1' for
- '\string\SKV@expnext'}\@ehc
- }%
+ \else
+ \SKV@afterfi
+ \SKV@badargerr{SKV@expnext}{first}%
+ \fi
}%
}%
}
@@ -621,17 +743,17 @@
\SKV@def*\SKV@sp@def#1#2{%
\edef\@sp@def{\the\SKV@toks}%
\SKV@toks\expandafter{%
- \romannumeral-`\q\SKV@@sp@def\noexpand\noexpand#1& &}%
+ \romannumeral-`\q\SKV@sp@d@f\noexpand\noexpand#1& &}%
\edef#2{\the\SKV@toks}%
\SKV@toks\expandafter{\@sp@def}%
\SKV@undef\@sp@def
}
-\SKV@def*\SKV@@sp@def#1 &{\SKV@@sp@d@f#1&}
-\SKV@def*\SKV@@sp@d@f#1&#2{\romannumeral-`\q#1}
+\SKV@def*\SKV@sp@d@f#1 &{\SKV@sp@d@f@#1&}
+\SKV@def*\SKV@sp@d@f@#1&#2{\romannumeral-`\q#1}
\SKV@def*\SKV@expox#1{\unexpanded\expandafter{#1}}
-\SKV@def*\SKV@expcsox#1{\SKV@aftercs\SKV@expox{#1}}
+\SKV@def*\SKV@csexpox#1{\SKV@aftercs\SKV@expox{#1}}
\SKV@def*\SKV@exptx#1{\unexpanded\SKV@threexp{#1}}
-\SKV@def*\SKV@expcstx#1{\SKV@aftercs\SKV@exptx{#1}}
+\SKV@def*\SKV@csexptx#1{\SKV@aftercs\SKV@exptx{#1}}
\SKV@def\SKV@noexpcs#1{\unexpanded\expandafter{\csname#1\endcsname}}
\SKV@pdef*\SKV@undef#1{\let#1\SKV@undefined}
\SKV@pdef*\SKV@gundef{\global\SKV@undef}
@@ -639,15 +761,15 @@
\SKV@pdef*\SKV@csgundef{\global\SKV@csundef}
\SKV@def*\SKV@undeflist{\SKV@savstate\SKV@t@st@p@a\SKV@und@flist}
\SKV@def*\SKV@und@flist#1{%
- \ifSKV@ask\let\glob@lrel@x\global\else\let\glob@lrel@x\relax\fi
+ \ifSKV@cl\let\gl@l@x\global\else\let\gl@l@x\relax\fi
\XKV@for@n{#1}\SKV@resvd{%
\SKV@expnext\SKV@ensurescape\SKV@resvd
- \glob@lrel@x\expandafter\SKV@undef\SKV@resvd
+ \gl@l@x\expandafter\SKV@undef\SKV@resvd
}%
\SKV@resstate
}
-\SKV@pdef*\SKV@Undef{\SKV@savstate\SKV@testopte\SKV@@Undef}
-\SKV@def*\SKV@@Undef[#1]#2{%
+\SKV@pdef*\SKV@Undef{\SKV@savstate\SKV@testopte\SKV@Und@f}
+\SKV@def*\SKV@Und@f[#1]#2{%
\ifSKV@st
\ifSKV@pl
\def\SKV@ndl{\SKV@for*[#1]#2}%
@@ -664,11 +786,11 @@
\SKV@ndl\SKV@ndl{%
\ifSKV@pl
\SKV@despacectt\SKV@ndl
- \ifSKV@ask\expandafter\global\fi
+ \ifSKV@cl\expandafter\global\fi
\SKV@threexp\let
\expandafter\csname\SKV@ndl\endcsname\SKV@undefined
\else
- \ifSKV@ask\expandafter\global\fi
+ \ifSKV@cl\expandafter\global\fi
\expandafter\let\SKV@ndl\SKV@undefined
\fi
}%
@@ -686,11 +808,11 @@
}
\SKV@def*\SKV@ifcsundef#1{\@nameuse{SKV@\SKV@ifcsdef{#1}{2}{1}of2}}
\SKV@def*\SKV@ifonedef#1{%
- \def\SKV@resvda{#1}\SKV@tempswtrue
- \XKV@whilist\SKV@resvda\SKV@resvdb\ifSKV@tempsw\fi{%
- \SKV@oifdefined\SKV@resvdb\SKV@tempswfalse\SKV@tempswtrue
+ \def\SKV@resvda{#1}\SKV@swtrue
+ \XKV@whilist\SKV@resvda\SKV@resvdb\ifSKV@sw\fi{%
+ \SKV@oifdefined\SKV@resvdb\SKV@swfalse\SKV@swtrue
}%
- \@nameuse{SKV@\ifSKV@tempsw2\else1\fi of2}%
+ \@nameuse{SKV@\ifSKV@sw2\else1\fi of2}%
}
\SKV@def\DeclarePackageCommand#1#2{%
\SKV@ensurescape{#2}%
@@ -701,54 +823,37 @@
{##1Saved\resvd@a\noexpand\endcsname}}%
\resvd@a{\expandafter\let\expandafter#2\csname}%
\SKV@undef\resvd@a
- }{\SKV@AtEndAfterPackageEnd{\SKV@Undef?#2}}%
+ }{\SKV@AtEndAfterPackageEnd{\SKV@Undef!#2}}%
#1#2%
}
-\SKV@pdef*\SKV@providedef{\@star@or@long\SKV@pr@videdef}
-\SKV@def\SKV@pr@videdef#1{%
- \SKV@ensurescape{#1}%
- \edef\SKV@prov@d{\expandafter\@gobble\string#1}%
- \SKV@aftercs\let{SKV@test@\SKV@prov@d}\SKV@undefined
- \SKV@ifdef#1{%
- \SKV@vbsmsg{info}{Command '\string#1' already defined:\SKV@MB
- Not redefined\on@line}%
- \SKV@afterassignment{\SKV@gundef\SKV@pr@vid}%
- \def\SKV@pr@vid
- }{%
- \SKV@afterassignment{%
- \SKV@aftercs\edef{SKV@test@\SKV@prov@d}%
- {\expandafter\strip@prefix\meaning#1}%
- }%
- \l@ngrel@x\def#1%
- }%
-}
-\SKV@pdef*\SKV@providerobustdef{\@star@or@long\SKV@pr@viderobustdef}
-\SKV@def\SKV@pr@viderobustdef#1{%
- \SKV@ensurescape{#1}%
- \edef\SKV@prov@d{\expandafter\@gobble\string#1}%
+\SKV@pdef*\SKV@providedef{\@star@or@long{\SKV@pr@videdef{}}}
+\SKV@pdef*\SKV@providerobustdef{\@star@or@long{\SKV@pr@videdef\protected}}
+\SKV@def\SKV@pr@videdef#1#2{%
+ \SKV@ensurescape{#2}%
+ \edef\SKV@prov@d{\expandafter\@gobble\string#2}%
\SKV@aftercs\let{SKV@test@\SKV@prov@d}\SKV@undefined
- \SKV@ifdef#1{%
- \SKV@vbsmsg{info}{Command '\string#1' already defined:\SKV@MB
+ \SKV@ifdef#2{%
+ \SKV@vbmsg{info}{Command '\string#2' already defined:\SKV@MB
Not redefined\on@line}%
\SKV@afterassignment{\SKV@gundef\SKV@pr@vid}%
\def\SKV@pr@vid
}{%
\SKV@afterassignment{%
\SKV@aftercs\edef{SKV@test@\SKV@prov@d}%
- {\expandafter\strip@prefix\meaning#1}%
+ {\expandafter\strip@prefix\meaning#2}%
}%
- \l@ngrel@x\protected\def#1%
+ \l@ngrel@x#1\def#2%
}%
}
\SKV@def\TestProvidedCommand#1{%
\SKV@ensurescape{#1}%
\begingroup
\SKV@ifmacro#1{%
- \edef\SKV@resvd@a{\expandafter\@gobble\string#1}%
- \edef\SKV@resvd@b{\expandafter\strip@prefix\meaning#1}%
+ \edef\SKV@resvda{\expandafter\@gobble\string#1}%
+ \edef\SKV@resvdb{\expandafter\strip@prefix\meaning#1}%
\expandafter\aftergroup\csname SKV@\expandafter
- \ifx\expandafter\SKV@resvd@b
- \csname SKV@test@\SKV@resvd@a\endcsname
+ \ifx\expandafter\SKV@resvdb
+ \csname SKV@test@\SKV@resvda\endcsname
1\else2\fi of2\endcsname
}{\aftergroup\@secondoftwo}%
\endgroup
@@ -763,7 +868,7 @@
\SKV@providerobustdef*\providerobustdef{\SKV@providerobustdef}
\SKV@providerobustdef*\aftercommission{\SKV@afterassignment}
\SKV@providerobustdef*\aftercoterie{\SKV@aftergroup}
-\SKV@def\SKV@ifmacro#1{%
+\SKV@def*\SKV@ifmacro#1{%
\begingroup
\edef\SKV@tempa##1{\def##1####1\detokenize{macro}:####2&}%
\SKV@tempa\SKV@tempa{\expandafter\aftergroup
@@ -774,6 +879,23 @@
}
\SKV@def\SKV@csifmacro{\SKV@aftercs\SKV@ifmacro}
\SKV@def\SKV@ifnotmacro#1{\SKV@ifmacro{#1}\@secondoftwo\@firstoftwo}
+\SKV@def*\SKV@simplecmdpatch{\begingroup\@makeother{\#}%
+ \SKV@testopt\SKV@simpl@cmdpatch{########1}}
+\SKV@def*\SKV@simpl@cmdpatch[#1]#2#3#4{%
+ \edef\SKV@resvda##1##2{%
+ \def##1####1\detokenize{macro:}####2->####3&{%
+ #1\def\string#2####2{##2####3&}%
+ }%
+ \def##2####1\detokenize{#3}####2&{####1\detokenize{#4}####2}%
+ \edef##1{##1\meaning#2&}%
+ }%
+ \SKV@resvda\SKV@resvda\SKV@resvdb
+ \everyeof{\noexpand}\endlinechar\m@ne\makeatletter
+ \catcode`\#=6\relax
+ \scantokens\expandafter{\SKV@resvda}%
+ \global\let#2#2%
+ \endgroup
+}
\SKV@def*\SKV@ifrelax#1{%
\SKV@ensurescape{#1}%
\SKV@ifdefined{#1}%
@@ -811,8 +933,9 @@
\SKV@def\SKV@xifblank#1{\SKV@expargs{0}\SKV@ifblank{#1}\@nil}
\SKV@def\SKV@ifstrequal#1#2{%
\begingroup
- \def\resvd@a{#1}\def\resvd@b{#2}%
- \SKV@detokdespace\resvd@a\SKV@detokdespace\resvd@b
+ \edef\resvd@a{\detokenize{#1}}%
+ \edef\resvd@b{\detokenize{#2}}%
+ \SKV@despacectt\resvd@a\SKV@despacectt\resvd@b
\expandafter\aftergroup
\csname SKV@\SKV@ifx\resvd@a\resvd@b{1}{2}of2\endcsname
\endgroup
@@ -846,28 +969,28 @@
\fi
\endgroup
}
-\SKV@pdef*\SKV@appto{\SKV@savstate\SKV@testoptb{\SKV@apprepto{>}}}
-\SKV@pdef*\SKV@prepto{\SKV@savstate\SKV@testoptb{\SKV@apprepto{<}}}
-\SKV@def\SKV@apprepto#1#2#3{%
- \def\SKV@tapa##1{\def\SKV@tapb####1{\SKV@aftercs##1{####1}}}%
- \ifSKV@st\let\SKV@tapc\SKV@expox\else\let\SKV@tapc\unexpanded\fi
+\SKV@pdef*\SKV@appto{\SKV@savstate\SKV@testoptb{\SKV@hooktomac{>}}}
+\SKV@pdef*\SKV@prepto{\SKV@savstate\SKV@testoptb{\SKV@hooktomac{<}}}
+\SKV@def\SKV@hooktomac#1#2#3{%
+ \ifSKV@st\let\SKV@iii\SKV@expox\else\let\SKV@iii\unexpanded\fi
\ifSKV@pl
- \let\@ifundef\SKV@ifcsundef\let\SKV@tapd\SKV@expcsox
- \ifSKV@ask\SKV@tapa\xdef\else\SKV@tapa\edef\fi
+ \let\@ifundef\SKV@ifcsundef\let\SKV@iv\SKV@csexpox
+ \def\SKV@i##1{\def\SKV@ii####1{\SKV@aftercs##1{####1}}}%
+ \ifSKV@cl\SKV@i\xdef\else\SKV@i\edef\fi
\else
- \let\@ifundef\SKV@ifundef\let\SKV@tapd\SKV@expox
- \ifSKV@ask\def\SKV@tapb##1{\xdef##1}\else
- \def\SKV@tapb##1{\edef##1}\fi
+ \let\@ifundef\SKV@ifundef\let\SKV@iv\SKV@expox
+ \ifSKV@cl\def\SKV@ii##1{\xdef##1}\else
+ \def\SKV@ii##1{\edef##1}\fi
\fi
\@ifundef{#2}{%
- \SKV@tapb{#2}{\SKV@tapc{#3}}%
+ \SKV@ii{#2}{\SKV@iii{#3}}%
}{%
\SKV@ifstrequal{#1}{>}%
- {\SKV@tapb{#2}{\SKV@tapd{#2}\SKV@tapc{#3}}}%
- {\SKV@tapb{#2}{\SKV@tapc{#3}\SKV@tapd{#2}}}%
+ {\SKV@ii{#2}{\SKV@iv{#2}\SKV@iii{#3}}}%
+ {\SKV@ii{#2}{\SKV@iii{#3}\SKV@iv{#2}}}%
}%
- \SKV@undeflist?{\SKV@tapa,\SKV@tapb,\SKV@tapc,\SKV@tapd}%
\SKV@resstate
+ \SKV@undeflist!{\SKV@i,\SKV@ii,\SKV@iii,\SKV@iv}%
}
\SKV@pdef\apptomac#1#2{%
\SKV@ifundef{#1}{\edef#1{\unexpanded{#2}}}%
@@ -887,7 +1010,7 @@
\SKV@t@stoptg{\SKV@testopt\SKV@addt@list{,}}}}
\SKV@def*\SKV@addt@list[#1]{%
\def\parser{#1}%
- \ifSKV@ask\let\glob@l@def\xdef\else\let\glob@l@def\edef\fi
+ \ifSKV@cl\let\glob@l@def\xdef\else\let\glob@l@def\edef\fi
\ifSKV@pl
\def\SKV@next##1{\SKV@aftercs\SKV@addt@l@st{##1}}%
\else
@@ -928,7 +1051,7 @@
at the wrong place}{Move command to before \string\enddocument.}%
}
\SKV@pdef*\SKV@AtDocumentStart{\AtBeginDocument}
-\SKV@pdef*\SKV@BeforeDocumentStart{\SKV@appto?\SKV@beforedocstart}
+\SKV@pdef*\SKV@BeforeDocumentStart{\SKV@appto!\SKV@beforedocstart}
\def\SKV@beforedocstart{}
\SKV@prepto\document{%
\endgroup
@@ -938,7 +1061,7 @@
\SKV@gundef\SKV@beforedocstart
\begingroup
}
-\SKV@pdef*\SKV@AfterDocumentStart{\SKV@appto?\SKV@afterdocstart}
+\SKV@pdef*\SKV@AfterDocumentStart{\SKV@appto!\SKV@afterdocstart}
\def\SKV@afterdocstart{}
\SKV@appto\document{%
\let\SKV@AfterDocumentStart\@firstofone
@@ -948,7 +1071,7 @@
}
\SKV@BeforeDocumentStart{\let\SKV@AtDocumentStart\@firstofone}
\SKV@pdef*\SKV@AtDocumentEnd{\AtEndDocument}
-\SKV@pdef*\SKV@BeforeLastPage{\SKV@appto?\SKV@beforelastpage}
+\SKV@pdef*\SKV@BeforeLastPage{\SKV@appto!\SKV@beforelastpage}
\def\SKV@beforelastpage{}
\SKV@AtDocumentEnd{%
\let\SKV@bef@relastpage\AtVeryEnd@BeforeClearDocumentHook
@@ -956,10 +1079,10 @@
\let\SKV@BeforeLastPage\@firstofone
\SKV@beforelastpage\SKV@bef@relastpage
\let\SKV@BeforeLastPage\SKV@notenderr
- \SKV@Undef?{\SKV@beforelastpage\SKV@bef@relastpage}%
+ \SKV@Undef!{\SKV@beforelastpage\SKV@bef@relastpage}%
}%
}
-\SKV@pdef*\SKV@AfterLastPage{\SKV@appto?\SKV@afterlastpage}
+\SKV@pdef*\SKV@AfterLastPage{\SKV@appto!\SKV@afterlastpage}
\def\SKV@afterlastpage{}
\SKV@AtDocumentEnd{%
\let\SKV@afterl@stpage\AtVeryEnd@AfterLastShipoutHook
@@ -967,10 +1090,10 @@
\let\SKV@AfterLastPage\@firstofone
\SKV@afterlastpage\SKV@afterl@stpage
\let\SKV@AfterLastPage\SKV@notenderr
- \SKV@Undef?{\SKV@afterlastpage\SKV@afterl@stpage}%
+ \SKV@Undef!{\SKV@afterlastpage\SKV@afterl@stpage}%
}%
}
-\SKV@pdef*\SKV@AfterDocumentEnd{\SKV@appto?\SKV@afterenddoc}
+\SKV@pdef*\SKV@AfterDocumentEnd{\SKV@appto!\SKV@afterenddoc}
\def\SKV@afterenddoc{}
\SKV@AtDocumentEnd{%
\let\SKV@aft@renddoc\AtVeryEnd@AtVeryEndDocumentHook
@@ -978,7 +1101,7 @@
\let\SKV@AfterDocumentEnd\@firstofone
\SKV@afterenddoc\SKV@aft@renddoc
\let\SKV@AfterDocumentEnd\SKV@notenderr
- \SKV@Undef?{\SKV@afterenddoc\SKV@aft@renddoc}%
+ \SKV@Undef!{\SKV@afterenddoc\SKV@aft@renddoc}%
}%
}
\SKV@pdef\SKV@AtPackageEnd{\AtEndOfPackage}
@@ -1009,8 +1132,8 @@
\SKV@next
}
\let\SKV@steno\z@
-\SKV@pdef*\SKV@for{\SKV@savstate\SKV@testoptd\SKV@@for}
-\SKV@pdef*\SKV@@for[#1]{%
+\SKV@pdef*\SKV@for{\SKV@savstate\SKV@testoptd\SKV@f@r}
+\SKV@pdef*\SKV@f@r[#1]{%
\let\SKV@steno\@ne
\ifSKV@st
\def\SKV@next{\SKV@for@b[#1]}%
@@ -1041,17 +1164,17 @@
}%
\long\def\SKV@fornoop##1\@nil{}%
}
-\SKV@pdef*\SKV@for@b{\SKV@testopt\SKV@@for@b{,}}
-\SKV@def\SKV@@for@b[#1]#2{%
+\SKV@pdef*\SKV@for@b{\SKV@testopt\SKV@f@r@b{,}}
+\SKV@def\SKV@f@r@b[#1]#2{%
\SKV@CommandGenParser{#1}\SKV@expnext\SKV@for@a{#2}%
}
\SKV@pdef*\SKV@tfor{\SKV@ifstar\SKV@tfor@b\SKV@tfor@a}
\SKV@pdef*\SKV@tfor@a#1#2#3{%
\SKV@ifblank{#1}{%
- \SKV@vbsmsg{warn}{Empty list for '\string\SKV@tfor@a'\on@line}%
+ \SKV@vbmsg{warn}{Empty list for '\string\SKV@tfor@a'\on@line}%
}{%
\SKV@ifblank{#3}{%
- \SKV@vbsmsg{warn}%
+ \SKV@vbmsg{warn}%
{Empty function for '\string\SKV@tfor@a'\on@line}%
}{%
\SKV@tforloop#1\@nil\@nil&#2{#3}%
@@ -1077,20 +1200,28 @@
}
\SKV@pdef*\SKV@tfor@b#1#2#3{\SKV@expnext\SKV@tfor@a{#1}#2{#3}}
\SKV@def*\SKV@preamblecmds{}
-\SKV@pdef*\SKV@onlypreamble#1{%
- \SKV@tfor{#1}\SKV@resvd{%
- \SKV@expnext\SKV@ensurescape\SKV@resvd
- \edef\SKV@resvd##1##2{\SKV@appto?##1{##2\SKV@expox{\SKV@resvd}}}%
- \SKV@resvd\SKV@preamblecmds\SKV@do@a
+\SKV@pdef*\SKV@onlypreamble{\SKV@savstate\SKV@t@st@pta\SKV@onlypre@mble}
+\SKV@pdef*\SKV@onlypre@mble#1{%
+ \SKV@for[,]{#1}\SKV@resvd{%
+ \SKV@despacectt\SKV@resvd
+ \ifSKV@pl
+ \SKV@expnext\SKV@ensurenoscape\SKV@resvd
+ \edef\SKV@resvd##1##2{\SKV@appto!##1{##2\SKV@noexpcs{\SKV@resvd}}}%
+ \else
+ \SKV@expnext\SKV@ensurescape\SKV@resvd
+ \edef\SKV@resvd##1##2{\SKV@appto!##1{##2\SKV@expox{\SKV@resvd}}}%
+ \fi
+ \SKV@resvd\SKV@preamblecmds\SKV@dopreamble
}%
+ \SKV@resstate
}
\SKV@AfterDocumentStart{%
- \gdef\SKV@do@a#1{%
+ \gdef\SKV@dopreamble#1{%
\gdef#1{\SKV@err{'\string#1' is a preamble command}%
{Move command '\string#1' to document preamble.}}%
}%
\SKV@preamblecmds
- \global\let\SKV@do@a\@gobble
+ \global\let\SKV@dopreamble\@gobble
}
\SKV@pdef*\SKV@onlypackage{%
\SKV@xifempty{\@currname\@currext}{%
@@ -1099,14 +1230,39 @@
is available only in package environment.}%
}{}%
}
-\SKV@def*\SKV@CommandKeyParser#1{%
- \long\def\SKV@define@keylist##1{%
- \SKV@undeflist?{\skif,\skifx,\skifcase,\skor,\skelse,\skfi}%
- \ifswitchon{SKV@st}{%
- \long\edef\@keylist{\SKV@expox{##1}}%
+\def\SKV@aftergroupdef#1#2{%
+ \expandafter\endgroup\expandafter\def\expandafter#1%
+ \expandafter{#2}%
+}
+\SKV@def*\SKV@noexpparse#1{%
+ \begingroup
+ \def\SKV@resa{}%
+ \edef\SKV@tempa{\detokenize\expandafter{#1}\@backslashchar&}%
+ \edef\SKV@tempb##1{\def##1####1\@backslashchar####2&}%
+ \SKV@tempb\SKV@tempb{%
+ \SKV@ifempty{##2}{%
+ \edef\SKV@resa{\SKV@expox\SKV@resa##1}%
}{%
- \long\def\@keylist{##1}%
+ \edef\SKV@resa{\SKV@expox\SKV@resa##1%
+ \string\noexpand\@backslashchar}%
+ \SKV@tempb##2&%
}%
+ }%
+ \expandafter\SKV@tempb\SKV@tempa
+ \expandafter\endgroup\expandafter\toks@\expandafter{\SKV@resa}%
+ \edef#1{\the\toks@}%
+}
+\SKV@def*\SKV@CommandKeyParser#1{%
+ \long\def\SKV@d@fine@keylist##1{%
+ \global\let\ifSKV@st\ifSKV@st
+ \endgroup
+ \SKV@undeflist!{\skif,\skifx,\skifcase,\skor,\skelse,\skfi}%
+ \ifSKV@st
+ \edef\@keylist{\detokenize\expandafter{##1}}%
+ \else
+ \edef\@keylist{\detokenize{##1}}%
+ \fi
+ \SKV@scantoksa\@keylist
\SKV@resstate
\SKV@expnext\SKV@checksanitizec\@keylist\SKV@tempa
\expandafter\SKV@readkeylist\SKV@tempa#1\@nil
@@ -1123,18 +1279,34 @@
}%
}%
}
-\SKV@def\SKV@checksanitizec#1#2{%
+\SKV@def*\SKV@checksanitizec#1#2{%
\XKV@ch@cksanitize{#1}#2;%
\ifin@\else\XKV@ch@cksanitize{#1}#2,\fi
\ifin@\@selective@sanitize[0]{,;}#2\fi
}
\SKV@pdef\SKV@checkchoice#1#2#3#4{%
- \XKV@sttrue\XKV@pltrue
+ \XKV@savstate\XKV@sttrue\XKV@pltrue
\SKV@expargs{3}{\XKV@checkchoice[\val\nr]}{{#1}{#2}}{{#3}{#4}}\@nil
+ \XKV@resstate
+}
+\SKV@simplecmdpatch\XKV@ch@ckch@ice{%
+ \XKV@err{value `\the\XKV@toks' is not allowed}%
+}{%
+ \SKV@err{Value '\the\XKV@toks' is not allowed}%
+ {You have submitted an invalid value for a key.\SKV@MB
+ You may proceed if you like but expect funny results.}%
+}
+\SKV@simplecmdpatch\XKV@@ch@ckchoice{%
+ \XKV@err{value `\the\XKV@toks' is not allowed}%
+}{%
+ \SKV@err{Value '\the\XKV@toks' is not allowed}%
+ {You have submitted an invalid value for a key.\SKV@MB
+ You may proceed if you like but expect funny results.}%
}
\SKV@pdef*\SKV@inputerr#1#2{%
\SKV@err{Erroneous value '#1' for key '#2'}%
- {Please use the correct value for key '#2'.}%
+ {Please use the correct value for key '#2'\SKV@MB
+ of families '\XKV@fams'.}%
}
\SKV@def*\SKV@despacelist{\SKV@savstate\SKV@testoptd\SKV@desp@celist}
\SKV@def*\SKV@desp@celist[#1]#2{%
@@ -1157,35 +1329,47 @@
\SKV@def*\SKV@tdespacelt#1{%
\SKV@tfor{#1}\SKV@dsl{\expandafter\SKV@despacectt\SKV@dsl}%
}
-\SKV@pdef*\ReserveKeyPrefixNames{\SKV@ifstar\SKV@rkpn@mes\SKV@rkpn@m@s}
-\SKV@def*\SKV@rkpn@mes#1{\SKV@AfterPackageEnd{\gapptomac\SKV@rkpnames{,#1}}}
-\SKV@def*\SKV@rkpn@m@s#1{\gapptomac\SKV@rkpnames{,#1}}
-\SKV@pdef*\ReserveMacroPrefixNames{\SKV@ifstar\SKV@rmpn@mes\SKV@rmpn@m@s}
-\SKV@def*\SKV@rmpn@mes#1{\SKV@AfterPackageEnd{\gapptomac\SKV@rmpnames{,#1}}}
-\SKV@def*\SKV@rmpn@m@s#1{\gapptomac\SKV@rmpnames{,#1}}
-\SKV@pdef*\ReserveFamilyNames{\SKV@ifstar\SKV@rfn@mes\SKV@rfn@m@s}
-\SKV@def*\SKV@rfn@mes#1{\SKV@AfterPackageEnd{\gapptomac\SKV@rfnames{,#1}}}
-\SKV@def*\SKV@rfn@m@s#1{\gapptomac\SKV@rfnames{,#1}}
+\SKV@pdef*\ReserveKeyPrefixNames{\SKV@ifstar\SKV@rkpn@m@s\SKV@rkpn@mes}
+\SKV@def*\SKV@rkpn@mes#1{\SKV@appto!\SKV@rkpnames{,#1}}
+\SKV@def*\SKV@rkpn@m@s#1{\SKV@AfterPackageEnd{\SKV@appto!\SKV@rkpnames{,#1}}}
+\SKV@pdef*\ReserveMacroPrefixNames{\SKV@ifstar\SKV@rmpn@m@s\SKV@rmpn@mes}
+\SKV@def*\SKV@rmpn@mes#1{\SKV@appto!\SKV@rmpnames{,#1}}
+\SKV@def*\SKV@rmpn@m@s#1{\SKV@AfterPackageEnd{\SKV@appto!\SKV@rmpnames{,#1}}}
+\SKV@pdef*\ReserveFamilyNames{\SKV@ifstar\SKV@rfn@m@s\SKV@rfn@mes}
+\SKV@def*\SKV@rfn@mes#1{\SKV@appto!\SKV@rfnames{,#1}}
+\SKV@def*\SKV@rfn@m@s#1{\SKV@AfterPackageEnd{\SKV@appto!\SKV@rfnames{,#1}}}
\SKV@def*\SKV@rkpnames{XKV}
\SKV@def*\SKV@rmpnames{XKV}
\SKV@def*\SKV@rfnames{XKV}
\ReserveKeyPrefixNames*{SKV}
\ReserveMacroPrefixNames*{SKV}
\ReserveFamilyNames*{skeyval}
-\SKV@def*\SKV@newlet#1#2{%
+\SKV@def*\SKV@newlet{\SKV@savstate\SKV@t@stopta\SKV@n@wlet}
+\SKV@def*\SKV@n@wlet#1#2{%
\SKV@ifdef#1{%
- \SKV@err{Command '\string#1' already defined}%
- {I can't let '\string#1' to '\string#2'.}%
+ \ifSKV@st
+ \SKV@ifdef#2{%
+ \let#1#2%
+ \SKV@vbmsg{info}{Command '\string#1' redefined\on@line}%
+ }{%
+ \SKV@err{Command '\string#2' undefined}%
+ {I can't let '\string#1' to '\string#2'.}%
+ }%
+ \else
+ \SKV@err{Command '\string#1' already defined}%
+ {I can't let '\string#1' to '\string#2'.}%
+ \fi
}{%
\SKV@ifdef#2{\let#1#2}{%
\SKV@err{Command '\string#2' undefined}%
{I can't let '\string#1' to '\string#2'.}%
}%
}%
+ \SKV@resstate
}
\AtEndOfPackage{\SKV@providedef*\NewLet{\SKV@newlet}}
-\SKV@pdef*\SKV@cslet{\SKV@savstate\SKV@t@stopta\SKV@@cslet}
-\SKV@def*\SKV@@cslet#1#2{%
+\SKV@pdef*\SKV@cslet{\SKV@savstate\SKV@t@stopta\SKV@csl@t}
+\SKV@def*\SKV@csl@t#1#2{%
\ifSKV@st
\def\SKV@next{\SKV@aftercs\let{#1}#2}%
\else
@@ -1200,8 +1384,8 @@
\fi
\SKV@resstate\SKV@next
}
-\SKV@pdef*\SKV@letcs{\SKV@savstate\SKV@t@stopta\SKV@@letcs}
-\SKV@def*\SKV@@letcs#1#2{%
+\SKV@pdef*\SKV@letcs{\SKV@savstate\SKV@t@stopta\SKV@l@tcs}
+\SKV@def*\SKV@l@tcs#1#2{%
\ifSKV@st
\def\SKV@next{%
\begingroup\expandafter\endgroup
@@ -1219,8 +1403,8 @@
\fi
\SKV@resstate\SKV@next
}
-\SKV@pdef*\SKV@csletcs{\SKV@savstate\SKV@t@stopta\SKV@@csletcs}
-\SKV@def*\SKV@@csletcs#1#2{%
+\SKV@pdef*\SKV@csletcs{\SKV@savstate\SKV@t@stopta\SKV@csl@tcs}
+\SKV@def*\SKV@csl@tcs#1#2{%
\ifSKV@st
\def\SKV@next{%
\begingroup\expandafter\endgroup
@@ -1241,34 +1425,37 @@
\SKV@pdef*\SKV@numdef{\SKV@savstate\SKV@testoptc{\SKV@expr{num}}}
\SKV@pdef*\SKV@dimdef{\SKV@savstate\SKV@testoptc{\SKV@expr{dim}}}
\SKV@def*\SKV@expr#1{%
- \ifSKV@ask\let\glob@lrel@x\global\else\let\glob@lrel@x\relax\fi
+ \ifSKV@cl\let\gl@l@x\global\else\let\gl@l@x\relax\fi
\ifSKV@pl
\def\SKV@next##1{%
- \edef\resvd@a####1{####1{#1}\SKV@expcsox{##1}}%
- \resvd@a\SKV@numdimd@f
+ \edef\resvd@a####1{####1{#1}\SKV@csexpox{##1}}%
+ \resvd@a\SKV@ex@r
}%
\else
- \def\SKV@next{\SKV@numdimd@f{#1}}%
+ \def\SKV@next{\SKV@ex@r{#1}}%
\fi
\SKV@resstate\SKV@next
}
-\SKV@def*\SKV@numdimd@f#1#2#3{%
- \SKV@ensurescape@notempty{#2}{#3}%
+\SKV@def*\SKV@ex@r#1#2#3{%
+ \SKV@ensurescape@ne{#2}{#3}%
\SKV@ifstrequal{#1}{num}%
{\def\resvd@a{count}}{\def\resvd@a{dimen}}%
\SKV@ifundef{#2}{%
\@nameuse{new\resvd@a}#2%
- \glob@lrel@x#2=\@nameuse{#1expr}#3\relax
+ \gl@l@x#2=\@nameuse{#1expr}#3\relax
}{%
- \glob@lrel@x#2=\@nameuse{#1expr}#3\relax
+ \gl@l@x#2=\@nameuse{#1expr}#3\relax
}%
}
-\SKV@def*\SKV@ensurescape@notempty#1#2{%
+\SKV@def*\SKV@ensurescape@ne#1#2{%
\SKV@ensurescape{#1}%
- \SKV@ifempty{#2}%
- {\SKV@err{Argument '\string#1' is empty}\@ehc}{}%
+ \SKV@ifnotempty{#2}{}%
+ {\SKV@err{Argument '\string#2' is empty}%
+ {Empty argument '\string#2' is invalid.\SKV@MB
+ I expected a nonempty argument here.}%
+ }%
}
-\SKV@def*\SKV@keylistparser@err{%
+\SKV@def*\SKV@badkeylistparser{%
\SKV@err{Key list parser '\SKV@keyparser' not allowed}%
{Use semicolon (preferable) or colon as parser.}%
}
@@ -1282,12 +1469,12 @@
}
\define@cmdkey[KV]{skeyval}[SKV@]{keyparser}[;]{%
\@onelevel@sanitize\SKV@keyparser
- \SKV@xifblank\SKV@keyparser\SKV@keylistparser@err\relax
+ \SKV@xifblank\SKV@keyparser\SKV@badkeylistparser\relax
\SKV@despacectt\SKV@keyparser
\begingroup
\def\SKV@tempa{,}\SKV@detokdespace\SKV@tempa
\SKV@ifx\SKV@keyparser\SKV@tempa
- {\aftergroup\SKV@keylistparser@err}{}%
+ {\aftergroup\SKV@badkeylistparser}{}%
\endgroup
\SKV@expargs{0}\SKV@CommandKeyParser\SKV@keyparser\@nil
}
@@ -1391,17 +1578,17 @@
\AtBeginDocument{%
\SKV@ifundef\ifdraft
{\SKV@pdef*\ifdraft{\SKV@ifdraft}}%
- {\SKV@vbsmsg{info}{\SKV@useinfo{ifdraft}}}%
+ {\SKV@vbmsg{info}{\SKV@useinfo{ifdraft}}}%
}
\SKV@ifundef\ifnotdraft
{\SKV@pdef*\ifnotdraft{\SKV@ifnotdraft}}%
- {\SKV@vbsmsg{info}{\SKV@useinfo{ifnotdraft}}}
+ {\SKV@vbmsg{info}{\SKV@useinfo{ifnotdraft}}}
\SKV@ifundef\iffinal
{\SKV@pdef*\iffinal{\SKV@iffinal}}%
- {\SKV@vbsmsg{info}{\SKV@useinfo{iffinal}}}
+ {\SKV@vbmsg{info}{\SKV@useinfo{iffinal}}}
\SKV@ifundef\ifnotfinal
{\SKV@pdef*\ifnotfinal{\SKV@ifnotfinal}}%
- {\SKV@vbsmsg{info}{\SKV@useinfo{ifnotfinal}}}
+ {\SKV@vbmsg{info}{\SKV@useinfo{ifnotfinal}}}
\SKV@def\SKV@star@or@long#1{%
\SKV@ifstar
{\let\l@ngrel@x\relax\def\@star@or@none{*}#1}%
@@ -1415,64 +1602,68 @@
}
\SKV@redef\@check@eq#1#2{%
\SKV@ifx{#1}{#2}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Previous definition of '\string#1'\SKV@MB
doesn't match your new definition.\SKV@MB
* I haven't redefined '\string#1' *}%
}%
}
\SKV@def*\SKV@getswstate#1#2{%
- \SKV@ifstrequal{#2}{true}{\def\SKV@resvd{true}}%
- {\SKV@ifstrequal{#2}{false}{\def\SKV@resvd{false}}%
- {\SKV@ifstrequal{#2}{on}{\def\SKV@resvd{true}}%
- {\SKV@ifstrequal{#2}{off}{\def\SKV@resvd{false}}%
- {\SKV@swvalerr{#1}{#2}}}}}%
+ \SKV@checkchoice{#2}{true,on,false,off}{%
+ \ifcase\nr\relax
+ \def\SKV@swval{true}%
+ \or
+ \def\SKV@swval{true}%
+ \or
+ \def\SKV@swval{false}%
+ \or
+ \def\SKV@swval{false}%
+ \fi
+ }{%
+ \SKV@swvalerr{#1}{#2}%
+ }%
}
-\SKV@pdef*\newswitch{\SKV@testopt\SKV@newswitch{}}
+\SKV@pdef*\newswitch{\SKV@swtrue\SKV@testopt\SKV@newswitch{}}
+\SKV@pdef*\defswitch{\SKV@swfalse\SKV@testopt\SKV@newswitch{}}
\SKV@def*\SKV@newswitch[#1]#2{\SKV@testopt{\SKV@n@wswitch[#1]{#2}}{false}}
\SKV@def*\SKV@n@wswitch[#1]#2[#3]{%
\SKV@in@n{,}{#2}{%
- \SKV@err{Command '\string\newswitch' doesn't accept list}%
- {Please submit only one switch to '\string\newswitch' at a time.}%
+ \SKV@err{%
+ Command \ifSKV@sw'\string\newswitch'\else'\string\defswitch'\fi\space
+ doesn't accept list
+ }{%
+ Please submit only one switch to \ifSKV@sw'\string\newswitch'\else
+ '\string\defswitch'\fi\SKV@MB at a time. You may consider using
+ \ifSKV@sw'\string\NewSwitches'\else'\string\DefSwitches'\fi\SKV@MB
+ if you really want to define a set of switches.
+ }%
}{}%
\SKV@ensurenoscape{#2}%
\SKV@ifstrnotequal{#1#2}{x}{}{%
\SKV@err{'\string\ifx' is a TeX primitive}%
- {You can't redefine '\string\ifx'? This is dangerous.}%
- }%
- \SKV@getswstate\newswitch{#3}%
- \SKV@csifdefinable{if#1#2}{%
- \csnewif{if#1#2}%
- \@nameuse{#1#2\SKV@resvd}%
- }%
-}
-\SKV@pdef*\defswitch{\SKV@testopt\SKV@defswitch{}}
-\SKV@def*\SKV@defswitch[#1]#2{\SKV@testopt{\SKV@d@fswitch[#1]{#2}}{false}}
-\SKV@def*\SKV@d@fswitch[#1]#2[#3]{%
- \SKV@ensurenoscape{#2}%
- \SKV@in@n{,}{#2}{%
- \SKV@err{Command '\string\defswitch' doesn't accept list}%
- {Please submit only one switch to '\string\defswitch' at a time.}%
- }{}%
- \SKV@ifcsundef{if#1#2}{}{%
- \SKV@vbsmsg{warn}{Switch '\@backslashchar if#1#2' redefined\on@line}%
- }%
- \SKV@ifstrnotequal{#1#2}{x}{}{%
- \SKV@err{'\string\ifx' is a TeX primitive}%
- {Why do you want to redefine '\string\ifx'? This is dangerous.}%
+ {You can't redefine '\string\ifx'! This is dangerous.}%
}%
- \SKV@getswstate\defswitch{#3}%
+ \ifSKV@sw
+ \SKV@getswstate\newswitch{#3}%
+ \SKV@csifdefinable{if#1#2}\relax
+ \else
+ \SKV@getswstate\defswitch{#3}%
+ \SKV@ifcsundef{if#1#2}{}{%
+ \SKV@vbmsg{warn}{Switch '\@backslashchar if#1#2' redefined\on@line}%
+ }%
+ \fi
\csnewif{if#1#2}%
- \@nameuse{#1#2\SKV@resvd}%
+ \@nameuse{#1#2\SKV@swval}%
}
\SKV@newlet\NewSwitches\NewBooleans
+\SKV@newlet\DefSwitches\DefBooleans
\SKV@def*\setswitch#1#2{%
\SKV@ensurenoscape{#1}%
\SKV@ifcsundef{if#1}{%
\SKV@noswerr{#1}%
}{%
\SKV@getswstate\setswitch{#2}%
- \csname#1\SKV@resvd\endcsname
+ \csname#1\SKV@swval\endcsname
}%
}
\SKV@def*\switchon#1{%
@@ -1513,35 +1704,39 @@
\SKV@err{Toggle '#1' undefined}%
{You need to first define '#1' before use.}%
}
-\SKV@pdef*\newtog{\SKV@testopt\SKV@newtog{}}
+\SKV@pdef*\newtog{\SKV@swtrue\SKV@testopt\SKV@newtog{}}
+\SKV@pdef*\deftog{\SKV@swfalse\SKV@testopt\SKV@newtog{}}
\SKV@def*\SKV@newtog[#1]#2{\SKV@testopt{\SKV@n@wtog[#1]{#2}}{false}}
\SKV@def*\SKV@n@wtog[#1]#2[#3]{%
\SKV@in@n{,}{#2}{%
- \SKV@err{Command '\string\newtog' doesn't accept list}%
- {Please submit only one tog to '\string\newtog' at a time.}%
- }{}%
- \SKV@ensurenoscape{#2}%
- \SKV@ifcsdef{SKV@toggle@#1#2}{%
- \SKV@err{Toggle '#1#2' already defined}%
- {Please provide a new toggle or redefine '#1#2'.}%
- }{\SKV@csletcs{SKV@toggle@#1#2}{SKV@t@ggle#3}}%
-}
-\SKV@pdef*\deftog{\SKV@testopt\SKV@deftog{}}
-\SKV@def*\SKV@deftog[#1]#2{\SKV@testopt{\SKV@d@ftog[#1]{#2}}{false}}
-\SKV@def*\SKV@d@ftog[#1]#2[#3]{%
- \SKV@in@n{,}{#2}{%
- \SKV@err{Command '\string\deftog' doesn't accept list}%
- {Please submit only one tog to '\string\deftog' at a time.}%
+ \SKV@err{%
+ Command \ifSKV@sw'\string\newtog'\else'\string\deftog'\fi\space
+ doesn't accept list
+ }{%
+ Please submit only one tog to \ifSKV@sw'\string\newtog'\else
+ '\string\deftog'\fi\space at a time.\SKV@MB You can use
+ \ifSKV@sw'\string\NewTogs'\else'\string\DefTogs'\fi\space
+ to define a set of togs.
+ }%
}{}%
\SKV@ensurenoscape{#2}%
- \SKV@ifcsundef{SKV@toggle@#1#2}{}{%
- \SKV@vbsmsg{warn}{Toggle '#1#2' redefined\on@line}%
- }%
- \SKV@csletcs{SKV@toggle@#1#2}{SKV@t@ggle#3}
+ \ifSKV@sw
+ \SKV@getswstate\newtog{#3}%
+ \SKV@ifcsdef{SKV@toggle@#1#2}{%
+ \SKV@err{Toggle '#1#2' already defined}%
+ {Please provide a new toggle or use '\string\deftog'.}%
+ }{}%
+ \else
+ \SKV@getswstate\deftog{#3}%
+ \SKV@ifcsundef{SKV@toggle@#1#2}{}{%
+ \SKV@vbmsg{warn}{Toggle '#1#2' redefined\on@line}%
+ }%
+ \fi
+ \SKV@csletcs{SKV@toggle@#1#2}{SKV@t@ggle\SKV@swval}
}
\SKV@pdef*\providetog#1{%
\SKV@ifcsdef{SKV@toggle@#1}{%
- \SKV@vbsmsg{info}%
+ \SKV@vbmsg{info}%
{Toggle '#1' already defined.\SKV@MB Not redefined\on@line}%
}{\SKV@cslet{SKV@toggle@#1}\@secondoftwo}%
}
@@ -1595,11 +1790,11 @@
}
\SKV@ifundef\ifnotpdf
{\let\ifnotpdf\SKV@ifnotpdf}%
- {\SKV@vbsmsg{info}{\SKV@useinfo{ifnotpdf}}}
+ {\SKV@vbmsg{info}{\SKV@useinfo{ifnotpdf}}}
\SKV@AtDocumentStart{%
\SKV@ifundef\ifpdf
{\SKV@pdef*\ifpdf{\SKV@ifpdf}}%
- {\SKV@vbsmsg{info}{\SKV@useinfo{ifpdf}}}%
+ {\SKV@vbmsg{info}{\SKV@useinfo{ifpdf}}}%
}
\SKV@pdef*\SKV@definedkey@err#1{%
\SKV@ifcsundef{\XKV@header#1}{}{%
@@ -1607,13 +1802,12 @@
with prefix '\SKV@pref'}{Use another key name instead of '#1'.}%
}%
}
-\SKV@pdef*\define@menukey{\define@choicekey}
-\SKV@pdef*\define@togkey{%
+\SKV@pdef*\define@togkey{\SKV@skfalse
\XKV@t@stopta{\XKV@testoptd\SKV@define@togkey{}}}
\SKV@def*\SKV@define@togkey#1#2[#3]{%
\SKV@findkeypointers{#2}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}
\SKV@Undef+{\XKV@header\SKV@resa,SKV@toggle@#1\SKV@resa}%
@@ -1632,24 +1826,25 @@
}
\SKV@def*\SKV@d@fine@togkey#1#2#3#4#5{%
\SKV@d@f@ne@t@gkey#1{#2}{#3}{#4}%
- {{\SKV@expargs{0}{\SKV@getswstate{}}\XKV@resa\@nil
- \settog{#3}{\SKV@resvd}#5}}%
+ {{\SKV@expargs{0}{\SKV@getswstate\SKV@d@fine@togkey}\XKV@resa\@nil
+ \settog{#3}{\SKV@swval}#5}}%
}
\SKV@def*\SKV@d@f@ne@togkey#1#2#3#4#5#6{%
\SKV@d@f@ne@t@gkey#1{#2}{#3}{#4}%
- {{\SKV@expargs{0}{\SKV@getswstate{}}\XKV@resa\@nil
- \settog{#3}{\SKV@resvd}#5}{#6}}%
+ {{\SKV@expargs{0}{\SKV@getswstate\SKV@d@f@ne@togkey}\XKV@resa\@nil
+ \settog{#3}{\SKV@swval}#5}{#6}}%
}
\SKV@def*\SKV@d@f@ne@t@gkey#1#2#3#4#5{%
\deftog{#3}%
\ifXKV@st\XKV@define@default{#2}{#4}\fi
- \def#1##1{%
- \def#1####1{##1\XKV@sttrue
- \XKV@checkchoice[\XKV@resa]{####1}{true,false,on,off}#5}%
+ \edef#1##1{%
+ \def#1####1{##1\unexpanded{\XKV@sttrue\XKV@checkchoice[\XKV@resa]}%
+ {####1}{true,false,on,off}\unexpanded{#5}%
+ }%
}%
\ifXKV@pl#1\XKV@pltrue\else#1\XKV@plfalse\fi
}
-\SKV@pdef*\define@togkeys{%
+\SKV@pdef*\define@togkeys{\SKV@skfalse
\XKV@plfalse\XKV@testoptd\SKV@define@togkeys{}}
\SKV@def*\SKV@define@togkeys#1#2[#3]{%
\SKV@despacelist{#2}%
@@ -1661,7 +1856,7 @@
\SKV@def*\SKV@d@fine@togkeys#1#2#3{%
\SKV@findkeypointers{#1}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}
\SKV@Undef+{\XKV@header\SKV@resa,SKV@toggle@#2\SKV@resa}%
@@ -1674,7 +1869,7 @@
}%
\SKV@tempa\SKV@d@f@ne@t@gkey\settog\XKV@resa
}
-\SKV@pdef*\newordkey{\XKV@testoptb\SKV@newordkey}
+\SKV@pdef*\newordkey{\SKV@skfalse\XKV@testoptb\SKV@newordkey}
\SKV@def*\SKV@newordkey#1{%
\SKV@findkeypointers{#1}%
\SKV@expnext\SKV@definedkey@err\SKV@resa
@@ -1685,8 +1880,9 @@
}%
\SKV@tempa
}
-\SKV@pdef*\newcmdkey{\XKV@testoptd\SKV@newcmdkey{cmd}}
+\SKV@pdef*\newcmdkey{\SKV@skfalse\XKV@testoptd\SKV@newcmdkey{cmd}}
\SKV@def*\SKV@newcmdkey#1#2[#3]#4{%
+ \SKV@reservmp{#1}\SKV@rmpnames
\SKV@findkeypointers{#2}%
\SKV@expnext\SKV@definedkey@err\SKV@resa
\ifXKV@st
@@ -1694,13 +1890,12 @@
\SKV@expnext\XKV@define@default\SKV@resa{#3}%
\fi
\begingroup
- \edef\SKV@tempa{\noexpand\def\@nameuse{\XKV@header\SKV@resa}####1}%
- \edef\SKV@tempb{\noexpand\def\@nameuse{#1\SKV@resa}%
- \unexpanded{{##1}#4}}%
+ \edef\SKV@tempa{\def\SKV@noexpcs{\XKV@header\SKV@resa}####1}%
+ \edef\SKV@tempb{\def\SKV@noexpcs{#1\SKV@resa}\unexpanded{{##1}#4}}%
\expandafter\expandafter\expandafter\endgroup
\expandafter\SKV@tempa\expandafter{\SKV@tempb}%
}
-\SKV@pdef*\newcmdkeys{\XKV@testoptd\SKV@newcmdkeys{cmd}}
+\SKV@pdef*\newcmdkeys{\SKV@skfalse\XKV@testoptd\SKV@newcmdkeys{cmd}}
\SKV@def*\SKV@newcmdkeys#1#2[#3]{%
\SKV@despacelist{#2}%
\SKV@for*[,]\SKV@resa\SKV@tempa{%
@@ -1708,7 +1903,8 @@
\SKV@tempa[#3]{}%
}%
}
-\SKV@pdef*\newchoicekey{\XKV@testopta{\XKV@testoptb\SKV@newchoicekey}}
+\SKV@pdef*\newchoicekey{\SKV@skfalse
+ \XKV@testopta{\XKV@testoptb\SKV@newchoicekey}}
\SKV@def*\SKV@newchoicekey#1{%
\SKV@findkeypointers{#1}%
\SKV@expnext\SKV@definedkey@err\SKV@resa
@@ -1717,7 +1913,8 @@
\SKV@tempa\XKV@d@fine@choicekey
}
\let\newmenukey\newchoicekey
-\SKV@pdef*\newboolkey{\XKV@t@stopta{\XKV@testoptd\SKV@newboolkey{}}}
+\SKV@pdef*\newboolkey{\SKV@skfalse
+ \XKV@t@stopta{\XKV@testoptd\SKV@newboolkey{}}}
\SKV@def*\SKV@newboolkey#1#2[#3]{%
\SKV@findkeypointers{#2}%
\SKV@expnext\SKV@definedkey@err\SKV@resa
@@ -1729,7 +1926,8 @@
\edef\SKV@tempa{{\XKV@header\SKV@resa}{\SKV@resa}{#1\SKV@resa}{#3}}%
\expandafter\SKV@next\SKV@tempa
}
-\SKV@pdef*\newboolkeys{\XKV@plfalse\XKV@testoptd\SKV@newboolkeys{}}
+\SKV@pdef*\newboolkeys{\SKV@skfalse
+ \XKV@plfalse\XKV@testoptd\SKV@newboolkeys{}}
\SKV@def*\SKV@newboolkeys#1#2[#3]{%
\SKV@despacelist{#2}%
\SKV@for*[,]\SKV@resa\SKV@tempa{%
@@ -1738,7 +1936,8 @@
\XKV@d@fine@boolkeys{{\SKV@tempa}}{{#1}{#3}}\@nil
}%
}
-\SKV@pdef*\newtogkey{\XKV@t@stopta{\XKV@testoptd\SKV@newtogkey{}}}
+\SKV@pdef*\newtogkey{\SKV@skfalse
+ \XKV@t@stopta{\XKV@testoptd\SKV@newtogkey{}}}
\SKV@def*\SKV@newtogkey#1#2[#3]{%
\SKV@findkeypointers{#2}%
\SKV@expnext\SKV@definedkey@err\SKV@resa
@@ -1752,7 +1951,8 @@
{\XKV@header\SKV@resa}{\SKV@resa}{#1\SKV@resa}{#3}}%
\aftergroup\SKV@next\SKV@tempa
}
-\SKV@pdef*\newtogkeys{\XKV@plfalse\XKV@testoptd\SKV@newtogkeys{}}
+\SKV@pdef*\newtogkeys{\SKV@skfalse
+ \XKV@plfalse\XKV@testoptd\SKV@newtogkeys{}}
\SKV@def*\SKV@newtogkeys#1#2[#3]{%
\SKV@despacelist{#2}%
\SKV@for*[,]\SKV@resa\SKV@tempa{%
@@ -1903,22 +2103,23 @@
}%
}
\SKV@pdef*\define@keylist{%
- \let\SKV@def@ordkey\define@key
- \let\SKV@def@cmdkey\define@cmdkey
- \let\SKV@def@boolkey\define@boolkey
- \let\SKV@def@togkey\define@togkey
- \let\SKV@def@choicekey\define@choicekey
- \SKV@savstate
- \SKV@t@stopta\SKV@define@keylist
+ \SKV@define@keylist\define@key\define@cmdkey
+ \define@boolkey\define@togkey\define@choicekey
}
\SKV@pdef*\newkeylist{%
- \let\SKV@def@ordkey\newordkey
- \let\SKV@def@cmdkey\newcmdkey
- \let\SKV@def@boolkey\newboolkey
- \let\SKV@def@togkey\newtogkey
- \let\SKV@def@choicekey\newchoicekey
+ \SKV@define@keylist\newordkey\newcmdkey
+ \newboolkey\newtogkey\newchoicekey
+}
+\newcommand*\SKV@define@keylist[5]{%
+ \let\SKV@def@ordkey#1%
+ \let\SKV@def@cmdkey#2%
+ \let\SKV@def@boolkey#3%
+ \let\SKV@def@togkey#4%
+ \let\SKV@def@choicekey#5%
\SKV@savstate
- \SKV@t@stopta\SKV@define@keylist
+ \begingroup
+ \@makeother{\#}%
+ \SKV@t@stopta\SKV@d@fine@keylist
}
\SKV@def*\choicekeyvalues{%
\SKV@t@stopta{\SKV@testopt\SKV@choic@keyvalues\SKV@keyprefix}}
@@ -1983,11 +2184,11 @@
\let\SKV@altlisterr\z@
\SKV@sp@def{#1}\SKV@tempa
\SKV@checkchoice{\SKV@tempa}{ord,cmd,bool,tog,choice,menu}{%
- \SKV@iftest{num}{\nr=5}{%
+ \ifnum\nr=5%
\let\SKV@keytype\nr
- }{%
+ \else
\edef\SKV@keytype{\the\numexpr\nr+1}%
- }%
+ \fi
}{%
\SKV@checkchoice{\SKV@tempa}{1,2,3,4,5}{%
\edef\SKV@keytype{\the\numexpr\nr+1}%
@@ -2062,38 +2263,34 @@
}%
\fi
}
-\def\XKV@makepf#1{%
+\SKV@def*\SKV@resvfampf#1#2{%
+ \begingroup
+ \SKV@expnext\XKV@checksanitizeb#2\SKV@tempa
+ \SKV@despacelist*\SKV@tempa
+ \XKV@knftrue
+ \XKV@whilist\SKV@tempa\SKV@tempa\ifXKV@knf\fi{%
+ \SKV@aftercs\ifx{XKV@#1}\SKV@tempa\XKV@knffalse\fi
+ }%
+ \unless\ifXKV@knf
+ \SKV@afterfi
+ \SKV@err{Key #1 '\SKV@tempa' is reserved}%
+ {You have used a reserved key #1: '\SKV@tempa'.\SKV@MB
+ Use another #1 name instead of '\SKV@tempa'.}%
+ \fi
+ \endgroup
+}
+\SKV@redef*\XKV@makepf#1{%
\SKV@sp@def{#1}\XKV@prefix
- \ifSKV@sk\else
- \SKV@expnext\XKV@checksanitizeb\SKV@rkpnames\SKV@tempa
- \SKV@despacelist*\SKV@tempa
- \XKV@knftrue
- \XKV@whilist\SKV@tempa\SKV@tempa\ifXKV@knf\fi{%
- \ifx\XKV@prefix\SKV@tempa\XKV@knffalse\fi
- }%
- \unless\ifXKV@knf
- \SKV@afterfi
- \SKV@err{Prefix '\SKV@tempa' is reserved}%
- {Use another prefix name instead of '\SKV@tempa'.}%
- \fi
+ \unless\ifSKV@sk
+ \SKV@resvfampf{prefix}\SKV@rkpnames
\fi
\edef\SKV@pref{\ifx\XKV@prefix\@empty\else\XKV@prefix\fi}%
\edef\XKV@prefix{\ifx\XKV@prefix\@empty\else\XKV@prefix @\fi}%
}
-\def\XKV@makehd#1{%
+\SKV@redef*\XKV@makehd#1{%
\SKV@expargs{3}\SKV@sp@def{{#1}}\XKV@header\@nil
- \ifSKV@sk\else
- \SKV@expnext\XKV@checksanitizeb\SKV@rfnames\SKV@tempa
- \SKV@despacelist*\SKV@tempa
- \XKV@knftrue
- \XKV@whilist\SKV@tempa\SKV@tempa\ifXKV@knf\fi{%
- \ifx\XKV@header\SKV@tempa\XKV@knffalse\fi
- }%
- \unless\ifXKV@knf
- \SKV@afterfi
- \SKV@err{Family '\SKV@tempa' is reserved}%
- {Use another family name instead of '\SKV@tempa'.}%
- \fi
+ \unless\ifSKV@sk
+ \SKV@resvfampf{family}\SKV@rfnames
\fi
\edef\XKV@header{%
\XKV@prefix\ifx\XKV@header\@empty\else\XKV@header @\fi}%
@@ -2113,11 +2310,11 @@
\SKV@def*\SKV@addtouserval{%
\SKV@addtolist+{SKV@\XKV@header uservalue}\SKV@resa}
\SKV@def*\SKV@gaddtouserval{%
- \SKV@addtolist+?{SKV@\XKV@header uservalue}\SKV@resa}
+ \SKV@addtolist+!{SKV@\XKV@header uservalue}\SKV@resa}
\SKV@def*\SKV@addtosave{\SKV@addtolist+{XKV@\XKV@header save}\SKV@resa}
\SKV@def*\SKV@gaddtosave{\begingroup
\edef\SKV@tempa{\endgroup
- \SKV@addtolist+?{XKV@\XKV@header save}{\global{\SKV@resa}}}%
+ \SKV@addtolist+!{XKV@\XKV@header save}{\global{\SKV@resa}}}%
\SKV@tempa
}
\SKV@def*\SKV@findkeypointers#1{%
@@ -2143,10 +2340,11 @@
{\SKV@gaddtosave}%
{}}}}}}}}}}%
}
+\SKV@predef*\define@key{\SKV@skfalse\XKV@testoptb\XKV@define@key}
\def\XKV@define@key#1{%
\SKV@findkeypointers{#1}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}
\SKV@csundef{\XKV@header\SKV@resa}%
@@ -2165,10 +2363,32 @@
\@namedef{\XKV@header#1}##1{#3}%
}
\def\SKV@d@fine@key#1#2{\@namedef{\XKV@header#1}##1{#2}}
+\SKV@def*\SKV@reservmp#1#2{%
+ \begingroup
+ \SKV@sp@def{#1}\SKV@tempb
+ \SKV@expnext\XKV@checksanitizeb#2\SKV@tempa
+ \SKV@despacelist*\SKV@tempa
+ \XKV@knftrue
+ \XKV@whilist\SKV@tempa\SKV@tempa\ifXKV@knf\fi{%
+ \ifx\SKV@tempb\SKV@tempa\XKV@knffalse\fi
+ }%
+ \unless\ifXKV@knf
+ \SKV@afterfi
+ \SKV@err{Macro prefix '\SKV@tempa' is reserved}%
+ {You have used a reserved macro prefix: '\SKV@tempa'.\SKV@MB
+ Use another macro prefix name instead of '\SKV@tempa'.}%
+ \fi
+ \endgroup
+}
+\SKV@predef*\define@cmdkey{%
+ \SKV@skfalse\XKV@testoptd\XKV@define@cmdkey{cmd}}
+\SKV@predef*\define@cmdkeys{%
+ \SKV@skfalse\XKV@testoptd\XKV@define@cmdkeys{cmd}}
\def\XKV@define@cmdkey#1#2[#3]#4{%
+ \SKV@reservmp{#1}\SKV@rmpnames
\SKV@findkeypointers{#2}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}
\SKV@Undef+{\XKV@header\SKV@resa,#1\SKV@resa}%
@@ -2185,10 +2405,13 @@
\SKV@threexp\endgroup\expandafter\SKV@tempa\expandafter%
{\expandafter\def\csname#1\SKV@resa\endcsname{##1}#4}%
}
+\SKV@predef*\define@choicekey{\SKV@skfalse
+ \XKV@testopta{\XKV@testoptb\XKV@define@choicekey}}
+\SKV@newlet\define@menukey\define@choicekey
\def\XKV@define@choicekey#1{%
\SKV@findkeypointers{#1}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}
\SKV@csundef{\XKV@header\SKV@resa}%
@@ -2201,10 +2424,14 @@
}%
\SKV@tempa
}
+\SKV@predef*\define@boolkey{\SKV@skfalse
+ \XKV@t@stopta{\XKV@testoptd\XKV@define@boolkey{}}}
+\SKV@predef*\define@boolkeys{\SKV@skfalse
+ \XKV@plfalse\XKV@testoptd\XKV@define@boolkeys{}}
\def\XKV@define@boolkey#1#2[#3]{%
\SKV@findkeypointers{#2}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}%
\SKV@Undef+{\XKV@header\SKV@resa,#1\SKV@resa}%
@@ -2221,27 +2448,28 @@
}
\def\XKV@d@fine@boolkey#1#2#3#4#5{%
\XKV@d@f@ne@b@olkey#1{#2}{#3}{#4}%
- {{\SKV@expargs{0}{\SKV@getswstate{}}\XKV@resa\@nil
- \csname#3\SKV@resvd\endcsname#5}}%
+ {{\SKV@expargs{0}{\SKV@getswstate\XKV@d@fine@boolkey}\XKV@resa\@nil
+ \csname#3\SKV@swval\endcsname#5}}%
}
\def\XKV@d@f@ne@boolkey#1#2#3#4#5#6{%
\XKV@d@f@ne@b@olkey#1{#2}{#3}{#4}%
- {{\SKV@expargs{0}{\SKV@getswstate{}}\XKV@resa\@nil
- \csname#3\SKV@resvd\endcsname#5}{#6}}%
+ {{\SKV@expargs{0}{\SKV@getswstate\XKV@d@f@ne@boolkey}\XKV@resa\@nil
+ \csname#3\SKV@swval\endcsname#5}{#6}}%
}
\def\XKV@d@f@ne@b@olkey#1#2#3#4#5{%
\csnewif{if#3}%
\ifXKV@st\XKV@define@default{#2}{#4}\fi
- \def#1##1{%
- \def#1####1{##1\XKV@sttrue
- \XKV@checkchoice[\XKV@resa]{####1}{true,false,on,off}#5}%
+ \edef#1##1{%
+ \def#1####1{##1\unexpanded{\XKV@sttrue\XKV@checkchoice[\XKV@resa]}%
+ {####1}{true,false,on,off}\unexpanded{#5}%
+ }%
}%
\ifXKV@pl#1\XKV@pltrue\else#1\XKV@plfalse\fi
}
\def\XKV@d@fine@boolkeys#1#2#3{%
\SKV@findkeypointers{#1}%
\SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
prefix '\SKV@pref' redefined\on@line}
\SKV@Undef+{\XKV@header\SKV@resa,#2\SKV@resa}%
@@ -2306,60 +2534,60 @@
\SKV@def*\SKV@ifkeyreserved[#1]#2#3{%
\XKV@checksanitizeb{#1}\SKV@tempa
\SKV@despacelist*\SKV@tempa
- \XKV@knftrue
+ \SKV@swtrue
\SKV@for*[,]\SKV@tempa\SKV@tempa{%
\SKV@expnext\SKV@ifkey@reserved\SKV@tempa{#2}{#3}%
}%
- \@nameuse{@\ifXKV@knf second\else first\fi oftwo}%
+ \@nameuse{SKV@\ifSKV@sw2\else1\fi of2}%
}
\SKV@def*\SKV@ifkey@reserved#1#2#3{%
\XKV@makepf{#1}%
\XKV@checksanitizeb{#2}\XKV@fams
\SKV@despacelist*\XKV@fams
\SKV@sp@def{#3}\XKV@tkey
- \XKV@whilist\XKV@fams\XKV@tfam\ifXKV@knf\fi{%
+ \XKV@whilist\XKV@fams\XKV@tfam\ifSKV@sw\fi{%
\XKV@makehd\XKV@tfam
- \SKV@ifcsdef{\XKV@header\XKV@tkey @reser}{\XKV@knffalse}{}%
+ \SKV@ifcsdef{\XKV@header\XKV@tkey @reser}\SKV@swfalse\relax
}%
}
\SKV@def*\ifkeysuspended{\@testopt\SKV@ifkeysuspended{KV}}
\SKV@def*\SKV@ifkeysuspended[#1]#2#3{%
\XKV@checksanitizeb{#1}\SKV@tempa
\SKV@despacelist*\SKV@tempa
- \XKV@knftrue
+ \SKV@swtrue
\SKV@for*[,]\SKV@tempa\SKV@tempa{%
\SKV@expnext\SKV@ifkey@suspended\SKV@tempa{#2}{#3}%
}%
- \@nameuse{@\ifXKV@knf second\else first\fi oftwo}%
+ \@nameuse{SKV@\ifSKV@sw2\else1\fi of2}%
}
\SKV@def*\SKV@ifkey@suspended#1#2#3{%
\XKV@makepf{#1}%
\XKV@checksanitizeb{#2}\XKV@fams
\SKV@despacelist*\XKV@fams
\SKV@sp@def{#3}\XKV@tkey
- \XKV@whilist\XKV@fams\XKV@tfam\ifXKV@knf\fi{%
+ \XKV@whilist\XKV@fams\XKV@tfam\ifSKV@sw\fi{%
\XKV@makehd\XKV@tfam
- \SKV@ifcsdef{\XKV@header\XKV@tkey @susp}{\XKV@knffalse}{}%
+ \SKV@ifcsdef{\XKV@header\XKV@tkey @susp}\SKV@swfalse\relax
}%
}
\SKV@def*\ifkeydefined{\@testopt\SKV@ifkeydefined{KV}}
\SKV@def*\SKV@ifkeydefined[#1]#2#3{%
\XKV@checksanitizeb{#1}\SKV@tempa
\SKV@despacelist*\SKV@tempa
- \XKV@knftrue
+ \SKV@swtrue
\SKV@for*[,]\SKV@tempa\SKV@tempa{%
\SKV@expnext\SKV@ifk@ydefined\SKV@tempa{#2}{#3}%
}%
- \@nameuse{@\ifXKV@knf second\else first\fi oftwo}%
+ \@nameuse{SKV@\ifSKV@sw2\else1\fi of2}%
}
\SKV@def*\SKV@ifk@ydefined#1#2#3{%
\XKV@makepf{#1}%
\XKV@checksanitizeb{#2}\XKV@fams
\SKV@despacelist*\XKV@fams
\SKV@sp@def{#3}\XKV@tkey
- \XKV@whilist\XKV@fams\XKV@tfam\ifXKV@knf\fi{%
+ \XKV@whilist\XKV@fams\XKV@tfam\ifSKV@sw\fi{%
\XKV@makehd\XKV@tfam
- \SKV@ifcsdef{\XKV@header\XKV@tkey}{\XKV@knffalse}{}%
+ \SKV@ifcsdef{\XKV@header\XKV@tkey}\SKV@swfalse\relax
}%
}
\SKV@def*\SKV@disabledkey@err{%
@@ -2479,7 +2707,7 @@
\SKV@despacelist*\SKV@tempa
\SKV@for@b\SKV@tempa\SKV@tempa{%
\SKV@ifcsundef{\XKV@header\SKV@tempa}{%
- \SKV@vbsmsg{warn}{%
+ \SKV@vbmsg{warn}{%
Key '\SKV@tempa' with prefix '\SKV@pref'
\SKV@MB is undefined in family '\XKV@tfam':
\SKV@MB can't be suspended\on@line}%
@@ -2500,7 +2728,7 @@
\edef\SKV@suspkey{#1}%
\global\SKV@csletcs{\XKV@header#1@susp}{\XKV@header#1}%
\SKV@csedef*{\XKV@header#1}{\SKV@suspkey@e@r}%
- \SKV@vbsmsg{info}{Key '\SKV@suspkey' with prefix '\SKV@pref' in
+ \SKV@vbmsg{info}{Key '\SKV@suspkey' with prefix '\SKV@pref' in
\SKV@MB family '\XKV@tfam' was suspended\on@line}%
}%
}
@@ -2526,7 +2754,7 @@
\SKV@despacelist*\SKV@tempa
\SKV@for@b\SKV@tempa\SKV@tempa{%
\SKV@ifcsundef{\XKV@header\SKV@tempa}{%
- \SKV@vbsmsg{warn}{Key '\SKV@tempa' with prefix '\SKV@pref'
+ \SKV@vbmsg{warn}{Key '\SKV@tempa' with prefix '\SKV@pref'
\SKV@MB is undefined in family '\XKV@tfam':
\SKV@MB can't be restored\on@line}%
}{%
@@ -2543,7 +2771,7 @@
\edef\SKV@restoredkey{#1}%
\SKV@csletcs{\XKV@header#1}{\XKV@header#1@susp}%
\SKV@csundef{\XKV@header#1@susp}%
- \SKV@vbsmsg{info}{Key '\SKV@restoredkey' with prefix
+ \SKV@vbmsg{info}{Key '\SKV@restoredkey' with prefix
'\SKV@pref' in family \SKV@MB '\XKV@tfam' restored\on@line}%
}%
}
@@ -2577,7 +2805,7 @@
{First restore key '\SKV@tempa' before removing it.}%
}%
\SKV@ifcsundef{\XKV@header\SKV@tempa}{%
- \SKV@vbsmsg{warn}{Key '\SKV@tempa' with prefix '\SKV@pref'
+ \SKV@vbmsg{warn}{Key '\SKV@tempa' with prefix '\SKV@pref'
\SKV@MB is undefined in family '\XKV@tfam':
\SKV@MB I can't remove or unreserve it\on@line}%
}{%
@@ -2596,7 +2824,7 @@
\SKV@csgundef{\SKV@tempa}%
}%
\endgroup
- \SKV@vbsmsg{info}{Key '#1' with prefix '\SKV@pref' in family\SKV@MB
+ \SKV@vbmsg{info}{Key '#1' with prefix '\SKV@pref' in family\SKV@MB
'\XKV@tfam' was removed\on@line}%
}
\SKV@newlet\unreserve@keys\remove@keys
@@ -2610,12 +2838,16 @@
}%
}
\SKV@def*\SKV@undefinedkeys#1#2#3{%
- \edef\SKV@resvd##1{\SKV@addtolist?[;]##1{(#1:#2:#3)}}%
+ \edef\SKV@resvd##1{\SKV@addtolist![;]##1{(#1:#2:#3)}}%
\SKV@resvd\SKV@und@finedkeys
}
\SKV@predef*\ExecuteOptionsX{%
\SKV@sktrue\XKV@stfalse\XKV@plfalse\XKV@t@stopte\XKV@setkeys}
\SKV@predef*\setkeys{\SKV@sktrue\XKV@testopta{\XKV@testoptc\XKV@setkeys}}
+\SKV@newlet\skvsetkeys\setkeys
+\SKV@pdef*\UseSkeyvalSetkeys{%
+ \SKV@ifx\setkeys\skvsetkeys\relax{\let\setkeys\skvsetkeys}%
+}
\SKV@redef*\XKV@setkeys[#1]#2{%
\def\skif##1{%
\SKV@ensurenoscape{##1}%
@@ -2625,8 +2857,11 @@
}%
\csname if##1\endcsname
}%
- \let\skifx\ifx\let\skifcase\ifcase\let\skor\or
- \let\skelse\else\let\skfi\fi
+ \let\skifx\ifx
+ \let\skifcase\ifcase
+ \let\skor\or
+ \let\skelse\else
+ \let\skfi\fi
\let\SKV@und@finedkeys\@empty
\XKV@checksanitizea{#2}\XKV@resb
\SKV@normalizea\XKV@resb
@@ -2642,10 +2877,14 @@
\let\CurrentOption\@empty
\SKV@skfalse
\SKV@ifx\SKV@und@finedkeys\@empty{}{%
- \SKV@warn{*** Unknown keys: \SKV@expox\SKV@und@finedkeys}%
- \typein[\answer]{^^JThere were undefined keys: see list above.
+ \def\SKV@tempa{stop}%
+ \SKV@warn{\string\setkeys\space error: Unknown keys:\SKV@MB
+ \SKV@expox\SKV@und@finedkeys}%
+ \typein[\answer]{%
+ ^^JThe following keys are undefined and couldn't be set:
+ ^^J\SKV@expox\SKV@und@finedkeys
^^JEnter 'stop' or 'go' and <return> to continue.}%
- \SKV@oifstrequal{\answer}{stop}{\stop}{}%
+ \ifx\answer\SKV@tempa\stop\fi
}%
}
\SKV@redef*\XKV@s@tk@ys#1=#2=#3\@nil{%
@@ -2656,7 +2895,8 @@
\SKV@err{No key specified for value '#2'}%
{You have supplied a value '#2' without key name.\SKV@MB
This is certainly an error on your part.\SKV@MB
- Please correct the error and rerun.}
+ I can't process this value without key name.\SKV@MB
+ Please enter 'X' and <return>. Correct the error and rerun.}
}%
}{%
\@expandtwoargs\in@{,\XKV@tkey,}{,\XKV@na,}%
@@ -2689,7 +2929,7 @@
\ifXKV@st
\XKV@addtolist@o\XKV@rm\CurrentOption
\else
- \SKV@undefinedkeys{\SKV@pref}{\XKV@fams}{\XKV@tkey}%
+ \SKV@undefinedkeys\SKV@pref\XKV@fams\XKV@tkey
\fi
\fi
\else
@@ -2702,7 +2942,7 @@
}
\SKV@redef*\XKV@s@tk@ys@#1{%
\SKV@ifcsundef{\XKV@header\XKV@tkey}{%
- \SKV@vbsmsg{warn}{No key macro for key '\XKV@tkey'\SKV@MB
+ \SKV@vbmsg{warn}{No key macro for key '\XKV@tkey'\SKV@MB
in families '\XKV@fams'}%
}{%
\XKV@knffalse
@@ -2746,9 +2986,9 @@
}%
}
\SKV@def*\SKV@testuservaluekey#1#2{%
- \SKV@tempswtrue\SKV@uvfalse
- \XKV@whilist#1\SKV@tempa\ifSKV@tempsw\fi{%
- \ifx#2\SKV@tempa\SKV@uvtrue\SKV@tempswfalse\fi
+ \SKV@swtrue\SKV@uvfalse
+ \XKV@whilist#1\SKV@tempa\ifSKV@sw\fi{%
+ \ifx#2\SKV@tempa\SKV@uvtrue\SKV@swfalse\fi
}%
}
\SKV@def*\SKV@remspaceletter#1#2{%
@@ -2842,7 +3082,7 @@
\SKV@ifcsdef\SKV@tempa{%
\SKV@err{%
\string#1\space already saved. You've to restore\SKV@MB
- it or undefine '\SKV@expcsox{\SKV@tempa}' before\SKV@MB
+ it or undefine '\SKV@csexpox{\SKV@tempa}' before\SKV@MB
you can save \string#1\space again
}\@ehc
}{%
@@ -2892,14 +3132,14 @@
\SKV@t@stopta{\SKV@testopt\SKV@InputFileOnce{.}}%
}
\SKV@def*\SKV@InputFileOnce[#1]#2{%
- \gapptomac\input@path{{#1/}}%
+ \SKV@appto!\input@path{{#1/}}%
\ifSKV@st
\SKV@afterelsefi
\SKV@inputfile{#1}{#2}%
\else
\SKV@afterfi
\SKV@ifcsdef{#2@read}{%
- \SKV@vbsmsg{warn}{File '#2' already read:\SKV@MB
+ \SKV@vbmsg{warn}{File '#2' already read:\SKV@MB
File '#2' can't be read again}%
}{%
\SKV@inputfile{#1}{#2}%
@@ -2912,32 +3152,31 @@
\SKV@pdef*\SKV@notloadederr#1{%
\SKV@ifcsdef{ver@#1.\@pkgextension}{}{%
\SKV@err{Package '#1' wasn't loaded}%
- {Document has begun and package '#1' wasn't loaded.}%
+ {Document has begun and package '#1' wasn't loaded.\SKV@MB
+ You wanted package '#1' loaded.}%
}%
}
\SKV@def*\SKV@notloaded{}
\SKV@pdef*\@ensurepackageloaded#1{%
\SKV@for[,]{#1}\SKV@resvd{%
- \expandafter\gapptomac\expandafter\SKV@notloaded
- \expandafter{\expandafter\SKV@do@b\expandafter{\SKV@resvd}}%
+ \edef\SKV@resvd##1##2{\SKV@appto!##1{##2{\SKV@resvd}}}%
+ \SKV@resvd\SKV@notloaded\SKV@doloaded
}%
}
\SKV@AtDocumentStart{%
- \let\SKV@do@b\SKV@notloadederr
+ \let\SKV@doloaded\SKV@notloadederr
\SKV@notloaded
- \global\let\SKV@do@b\@gobble
+ \global\let\SKV@doloaded\@gobble
}
\SKV@onlypreamble{%
- \SKV@preamblecmds\SKV@onlypreamble
- \@afterpackageloaded\@ifpackagecurrent\@ifpackagenotcurrent
- \SKV@notloaded\@ensurepackageloaded\SKV@AtPackageEnd
- \SKV@AtClassEnd\SKV@BeforePackageEnd\SKV@BeforeClassEnd
- \SKV@AfterPackageEnd\SKV@AfterClassEnd\SKV@BeforeLastPage
- \SKV@AfterLastPage\SKV@AfterDocumentEnd
+ \SKV@preamblecmds,\SKV@onlypreamble,\@afterpackageloaded,
+ \@ifpackagecurrent,\@ifpackagenotcurrent,\@ifloadedandcurrent,
+ \@ensurepackageloaded,\SKV@AtPackageEnd,\SKV@AtClassEnd,
+ \SKV@BeforePackageEnd,\SKV@BeforeClassEnd,\SKV@AfterPackageEnd,
+ \SKV@AfterClassEnd,\SKV@BeforeLastPage,\SKV@AfterLastPage,
+ \SKV@AfterDocumentEnd,\UseSkeyvalSetkeys
}
-%\InputIfFileExists{skeyval-x.sty}{}{}
-
\endinput
%%% End of file skeyval.sty %%%