%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
%                                                                          %
% This is file 'skeyval.sty', version 0.6.                                 %
%                                                                          %
% This package and accompanying files may be distributed and/or            %
% modified under the conditions of the LaTeX Project Public License,       %
% either version 1.3 of this license or any later version. The latest      %
% version of this license is in http://www.latex-project.org/lppl.txt      %
% and version 1.3 or later is part of all distributions of LaTeX           %
% version 2005/12/01 or later.                                             %
%                                                                          %
% The LPPL maintenance status of this software is 'author-maintained'.     %
%                                                                          %
% This software is provided 'as it is', without warranty of any kind,      %
% either expressed or implied, including, but not limited to, the          %
% implied warranties of merchantability and fitness for a particular       %
% purpose.                                                                 %
%                                                                          %
% Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com).                   %
%                                                                          %
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%

\begingroup
\catcode064 11% @
\catcode123 01% {
\catcode125 02% }
\def\SKV@tempa{\endgroup
  \edef\SKV@restorecodes{%
    \catcode035 \the\catcode035% #
    \catcode064 \the\catcode064% @
    \catcode123 \the\catcode123% {
    \catcode125 \the\catcode125% }
    \catcode061 \the\catcode061% =
  }%
}
\SKV@tempa
\catcode035 06% #
\catcode061 12% =
\catcode064 11% @
\catcode123 01% {
\catcode125 02% }
\def\SKV@setcode#1#2{%
  \edef\SKV@restorecodes{%
    \SKV@restorecodes
    \catcode#1 \the\catcode#1\relax
  }%
  \catcode#1 #2\relax
}
\AtEndOfPackage{%
  \SKV@AfterPackageEnd{%
    \SKV@restorecodes
    \SKV@Undef?{\SKV@setcode\SKV@restorecodes}%
  }%
}
\SKV@setcode{010}{12}% ^^J
\SKV@setcode{036}{03}% $
\SKV@setcode{038}{03}% &
\SKV@setcode{040}{12}% (
\SKV@setcode{041}{12}% )
\SKV@setcode{042}{12}% *
\SKV@setcode{043}{12}% +
\SKV@setcode{044}{12}% ,
\SKV@setcode{045}{12}% -
\SKV@setcode{047}{12}% /
\SKV@setcode{058}{12}% :
\SKV@setcode{059}{12}% ;
\SKV@setcode{063}{12}% ?
\SKV@setcode{091}{12}% [
\SKV@setcode{093}{12}% ]
\SKV@setcode{096}{12}% `
\SKV@setcode{126}{13}% ~
\def\SKV@rcsid$#1: #2 #3 #4 #5${#4 v#3}
\ProvidesPackage{skeyval}%
  [\SKV@rcsid $Id: skeyval.sty,v 0.6 2010/04/20 09:00:00 Ahmed Musa $
  Extensions to the xkeyval parser (AM)]
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ifnum0=0%
  \ifx\eTeXversion\SKV@undefined1\else\ifnum\eTeXversion<\tw@1\fi\fi
\else
  \PackageError{skeyval}{eTeX not loaded or old version}%
    {This package requires eTeX version 2 or later.}%
  \endinput
\fi
\newtoks\SKV@toks
\newcount\SKV@depth
\def\@nil{\@unexpandable@protect\@nil}
\def\@nnil{\@nil}
\long\def\SKV@car#1#2\@nil{#1}
\long\def\SKV@cdr#1#2\@nil{#2}
\long\def\SKV@carcube#1#2#3#4\@nil{#1#2#3}
\long\def\@firstofthree#1#2#3{#1}
\long\def\@secondofthree#1#2#3{#2}
\long\def\@thirdofthree#1#2#3{#3}
\newcommand*\@threeexpafter{\expandafter\expandafter\expandafter}
\def\SKV@aftercs#1#2{\expandafter#1\csname#2\endcsname}
\def\SKV@xaftercs#1#2{\@threeexpafter#1\csname#2\endcsname}
\SKV@aftercs\let{SKV@1of1}\@firstofone
\SKV@aftercs\let{SKV@1of2}\@firstoftwo
\SKV@aftercs\let{SKV@2of2}\@secondoftwo
\SKV@aftercs\let{SKV@1of3}\@firstofthree
\SKV@aftercs\let{SKV@2of3}\@secondofthree
\SKV@aftercs\let{SKV@3of3}\@thirdofthree
\def\SKV@ifx#1#2{\@nameuse{SKV@\ifx#1#21\else2\fi of2}}
\def\SKV@unifx#1#2{\@nameuse{SKV@\ifx#1#22\else1\fi of2}}
\def\SKV@csifx#1#2{\begingroup\expandafter\endgroup\expandafter
  \SKV@ifx\csname#1\endcsname#2}
\def\SKV@uncsifx#1#2{\begingroup\expandafter\endgroup\expandafter
  \SKV@unifx\csname#1\endcsname#2}
\def\SKV@ifxcs#1#2{\begingroup\expandafter\endgroup\expandafter
  \SKV@ifx\expandafter#1\csname#2\endcsname}
\def\SKV@unifxcs#1#2{\begingroup\expandafter\endgroup\expandafter
  \SKV@unifx\expandafter#1\csname#2\endcsname}
\def\SKV@ifdefined#1{\@nameuse{SKV@\ifdefined#11\else2\fi of2}}
\def\SKV@unifdefined#1{\@nameuse{SKV@\ifdefined#12\else1\fi of2}}
\def\SKV@ifcsname#1{\@nameuse{SKV@\ifcsname#1\endcsname1\else2\fi of2}}
\def\SKV@unifcsname#1{\@nameuse{SKV@\ifcsname#1\endcsname2\else1\fi of2}}
\def\SKV@iftest#1#2{\@nameuse{SKV@\@nameuse{#1}#21\else2\fi of2}}
\begingroup
\def\SKV@tempa{%
  \def\SKV@nodocerr{%
    \PackageError{skeyval}{'skeyval' package loaded before
      \string\documentclass}{Load skeyval package after
      \string\documentclass.}%
    \endinput
  }%
  \def\SKV@tempb##1\@nil,{}%
  \def\SKV@tempa##1,{%
    \def\@currname{##1}%
    \SKV@ifx\SKV@documentclass\SKV@undefined{%
      \SKV@ifx\@currname\@nnil{}{%
        \filename@parse\@currname
        \SKV@unifx\filename@ext\@clsextension{}{%
          \SKV@unifcsname{opt@\filename@area\filename@base.%
            \filename@ext}{}{%
            \edef\SKV@documentclass{\filename@area%
              \filename@base.\filename@ext}%
          }%
        }%
        \SKV@tempa
      }%
    }{%
      \let\SKV@tempa\SKV@tempb\SKV@tempa
    }%
  }%
  \SKV@ifx\@filelist\relax\SKV@nodocerr{%
    \SKV@ifx\@filelist\@gobble\SKV@nodocerr{%
      \expandafter\SKV@tempa\@filelist,\@nil,%
    }%
  }%
  \SKV@ifx\SKV@documentclass\SKV@undefined\SKV@nodocerr\relax
}
\SKV@tempa\endgroup
\def\SKV@ifdefinable#1{%
  \begingroup\escapechar92\afterassignment\endgroup
  \xdef\reserved@a{\expandafter\@gobble\string#1}%
  \SKV@ifdefined#1{%
    \SKV@ifx{#1}\relax\@firstofone\@notdefinable
  }{%
    \edef\reserved@b{\expandafter\SKV@carcube\reserved@a xxx\@nil}%
    \SKV@ifx\reserved@b\@qend\@notdefinable
      {\SKV@ifx\reserved@a\@qrelax\@notdefinable\@firstofone}%
  }%
}
\newcommand*\@ifpackagecurrent[2]{%
  \@nameuse{SKV@\SKV@iftest{ifnum}{\@threeexpafter\@parse@version
  \csname ver@#1.\@pkgextension\endcsname//00\@nil
  <\expandafter\@parse@version#2//00\@nil}{2}{1}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
  }%
}{\RequirePackage{xkeyval}[2008/08/13]}
\SKV@ifdefinable\SKV@ifdefinable@n\relax
\protected\def\SKV@ifdefinable@n#1{%
  \XKV@sp@deflist\SKV@tempa{#1}%
  \XKV@for@o\SKV@tempa\SKV@tempa{%
    \edef\resvd@a{\@threeexpafter\SKV@car
      \expandafter\string\SKV@tempa\@nil}%
    \ifx\resvd@a\@backslashchar
      \PackageError{skeyval}{Backslash not allowed}{Backslash not
        allowed in argument of '\string\SKV@ifdefinable@n'.}%
    \fi
    \@threeexpafter\SKV@ifdefinable
      \expandafter\csname\SKV@tempa\endcsname\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@ensurescape{#1}%
  \SKV@unifdefined{#1}{}{%
    \SKV@ifx{#1}\relax{}{%
      \SKV@vbsmsg{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@ensurescape{#1}%
  \SKV@unifdefined{#1}{}{%
    \SKV@ifx{#1}\relax{}{%
      \SKV@vbsmsg{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{%
  \begingroup
  \def\@i{info}\def\@ii{warn}\def\@iii{#1}%
  \csname SKV@\ifSKV@verbose1\else2\fi of2\endcsname
  {\SKV@ifx\@i\@iii
      {\SKV@info{#2}}%
        {\SKV@ifx\@ii\@iii{\SKV@warn{#2}}{}}%
  }{}%
  \endgroup
}
\define@boolkeys[KV]{skeyval@i}[SKV@]{st,pl,ask,sk,loc,uv}[true]
\setkeys[KV]{skeyval@i}{st,pl,ask,sk,loc,uv}
\define@boolkey+[KV]{skeyval}[SKV@]{verbose}[true]{}{%
  \SKV@inputerr{#1}{verbose}%
}
\setkeys[KV]{skeyval}{verbose=false}
\SKV@pdef\SKV@info#1{\PackageInfo{skeyval}{#1\@gobble}}
\SKV@pdef\SKV@warn#1{\PackageWarningNoLine{skeyval}{#1}}
\SKV@pdef\SKV@err#1#2{\PackageError{skeyval}{#1}{#2}}
\SKV@def*\SKV@MB{\MessageBreak}
\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@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}%
    \SKV@ifempty{#3}{\advance\SKV@depth\@ne}{}%
  \else
    \SKV@err{Unknown state identifier}%
      {I expected '\string#1' to be number 0 or 1.}%
  \fi
  \XKV@for@o\SKV@ste\SKV@ste{%
    \SKV@aftercs\let{\SKV@ste#2\SKV@aftercs}{\SKV@ste#3}%
  }%
  \ifcase#1\relax
    \SKV@ifempty{#2}{\advance\XKV@depth\m@ne}{}%
  \or
    \SKV@ifempty{#2}{\advance\SKV@depth\m@ne}{}%
  \fi
}
\SKV@def*\XKV@savstate{\SKV@state{0}{@\romannumeral\XKV@depth}{}}
\SKV@def*\XKV@resstate{\SKV@state{0}{}{@\romannumeral\XKV@depth}}
\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}}
\def\SKV@scantoks#1#2{%
  \begingroup
  \edef\SKV@tempa{\endgroup
    \unexpanded{%
      #1\everyeof{\noexpand}\endlinechar\m@ne
      \makeatletter\scantokens
    }{#2}%
    \catcode`\noexpand\@=\the\catcode`\@\relax
    \everyeof{\the\everyeof}%
    \noexpand\endlinechar\the\endlinechar\relax
  }%
  \SKV@tempa
}
\SKV@def\SKV@newcs#1#2{%
  \SKV@ifcsname{#2}{%
    \SKV@csifx{#2}\relax{}{\def\reserved@a{#2}\@notdefinable}%
  }{\SKV@aftercs{#1}{#2}}%
}
\SKV@pdef*\SKV@csdef{\SKV@savstate\SKV@t@st@pta\SKV@@csdef}
\SKV@def*\SKV@@csdef#1{%
  \ifSKV@pl
    \let\SKV@n@xt\SKV@newcs
  \else
    \let\SKV@n@xt\SKV@aftercs
  \fi
  \SKV@resstate\SKV@n@xt\def{#1}%
}
\SKV@pdef*\SKV@csgdef{\SKV@savstate\SKV@t@st@pta\SKV@@csgdef}
\SKV@def*\SKV@@csgdef#1{%
  \ifSKV@pl
    \let\SKV@n@xt\SKV@newcs
  \else
    \let\SKV@n@xt\SKV@aftercs
  \fi
  \SKV@resstate\SKV@n@xt\gdef{#1}%
}
\SKV@pdef*\SKV@csedef{\SKV@savstate\SKV@t@st@pta\SKV@@csedef}
\SKV@def*\SKV@@csedef#1{%
  \ifSKV@pl
    \let\SKV@n@xt\SKV@newcs
  \else
    \let\SKV@n@xt\SKV@aftercs
  \fi
  \SKV@resstate\SKV@n@xt\edef{#1}%
}
\SKV@pdef*\SKV@csxdef{\SKV@savstate\SKV@t@st@pta\SKV@@csxdef}
\SKV@def*\SKV@@csxdef#1{%
  \ifSKV@pl
    \let\SKV@n@xt\SKV@newcs
  \else
    \let\SKV@n@xt\SKV@aftercs
  \fi
  \SKV@resstate\SKV@n@xt\xdef{#1}%
}
\SKV@def*\SKV@csuse#1{\SKV@ifcsname{#1}{\@nameuse{#1}}{}}
\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}%
    \else
      \SKV@err{Unknown expansion type '\string#1' for
        \string\SKV@expargs}{I expected your first
          argument '\string#1' to be between 0 and 3.}%
    \fi
  }%
  \SKV@tempa
}
\SKV@def*\SKV@findescape#1{%
  \begingroup\escapechar92\relax
  \edef\resvd@a{\expandafter\SKV@car\string#1\@nil}%
  \expandafter\aftergroup\csname SKV@%
  \SKV@ifx\resvd@a\@backslashchar{1}{2}of2\endcsname
  \endgroup
}
\SKV@def*\SKV@ensurescape#1{%
  \SKV@findescape{#1}{}%
    {\SKV@err{Backslash required in '\string#1'}%
      {I expected a backslash to be the leading\SKV@MB
        character in your argument '\string#1'.}}%
}
\SKV@def*\SKV@ensurenoscape#1{%
  \SKV@findescape{#1}%
    {\SKV@err{Backslash not allowed in '\string#1'}%
      {I didn't expect a backslash to be the leading\SKV@MB
        character in your argument '\string#1'.}}{}%
}
\SKV@pdef\SKV@ifnextchar#1#2#3{%
  \let\SKV@nxc#1\def\SKV@nxa{#2}\def\SKV@nxb{#3}%
  \futurelet\@temptoks\SKV@ifnextch@r
}
\SKV@def*\SKV@ifnextch@r{%
  \ifx\@temptoks\SKV@nxc\let\SKV@nxb\SKV@nxa\fi\SKV@nxb
}
\SKV@pdef\SKV@ifstar#1#2{%
  \SKV@ifnextchar*{\begingroup
    \def\SKV@tempa*{\endgroup #1}\SKV@tempa}{#2}%
}
\SKV@pdef\SKV@ifplus#1#2{%
  \SKV@ifnextchar+{\begingroup
    \def\SKV@tempa+{\endgroup #1}\SKV@tempa}{#2}%
}
\SKV@pdef\SKV@ifask#1#2{%
  \SKV@ifnextchar?{\begingroup
    \def\SKV@tempa?{\endgroup #1}\SKV@tempa}{#2}%
}
\SKV@pdef\SKV@ifbrack#1#2{\SKV@ifnextchar[{#1}{#2}}
\SKV@pdef\SKV@ifparen#1#2{\SKV@ifnextchar({#1}{#2}}
\SKV@pdef*\SKV@testopt#1#2{\SKV@ifnextchar[{#1}{#1[{#2}]}}
\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@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}}}
\SKV@pdef*\SKV@testoptd#1{\SKV@t@stopta{\SKV@testopt#1{,}}}
\SKV@pdef*\SKV@testopte#1{\SKV@testoptb{\SKV@testopt#1{,}}}
\SKV@pdef*\SKV@t@stopte#1{\SKV@t@stoptb{\SKV@testopt#1{,}}}
\SKV@pdef*\SKV@testoptf#1{\SKV@testoptc{\SKV@testopt#1{,}}}
\SKV@def*\SKV@Test@pt#1{\@nameuse{SKV@\SKV@ifempty{#1}{1}{2}of2}}
\SKV@def*\SKV@TestOpt#1#2#3{\SKV@@TestOpt#1&[&{#2#1}{#2[{#3}]{#1}}}
\SKV@def*\SKV@@TestOpt#1[#2&#3#{\SKV@Test@pt{#1#2}}
\SKV@def*\SKV@IfStar#1#2#3{\SKV@@IfStar#1&*&{#2}{#3{#1}}}
\SKV@def*\SKV@@IfStar#1*#2&#3#{\SKV@Test@pt{#1#2}}
\SKV@def*\SKV@IfPlus#1#2#3{\SKV@@IfPlus#1&+&{#2}{#3{#1}}}
\SKV@def*\SKV@@IfPlus#1+#2&#3#{\SKV@Test@pt{#1#2}}
\SKV@def*\SKV@IfAsk#1#2#3{\SKV@@IfAsk#1&?&{#2}{#3{#1}}}
\SKV@def*\SKV@@IfAsk#1?#2&#3#{\SKV@Test@pt{#1#2}}
\SKV@pdef*\NewWrites{\SKV@testopt\SKV@NewWrites{}}
\SKV@pdef*\SKV@NewWrites[#1]#2{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \SKV@aftercs\SKV@ifdefinable{#1\SKV@tempa}{%
      \@nameuse{newwrite\SKV@aftercs}{#1\SKV@tempa}%
    }%
  }%
}
\SKV@pdef*\NewIfs{\SKV@testopt\SKV@NewIfs{}}
\SKV@pdef*\SKV@NewIfs[#1]#2{\SKV@testopt{\SKV@NewIf@[#1]{#2}}{false}}
\SKV@pdef*\SKV@NewIf@[#1]#2[#3]{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \SKV@aftercs\SKV@ifdefinable{if#1\SKV@tempa}{%
     \@nameuse{newif\SKV@aftercs}{if#1\SKV@tempa}%
     \@nameuse{#1\SKV@tempa#3}%
    }%
  }%
}
\SKV@pdef*\NewTogs{\SKV@testopt\SKV@NewTogs{}}
\SKV@pdef*\SKV@NewTogs[#1]#2{\SKV@testopt{\SKV@NewT@gs[#1]{#2}}{false}}
\SKV@pdef*\SKV@NewT@gs[#1]#2[#3]{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \edef\SKV@tempa{#1\SKV@tempa}%
    \SKV@expnext\newtog\SKV@tempa
    \@nameuse{tog#3\SKV@expnext}\SKV@tempa
  }%
}
\SKV@pdef*\NewToks{\SKV@testopt\SKV@NewToks{}}
\SKV@pdef*\SKV@NewToks[#1]#2{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \SKV@aftercs\SKV@ifdefinable{#1\SKV@tempa}{%
      \@nameuse{newtoks\SKV@aftercs}{#1\SKV@tempa}%
    }%
  }%
}
\SKV@pdef*\NewCounts{\SKV@testopt\SKV@NewCounts{}}
\SKV@pdef*\SKV@NewCounts[#1]#2{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \SKV@aftercs\SKV@ifdefinable{#1\SKV@tempa}{%
      \@nameuse{newcount\SKV@aftercs}{#1\SKV@tempa}%
    }%
  }%
}
\SKV@pdef*\NewDimens{\SKV@testopt\SKV@NewDimens{}}
\SKV@pdef*\SKV@NewDimens[#1]#2{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \SKV@aftercs\SKV@ifdefinable{#1\SKV@tempa}{%
      \@nameuse{newdimen\SKV@aftercs}{#1\SKV@tempa}%
    }%
  }%
}
\SKV@pdef*\NewBoxes{\SKV@testopt\SKV@NewBoxes{}}
\SKV@pdef*\SKV@NewBoxes[#1]#2{%
  \SKV@for[,]{#2}\SKV@tempa{%
    \SKV@expnext\SKV@ensurenoscape\SKV@tempa
    \SKV@aftercs\SKV@ifdefinable{#1\SKV@tempa}{%
      \@nameuse{newbox\SKV@aftercs}{#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@ifblank{#2}{%
      \SKV@err{Arguments of '\string\SKV@expnext' can't be empty}\@ehc
    }{%
      \SKV@iftest{if}{@\detokenize\expandafter{\SKV@cdr#1\@nil}@}{%
        \expandafter#1\expandafter{#2}%
      }{%
        \SKV@err{Invalid arguments '\string#1' for
          '\string\SKV@expnext'\SKV@MB}\@ehc
      }%
    }%
  }%
}
\SKV@pdef*\SKV@DelayedAfterPackageEnd#1{%
  \AtEndOfPackage{\SKV@AfterPackageEnd{#1}}}
\SKV@def\DeclarePackageCommand#1#2{%
  \SKV@ensurescape{#2}%
  \SKV@ifdefined#2{%
    \edef\resvd@a{\expandafter\@gobble\string#2}%
    \SKV@aftercs\let{Saved\resvd@a}#2%
    \edef\resvd@a##1{%
      \SKV@DelayedAfterPackageEnd{##1Saved\resvd@a\noexpand\endcsname}%
    }%
    \resvd@a{\expandafter\let\expandafter#2\csname}%
    \let\resvd@a\relax
  }{\SKV@DelayedAfterPackageEnd{\SKV@gundef#2}}%
  #1#2%
}
\DeclarePackageCommand{\protected\def}\@namegdef{\SKV@aftercs\gdef}
\DeclarePackageCommand{\protected\def}\@nameedef{\SKV@aftercs\edef}
\DeclarePackageCommand{\protected\def}\@namexdef{\SKV@aftercs\xdef}
\SKV@pdef*\SKV@ifnew{\SKV@savstate\SKV@t@stopte\SKV@@ifnew}
\SKV@def*\SKV@@ifnew[#1]#2{%
  \ifSKV@st
    \ifSKV@pl
      \def\SKV@ndl{\SKV@for*[#1]#2}%
    \else
      \def\SKV@ndl{\SKV@tfor*#2}%
    \fi
  \else
    \ifSKV@pl
      \def\SKV@ndl{\SKV@for[#1]{#2}}%
    \else
      \def\SKV@ndl{\SKV@tfor{#2}}%
    \fi
  \fi
  \SKV@ndl\SKV@ndl{%
    \ifSKV@pl
      \SKV@despace\SKV@ndl
      \SKV@expargs{1}\SKV@aftercs
        \SKV@ifdefinable{\SKV@ndl}\@nil\relax
    \else
      \expandafter\SKV@ifdefinable\SKV@ndl\relax
    \fi
  }%
  \SKV@resstate
}
\let\SKV@no\z@
\SKV@pdef*\SKV@aftergroup{%
  \SKV@ifstar{\SKV@aft@rgroup\@firstofone}{\SKV@aft@rgroup\unexpanded}%
}
\SKV@def\SKV@aft@rgroup#1#2{%
  \edef\SKV@no{\the\numexpr\SKV@no+1}%
  \SKV@aftercs\xdef{SKV@aft@rgr@up\SKV@no}{%
    \SKV@csgundef{SKV@aft@rgr@up\SKV@no}%
    #1{#2}%
  }%
  \SKV@aftercs\aftergroup{SKV@aft@rgr@up\SKV@no}%
}
\SKV@pdef*\SKV@afterassignment{%
  \SKV@ifstar{\SKV@aft@rassignment\@firstofone}%
    {\SKV@aft@rassignment\unexpanded}%
}
\SKV@def\SKV@aft@rassignment#1#2{%
  \begingroup
  \edef\SKV@no{\the\numexpr\SKV@no+1}%
  \SKV@aftercs\xdef{SKV@aft@rassignm@nt\SKV@no}{%
    \SKV@csgundef{SKV@aft@rassignm@nt\SKV@no}%
    #1{#2}%
  }%
  \expandafter\endgroup\expandafter\afterassignment
    \csname SKV@aft@rassignm@nt\SKV@no\endcsname
}
\SKV@def*\SKV@trailead#1#2{%
  \edef\SKV@trail{\the\SKV@toks}%
  \SKV@toks\expandafter{\romannumeral-`\q\SKV@tr@ilead\noexpand#1& &}%
  \edef#2{\the\SKV@toks}%
  \SKV@toks\expandafter{\SKV@trail}%
  \SKV@undef\SKV@trail
}
\SKV@def*\SKV@tr@ilead#1 &{\SKV@tr@ile@d#1&}
\SKV@def*\SKV@tr@ile@d#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@exptx#1{\unexpanded\@threeexpafter{#1}}
\SKV@def*\SKV@expcstx#1{\SKV@aftercs\SKV@exptx{#1}}
\SKV@pdef*\SKV@undef#1{\let#1\SKV@undefined}
\SKV@pdef\SKV@gundef{\global\SKV@undef}
\SKV@pdef*\SKV@csundef#1{\SKV@aftercs\SKV@undef{#1}}
\SKV@pdef*\SKV@csgundef{\global\SKV@csundef}
\SKV@pdef*\SKV@undeflt#1#2{%
  \SKV@ifempty{#1}{\let\glob@lrel@x\relax}{\let\glob@lrel@x\global}%
  \SKV@for[,]{#2}\SKV@resvd{%
    \SKV@expnext\SKV@ensurescape\SKV@resvd
    \glob@lrel@x\expandafter\SKV@undef\SKV@resvd
  }%
}
\SKV@pdef*\SKV@Undef{\SKV@savstate\SKV@testopte\SKV@@Undef}
\SKV@def*\SKV@@Undef[#1]#2{%
  \ifSKV@st
    \ifSKV@pl
      \def\SKV@ndl{\SKV@for*[#1]#2}%
    \else
      \def\SKV@ndl{\SKV@tfor*#2}%
    \fi
  \else
    \ifSKV@pl
      \def\SKV@ndl{\SKV@for[#1]{#2}}%
    \else
      \def\SKV@ndl{\SKV@tfor{#2}}%
    \fi
  \fi
  \SKV@ndl\SKV@ndl{%
    \ifSKV@pl
      \SKV@despace\SKV@ndl
      \ifSKV@ask\expandafter\global\fi
      \@threeexpafter\let
      \expandafter\csname\SKV@ndl\endcsname\SKV@undefined
    \else
      \ifSKV@ask\expandafter\global\fi
      \expandafter\let\SKV@ndl\SKV@undefined
    \fi
  }%
  \SKV@resstate
}
\SKV@def*\SKV@ifdef#1{%
  \SKV@ifdefined{#1}%
    {\@nameuse{SKV@\SKV@ifx{#1}\relax{2}{1}of2}}\@secondoftwo
}
\SKV@def*\SKV@ifundef#1{\@nameuse{SKV@\SKV@ifdef{#1}{2}{1}of2}}
\SKV@def*\SKV@ifcsdef#1{%
  \SKV@ifcsname{#1}%
    {\@nameuse{SKV@\expandafter\SKV@ifx\csname#1\endcsname
      \relax{2}{1}of2}}\@secondoftwo
}
\SKV@def*\SKV@ifcsundef#1{\@nameuse{SKV@\SKV@ifcsdef{#1}{2}{1}of2}}
\SKV@pdef*\SKV@providedef{\@star@or@long\SKV@@providedef}
\SKV@def\SKV@@providedef#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@@providerobustdef}
\SKV@def\SKV@@providerobustdef#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\protected\def#1%
  }%
}
\SKV@def\TestProvidedCommand#1{%
  \begingroup
  \SKV@ifmacro#1{%
    \edef\SKV@resvd@a{\expandafter\@gobble\string#1}%
    \edef\SKV@resvd@b{\expandafter\strip@prefix\meaning#1}%
    \expandafter\aftergroup\csname SKV@\expandafter
      \ifx\expandafter\SKV@resvd@b
      \csname SKV@test@\SKV@resvd@a\endcsname
      1\else2\fi of2\endcsname
  }{\aftergroup\@secondoftwo}%
  \endgroup
}
\SKV@pdef*\SKV@newdef{\SKV@def}
\SKV@providerobustdef*\newdef{\SKV@def}
\SKV@pdef*\SKV@robustdef{\SKV@pdef}
\SKV@providerobustdef*\robustdef{\SKV@pdef}
\SKV@providerobustdef*\providedef{\SKV@providedef}
\SKV@providerobustdef*\providerobustdef{\SKV@providerobustdef}
\SKV@def\SKV@ifmacro#1{%
  \begingroup
  \edef\SKV@ifmacro##1{\def##1####1\detokenize{macro}:####2&}%
  \SKV@ifmacro\@ifmacro{\expandafter\aftergroup
    \csname SKV@\SKV@ifblank{##2}{2}{1}of2\endcsname}%
  \edef\SKV@ifmacro##1{##1\detokenize{macro}:&}%
  \SKV@ifmacro{\expandafter\@ifmacro\meaning#1}%
  \endgroup
}
\SKV@def\SKV@ifnotmacro#1{\SKV@ifmacro{#1}\@secondoftwo\@firstoftwo}
\SKV@def\SKV@ifparamacro#1{%
  \begingroup
  \edef\SKV@ifparamacro##1{%
    \def##1####1\detokenize{macro}:####2->####3&}%
  \SKV@ifparamacro\@ifparam{\expandafter\aftergroup
    \csname SKV@\SKV@ifblank{##2}{2}{1}of2\endcsname}%
  \edef\SKV@ifparamacro##1{##1\detokenize{macro}:->&}%
  \SKV@ifparamacro{\expandafter\@ifparam\meaning#1}%
  \endgroup
}
\SKV@def*\SKV@ifrelax#1{%
  \SKV@ensurescape{#1}%
  \SKV@ifdefined{#1}%
    {\@nameuse{SKV@\SKV@ifx{#1}\relax{1}{2}of2}}\@secondoftwo
}
\SKV@def*\SKV@ifcsrelax#1{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsname{#1}%
    {\@nameuse{SKV@\expandafter\SKV@ifx\csname#1\endcsname
      \relax{1}{2}of2}}\@secondoftwo
}
\SKV@def*\SKV@ifdefax#1{%
  \SKV@ensurescape{#1}%
  \SKV@ifdefined{#1}%
    {\@nameuse{SKV@\SKV@ifx{#1}\relax{2}{1}of3}}\@thirdofthree
}
\SKV@def*\SKV@ifcsdefax#1{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsname{#1}%
    {\@nameuse{SKV@\expandafter\SKV@ifx\csname#1\endcsname
      \relax{2}{1}of3}}\@thirdofthree
}
\SKV@def*\SKV@despace#1{%
  \SKV@ensurescape{#1}%
  \SKV@expnext\SKV@trailead{#1}#1%
}
\SKV@def\SKV@detokdespace#1#2{\edef#2{\detokenize{#1}}\SKV@despace#2}
\SKV@def\SKV@ifblank#1{\SKV@ifbl@nk#1&&\@secondoftwo\@firstoftwo:}
\SKV@def\SKV@ifbl@nk#1#2&#3#4#5:{#4}
\SKV@def\SKV@ifnotblank#1{\SKV@ifbl@nk#1&&\@firstoftwo\@secondoftwo:}
\SKV@def\SKV@oifblank#1{\expandafter\SKV@ifblank\expandafter{#1}}
\SKV@def\SKV@xifblank#1{\SKV@expargs{0}\SKV@ifblank{#1}\@nil}
\SKV@def\SKV@ifstrequal#1#2{%
  \begingroup
  \SKV@detokdespace{#1}\resvd@a\SKV@detokdespace{#2}\resvd@b
  \expandafter\aftergroup
  \csname SKV@\SKV@ifx\resvd@a\resvd@b{1}{2}of2\endcsname
  \endgroup
}
\SKV@def\SKV@ifstrnotequal#1#2{\SKV@ifstrequal{#1}{#2}\@secondoftwo\@firstoftwo}
\SKV@def\SKV@oifstrequal#1#2{%
  \@expandtwoargs\SKV@ifstrequal{\SKV@expox{#1}}{\SKV@expox{#2}}}
\SKV@def\SKV@xifstrequal#1#2{\@expandtwoargs\SKV@ifstrequal{#1}{#2}}
\SKV@def\SKV@ifempty#1{\@nameuse{SKV@\ifcat$\detokenize{#1}$1\else2\fi of2}}
\SKV@def\SKV@ifnotempty#1{\@nameuse{SKV@\SKV@ifempty{#1}{2}{1}of2}}
\SKV@def\SKV@oifempty#1{\SKV@expnext\SKV@ifempty{#1}}
\SKV@def\SKV@xifempty#1{\SKV@expargs{0}\SKV@ifempty{#1}\@nil}
\SKV@def*\SKV@remparser{\SKV@testopt\SKV@remp@rser{,}}
\SKV@def\SKV@remp@rser[#1]#2{%
  \begingroup
  \ifx#2\@empty\else
    \edef#2{#1\SKV@expox{#2}}%
    \def\SKV@tempa#1##1\@nil{%
      \gdef#2{##1}\futurelet\@temptoks\SKV@t@mp##1\@nil
    }%
    \def\SKV@t@mp##1\@nil{%
      \ifx\@temptoks\@sptoken
        \SKV@expnext\SKV@trailead{#2}#2%
        \expandafter\SKV@tempa\expandafter#1#2\@nil
      \else
        \if#1\@temptoks\expandafter\SKV@tempa#2\@nil\fi
      \fi
    }%
    \expandafter\SKV@tempa#2\@nil
  \fi
  \endgroup
}
\SKV@pdef*\SKV@appto{\SKV@savstate\SKV@testoptb\SKV@@appto}
\SKV@def\SKV@@appto#1#2{%
  \ifSKV@st
    \let\@unexp@expox\SKV@expox
  \else
    \let\@unexp@expox\unexpanded
  \fi
  \SKV@ap@to{#1}{#2}%
  \SKV@resstate
}
\SKV@def*\SKV@ap@to#1#2{%
  \ifSKV@pl
    \ifSKV@ask
      \let\SKV@n@xt\SKV@csxdef
    \else
      \let\SKV@n@xt\SKV@csedef
    \fi
    \SKV@ifcsundef{#1}{%
      \SKV@n@xt{#1}{\@unexp@expox{#2}}%
    }{%
      \SKV@n@xt{#1}{\SKV@expcsox{#1}\@unexp@expox{#2}}%
    }%
  \else
    \ifSKV@ask
      \let\SKV@n@xt\xdef
    \else
      \let\SKV@n@xt\edef
    \fi
    \SKV@ifundef{#1}{%
      \SKV@n@xt#1{\@unexp@expox{#2}}%
    }{%
      \SKV@n@xt#1{\SKV@expox{#1}\@unexp@expox{#2}}%
    }%
  \fi
}
\SKV@pdef*\SKV@prepto{\SKV@savstate\SKV@testoptb\SKV@@prepto}
\SKV@def\SKV@@prepto#1#2{%
  \ifSKV@st
    \let\@unexp@expox\SKV@expox
  \else
    \let\@unexp@expox\unexpanded
  \fi
  \SKV@pr@pto{#1}{#2}%
  \SKV@resstate
}
\SKV@def*\SKV@pr@pto#1#2{%
  \ifSKV@pl
    \ifSKV@ask
      \let\SKV@n@xt\SKV@csxdef
    \else
      \let\SKV@n@xt\SKV@csedef
    \fi
    \SKV@ifcsundef{#1}{%
      \SKV@n@xt{#1}{\@unexp@expox{#2}}%
    }{%
      \SKV@n@xt{#1}{\@unexp@expox{#2}\SKV@expcsox{#1}}%
    }%
  \else
    \ifSKV@ask
      \let\SKV@n@xt\xdef
    \else
      \let\SKV@n@xt\edef
    \fi
    \SKV@ifundef{#1}{%
      \SKV@n@xt#1{\@unexp@expox{#2}}%
    }{%
      \SKV@n@xt#1{\@unexp@expox{#2}\SKV@expox{#1}}%
    }%
  \fi
}
\SKV@pdef\apptomac#1#2{%
  \SKV@ifundef{#1}{\edef#1{\unexpanded{#2}}}%
  {\edef#1{\SKV@expox{#1}\unexpanded{#2}}}%
}
\SKV@pdef*\gapptomac{\global\apptomac}
\SKV@pdef*\csapptomac{\SKV@aftercs\apptomac}
\SKV@pdef*\csgapptomac{\global\csapptomac}
\SKV@pdef\preptomac#1#2{%
  \SKV@ifundef{#1}{\edef#1{\unexpanded{#2}}}%
  {\edef#1{\unexpanded{#2}\SKV@expox{#1}}}%
}
\SKV@pdef*\gpreptomac{\global\preptomac}
\SKV@pdef*\cspreptomac{\SKV@aftercs\preptomac}
\SKV@pdef*\csgpreptomac{\global\cspreptomac}
\SKV@pdef*\SKV@addtolist{\SKV@savstate\SKV@testoptf\SKV@@addtolist}
\SKV@def*\SKV@@addtolist[#1]{%
  \def\parser{#1}%
  \ifSKV@pl
    \def\SKV@n@xt##1{\SKV@aftercs\SKV@addt@list{##1}}%
    \ifSKV@ask
       \let\glob@l@or@def\xdef
    \else
      \let\glob@l@or@def\edef
    \fi
  \else
    \let\SKV@n@xt\SKV@addt@list
    \ifSKV@ask
      \let\glob@l@or@def\xdef
    \else
      \let\glob@l@or@def\edef
    \fi
  \fi
  \SKV@resstate\SKV@n@xt
}
\SKV@def\SKV@addt@list#1#2{%
  \SKV@ifundef{#1}{%
    \glob@l@or@def#1{\SKV@expox{#2}}%
  }{%
    \glob@l@or@def#1{\SKV@expox{#1}\parser\SKV@expox{#2}}%
  }%
}
\SKV@pdef*\SKV@relax#1{\let#1\relax}
\SKV@pdef*\SKV@grelax{\global\SKV@relax}
\SKV@pdef*\SKV@csrelax{\SKV@aftercs\SKV@relax}
\SKV@pdef*\SKV@csgrelax{\global\SKV@csrelax}
\@ifpackageloaded{atveryend}{%
  \@ifpackagecurrent{atveryend}{2010/03/24}{}{%
    \SKV@err{Your loaded version of atveryend package is
      not current}\@ehc}}{\RequirePackage{atveryend}[2010/03/24]}
\SKV@pdef*\SKV@notprerr{%
  \SKV@err{You have issued a preamble command here}%
    {Move shown command to document preamble.}%
}
\SKV@pdef*\SKV@notenderr{%
  \SKV@err{You've called an \string\enddocument\space command\SKV@MB
    at the wrong place}{Move command to before \string\enddocument.}%
}
\SKV@pdef*\SKV@AtDocumentStart{\AtBeginDocument}
\SKV@pdef*\SKV@BeforeDocumentStart{\SKV@appto?\SKV@beforedocstart}
\def\SKV@beforedocstart{}
\SKV@prepto\document{%
  \endgroup
  \let\SKV@BeforeDocumentStart\@firstofone
  \SKV@beforedocstart
  \let\SKV@BeforeDocumentStart\SKV@notprerr
  \SKV@gundef\SKV@beforedocstart
  \begingroup
}
\SKV@pdef*\SKV@AfterDocumentStart{\SKV@appto?\SKV@afterdocstart}
\def\SKV@afterdocstart{}
\SKV@appto\document{%
  \let\SKV@AfterDocumentStart\@firstofone
  \SKV@afterdocstart
  \let\SKV@AfterDocumentStart\SKV@notprerr
  \SKV@gundef\SKV@afterdocstart\ignorespaces
}
\SKV@BeforeDocumentStart{\let\SKV@AtDocumentStart\@firstofone}
\SKV@pdef*\SKV@AtDocumentEnd{\AtEndDocument}
\SKV@pdef*\SKV@BeforeLastPage{\SKV@appto?\SKV@beforelastpage}
\def\SKV@beforelastpage{}
\SKV@AtDocumentEnd{%
  \let\SKV@bef@relastpage\AtVeryEnd@BeforeClearDocumentHook
  \def\AtVeryEnd@BeforeClearDocumentHook{%
    \let\SKV@BeforeLastPage\@firstofone
    \SKV@beforelastpage\SKV@bef@relastpage
    \let\SKV@BeforeLastPage\SKV@notenderr
    \SKV@Undef?{\SKV@beforelastpage\SKV@bef@relastpage}%
  }%
}
\SKV@pdef*\SKV@AfterLastPage{\SKV@appto?\SKV@afterlastpage}
\def\SKV@afterlastpage{}
\SKV@AtDocumentEnd{%
  \let\SKV@afterl@stpage\AtVeryEnd@AfterLastShipoutHook
  \def\AtVeryEnd@AfterLastShipoutHook{%
    \let\SKV@AfterLastPage\@firstofone
    \SKV@afterlastpage\SKV@afterl@stpage
    \let\SKV@AfterLastPage\SKV@notenderr
    \SKV@Undef?{\SKV@afterlastpage\SKV@afterl@stpage}%
  }%
}
\SKV@pdef*\SKV@AfterDocumentEnd{\SKV@appto?\SKV@afterenddoc}
\def\SKV@afterenddoc{}
\SKV@AtDocumentEnd{%
  \let\SKV@aft@renddoc\AtVeryEnd@AtVeryEndDocumentHook
  \def\AtVeryEnd@AtVeryEndDocumentHook{%
    \let\SKV@AfterDocumentEnd\@firstofone
    \SKV@afterenddoc\SKV@aft@renddoc
    \let\SKV@AfterDocumentEnd\SKV@notenderr
    \SKV@Undef?{\SKV@afterenddoc\SKV@aft@renddoc}%
  }%
}
\SKV@pdef\SKV@AtPackageEnd{\AtEndOfPackage}
\SKV@pdef*\SKV@BeforePackageEnd{%
  \SKV@prepto+{\@currname.\@currext-h@@k}%
}
\SKV@pdef*\SKV@AfterPackageEnd{%
  \SKV@appto+{\@currname.\@currext-skvh@@k}%
}
\let\SKV@AtClassEnd\SKV@AtPackageEnd
\let\SKV@BeforeClassEnd\SKV@BeforePackageEnd
\let\SKV@AfterClassEnd\SKV@AfterPackageEnd
\SKV@prepto\@popfilename{%
  \SKV@csuse{\@currname.\@currext-skvh@@k}%
  \SKV@csgundef{\@currname.\@currext-skvh@@k}%
}
\SKV@pdef\@afterpackageloaded#1{%
  \SKV@AtDocumentStart{%
    \SKV@ifcsdef{ver@#1.\@pkgextension}{}{%
      \SKV@warn{Package '#1' was never loaded}%
    }%
  }
  \SKV@ifcsdef{ver@#1.\@pkgextension}{%
    \let\SKV@n@xt\@firstofone
  }{%
    \def\SKV@n@xt{\SKV@appto+{#1.\@pkgextension-skvh@@k}}%
  }%
  \SKV@n@xt
}
\let\SKV@steno\z@
\SKV@pdef*\SKV@for{\SKV@savstate\SKV@testoptd\SKV@@for}
\SKV@pdef*\SKV@@for[#1]{%
  \let\SKV@steno\@ne
  \ifSKV@st
    \def\SKV@n@xt{\SKV@for@b[#1]}%
  \else
    \def\SKV@n@xt{\SKV@CommandGenParser{#1}\SKV@for@a}%
  \fi
  \SKV@n@xt
}
\SKV@pdef*\SKV@CommandGenParser#1{%
  \def\parser{#1}%
  \protected\long\def\SKV@for@a##1##2##3{%
    \SKV@ifblank{##1}\SKV@fornoop\SKV@forloop
    ##2{##3}##1#1\@nil
  }%
  \long\def\SKV@forloop##1##2##3#1##4\@nil{%
    \edef##1{\unexpanded{##3}}%
    \SKV@ifstrequal{##3}{\listbreak}{%
      \SKV@keylistrema##4\@nil#1%
    }{%
      \SKV@ifblank{##4}{%
        ##2\relax
        \ifnum\SKV@steno=\@ne\expandafter\SKV@resstate\fi
        \let\SKV@steno\z@
      }{%
        ##2\relax\SKV@forloop##1{##2}##4\@nil
      }%
    }%
  }%
  \long\def\SKV@fornoop##1\@nil{}%
}
\SKV@pdef*\SKV@for@b{\SKV@testopt\SKV@@for@b{,}}
\SKV@def\SKV@@for@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@ifblank{#3}{%
      \SKV@vbsmsg{warn}%
        {Empty function for '\string\SKV@tfor@a'\on@line}%
    }{%
      \SKV@tforloop#1\@nil\@nil&#2{#3}%
    }%
  }%
}
\SKV@def\SKV@tforloop#1#2&#3#4{%
  \long\def#3{#1}%
  \SKV@ifstrequal{#1}{\listbreak}{%
    \let\SKV@n@xt\SKV@tforrema
  }{%
    \SKV@ifstrequal{#1}{\@nil}{%
      \let\SKV@n@xt\SKV@tfornoop
    }{%
      #4\relax\let\SKV@n@xt\SKV@tforloop
    }%
  }%
  \SKV@n@xt#2&#3{#4}%
}
\SKV@def\SKV@tfornoop#1&#2#3{}
\SKV@pdef*\SKV@tforrema#1\@nil\@nil&#2#3{%
  \long\edef\SKV@remainder{\unexpanded{#1}}%
}
\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
    \expandafter\gapptomac\expandafter\SKV@preamblecmds
      \expandafter{\expandafter\SKV@do@a\SKV@resvd}%
  }%
}
\SKV@AfterDocumentStart{%
  \gdef\SKV@do@a#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
}
\SKV@pdef*\SKV@onlypackage{%
  \SKV@xifempty{\@currname\@currext}{%
    \SKV@err{Not in package environment}%
    {The command at top level of this message\SKV@MB
      is available only in package environment.}%
  }{}%
}
\SKV@def*\SKV@CommandKeyParser#1{%
  \long\def\SKV@define@keylist##1{%
    \SKV@undeflt{g}{\skif,\skifx,\skifcase,\skor,\skelse,\skfi}%
    \ifswitchon{SKV@st}{%
      \long\edef\@keylist{\SKV@expox{##1}}%
    }{%
      \long\def\@keylist{##1}%
    }%
    \SKV@resstate
    \SKV@expnext\SKV@checksanitizec\@keylist\SKV@tempa
    \expandafter\SKV@readkeylist\SKV@tempa#1\@nil
  }%
  \long\def\SKV@readkeylist##1#1##2\@nil{%
    \SKV@ifblank{##1}{}%
    {%
      \SKV@ifstrequal{##1}{\listbreak}{%
        \SKV@keylistrema##2\@nil#1%
      }{%
        \SKV@define@multkeys##1\@nil
        \SKV@ifblank{##2}\relax{\SKV@readkeylist##2\@nil}%
      }%
    }%
  }%
}
\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
  \SKV@expargs{3}{\XKV@checkchoice[\val\nr]}{{#1}{#2}}{{#3}{#4}}\@nil
}
\SKV@pdef*\SKV@inputerr#1#2{%
  \SKV@err{Erroneous value '#1' for key '#2'}{%
    Please use the correct value for key '#2'.}%
}
\SKV@def*\SKV@despacelist{\SKV@savstate\SKV@testoptd\SKV@despac@list}
\SKV@def*\SKV@despac@list[#1]#2{%
  \begingroup
  \let\SKV@resa\@empty
  \ifSKV@st
    \def\SKV@dsl{\SKV@for*[#1]#2}%
  \else
    \def\SKV@dsl{\SKV@for[#1]{#2}}%
  \fi
  \SKV@dsl\SKV@dsl{%
    \SKV@despace\SKV@dsl
    \SKV@appto*\SKV@resa{\expandafter#1\SKV@dsl}%
  }%
  \ifx\SKV@resa\@empty\else\SKV@remparser[#1]\SKV@resa\fi
  \ifSKV@st\global\let#2\SKV@resa\fi
  \endgroup
  \SKV@resstate
}
\SKV@def*\SKV@tdespacelt#1{%
  \SKV@tfor{#1}\SKV@dsl{\expandafter\SKV@despace\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@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@ifdef#1{%
    \SKV@err{Command '\string#1' already defined}%
    {I can't let '\string#1' to '\string#2'.}%
  }{%
    \SKV@ifdef#2{\let#1#2}{%
      \SKV@err{Command '\string#2' undefined}%
        {I can't let '\string#1' to '\string#2'.}%
    }%
  }%
}
\AtEndOfPackage{\SKV@providedef*\NewLet{\SKV@newlet}}
\SKV@pdef*\SKV@cslet{\SKV@savstate\SKV@t@stopta\SKV@@cslet}
\SKV@def*\SKV@@cslet#1#2{%
  \ifSKV@st
    \def\SKV@n@xt{\SKV@aftercs\let{#1}#2}%
  \else
    \def\SKV@n@xt{%
      \SKV@ifdef{#2}{%
        \SKV@aftercs\let{#1}#2%
      }{%
        \SKV@err{Command '\string#2' undefined}%
          {You may use the starred version of \string\SKV@cslet.}%
      }%
    }%
  \fi
  \SKV@resstate\SKV@n@xt
}
\SKV@pdef*\SKV@letcs{\SKV@savstate\SKV@t@stopta\SKV@@letcs}
\SKV@def*\SKV@@letcs#1#2{%
  \ifSKV@st
    \def\SKV@n@xt{%
      \begingroup\expandafter\endgroup
      \expandafter\let\expandafter#1\csname#2\endcsname
    }%
  \else
    \def\SKV@n@xt{%
      \SKV@ifcsdef{#2}{%
        \expandafter\let\expandafter#1\csname#2\endcsname
      }{%
        \SKV@err{Command '\@backslashchar#2' undefined}%
          {You may use the starred version of \string\SKV@letcs.}%
      }%
    }%
  \fi
  \SKV@resstate\SKV@n@xt
}
\SKV@pdef*\SKV@csletcs{\SKV@savstate\SKV@t@stopta\SKV@@csletcs}
\SKV@def*\SKV@@csletcs#1#2{%
  \ifSKV@st
    \def\SKV@n@xt{%
      \begingroup\expandafter\endgroup
      \expandafter\let\csname#1\SKV@aftercs\endcsname{#2}%
    }%
  \else
    \def\SKV@n@xt{%
      \SKV@ifcsdef{#2}{%
        \SKV@aftercs\let{#1\SKV@aftercs}{#2}%
      }{%
        \SKV@err{Command '\@backslashchar#2' undefined}%
          {You may use the starred version of \string\SKV@csletcs.}%
      }%
    }%
  \fi
  \SKV@resstate\SKV@n@xt
}
\SKV@pdef*\SKV@numdef{\SKV@savstate\SKV@testoptc\SKV@@numdef}
\SKV@pdef*\SKV@@numdef{%
  \ifSKV@pl
    \def\SKV@n@xt##1{\SKV@aftercs\SKV@numd@f{##1}}%
    \ifSKV@ask
       \let\glob@lrel@x\global
    \else
      \let\glob@lrel@x\relax
    \fi
  \else
    \let\SKV@n@xt\SKV@numd@f
    \ifSKV@ask
      \let\glob@lrel@x\global
    \else
      \let\glob@lrel@x\relax
    \fi
  \fi
  \SKV@resstate\SKV@n@xt
}
\SKV@pdef*\SKV@numd@f#1#2{%
  \SKV@ensurescape@notempty{#1}{#2}%
  \SKV@ifundef{#1}{%
    \newcount#1\glob@lrel@x#1=\numexpr#2\relax
  }{%
    \glob@lrel@x#1=\numexpr#2\relax
  }%
}
\SKV@pdef*\SKV@dimdef{\SKV@savstate\SKV@testoptc\SKV@@dimdef}
\SKV@pdef*\SKV@@dimdef{%
  \ifSKV@pl
    \def\SKV@n@xt##1{\SKV@aftercs\SKV@dimd@f{##1}}%
    \ifSKV@ask
       \let\glob@lrel@x\global
    \else
      \let\glob@lrel@x\relax
    \fi
  \else
    \let\SKV@n@xt\SKV@dimd@f
    \ifSKV@ask
      \let\glob@lrel@x\global
    \else
      \let\glob@lrel@x\relax
    \fi
  \fi
  \SKV@resstate\SKV@n@xt
}
\SKV@pdef*\SKV@dimd@f#1#2{%
  \SKV@ensurescape@notempty{#1}{#2}%
  \SKV@ifundef{#1}{%
    \newdimen#1\glob@lrel@x#1=\dimexpr#2\relax
  }{%
    \glob@lrel@x#1=\dimexpr#2\relax
  }%
}
\SKV@def*\SKV@ensurescape@notempty#1#2{%
  \SKV@ensurescape{#1}%
  \SKV@ifempty{#2}{\SKV@err{Argument '\string#1' is empty}\@ehc}{}%
}
\SKV@def*\SKV@keylistparser@err{%
  \SKV@err{Key list parser '\SKV@keyparser' not allowed}%
    {Use semicolon (preferable) or colon as parser.}%
}
\define@boolkey+[KV]{skeyval}[SKV@]{xchoicelist}[true]{}{%
  \SKV@inputerr{#1}{xchoicelist}%
}
\define@cmdkey[KV]{skeyval}[SKV@]{genparser}[,]{%
  \@onelevel@sanitize\SKV@genparser
  \SKV@despace\SKV@genparser
  \SKV@expargs{0}\SKV@CommandGenParser\SKV@genparser\@nil
}
\define@cmdkey[KV]{skeyval}[SKV@]{keyparser}[;]{%
  \@onelevel@sanitize\SKV@keyparser
  \SKV@xifblank\SKV@keyparser\SKV@keylistparser@err\relax
  \SKV@despace\SKV@keyparser
  \begingroup
  \SKV@detokdespace{,}\SKV@tempa
  \SKV@ifx\SKV@keyparser\SKV@tempa
    {\aftergroup\SKV@keylistparser@err}{}%
  \endgroup
  \SKV@expargs{0}\SKV@CommandKeyParser\SKV@keyparser\@nil
}
\SKV@def*\SKV@keyprefix@err{%
  \SKV@err{Key prefix '\SKV@keyprefix' is not allowed}%
    {Use another prefix name instead of '\SKV@keyprefix'.}%
}
\define@cmdkey[KV]{skeyval}[SKV@]{keyprefix}[KV]{%
  \SKV@xifblank\SKV@keyprefix\SKV@keyprefix@err\relax
  \SKV@despace\SKV@keyprefix
  \SKV@expargs{3}\XKV@checksanitizeb{{\SKV@rkpnames}}%
    \SKV@tempa\@nil
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@ifx\SKV@keyprefix\SKV@tempa\SKV@keyprefix@err\relax
  }%
}
\SKV@def*\SKV@keyfamily@err{%
  \SKV@err{Key family '\SKV@keyfamily' is not allowed}%
    {Use another family name instead of '\SKV@keyfamily'.}%
}
\define@cmdkey[KV]{skeyval}[SKV@]{keyfamily}[fam]{%
  \SKV@xifblank\SKV@keyfamily\SKV@keyfamily@err\relax
  \SKV@despace\SKV@keyfamily
  \SKV@expargs{3}\XKV@checksanitizeb{{\SKV@rfnames}}%
    \SKV@tempa\@nil
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@ifx\SKV@keyfamily\SKV@tempa\SKV@keyfamily@err\relax
  }%
}
\SKV@def*\SKV@macroprefix@err{%
  \SKV@err{Macro prefix '\SKV@macroprefix' is not allowed}%
    {Use another macro prefix name instead of '\SKV@macroprefix'.}%
}
\define@cmdkey[KV]{skeyval}[SKV@]{macroprefix}[mp@]{%
  \SKV@xifblank\SKV@macroprefix\SKV@macroprefix@err\relax
  \SKV@despace\SKV@macroprefix
  \SKV@expargs{3}\XKV@checksanitizeb{{\SKV@rmpnames}}%
    \SKV@tempa\@nil
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@ifx\SKV@macroprefix\SKV@tempa\SKV@macroprefix@err\relax
  }%
}
\SKV@BeforePackageEnd{\deftog{draft}\deftog{final}}
\define@boolkey+[KV]{skeyval}[SKV@]{draft}[true]{%
  \ifSKV@draft
    \setkeys[KV]{skeyval}{final=false}%
    \SKV@AtPackageEnd{\ifSKV@draft\togtrue{draft}\else
      \togfalse{draft}\fi}%
  \fi
}{%
  \SKV@inputerr{#1}{draft}%
}
\define@boolkey+[KV]{skeyval}[SKV@]{final}[true]{%
  \ifSKV@final
    \setkeys[KV]{skeyval}{draft=false}%
    \SKV@AtPackageEnd{\ifSKV@final\togtrue{final}\else
      \togfalse{final}\fi}%
  \fi
}{%
  \SKV@inputerr{#1}{final}%
}
\DeclareOptionX*{\SKV@warn{Unknown option '\CurrentOption' ignored}}
\ExecuteOptionsX[KV]<skeyval>{genparser,keyparser,keyprefix,
  keyfamily,macroprefix,final}
\ProcessOptionsX*[KV]<skeyval>\relax
\SKV@pdef*\skvoptions#1{\setkeys[KV]{skeyval}{#1}}
\SKV@pdef*\SKV@ifdraft{\@nameuse{@\ifSKV@draft first\else second\fi oftwo}}
\SKV@pdef*\SKV@iffinal{\@nameuse{@\ifSKV@final first\else second\fi oftwo}}
\SKV@pdef*\SKV@ifnotdraft{\SKV@ifdraft\@secondoftwo\@firstoftwo}
\SKV@pdef*\SKV@ifnotfinal{\SKV@iffinal\@secondoftwo\@firstoftwo}
\def\SKV@useinfo#1{Not using '\@backslashchar#1' of 'skyeval' package}
\AtBeginDocument{%
  \SKV@ifundef\ifdraft
    {\SKV@pdef*\ifdraft{\SKV@ifdraft}}%
    {\SKV@vbsmsg{info}{\SKV@useinfo{ifdraft}}}%
}
\SKV@ifundef\ifnotdraft
  {\SKV@pdef*\ifnotdraft{\SKV@ifnotdraft}}%
  {\SKV@vbsmsg{info}{\SKV@useinfo{ifnotdraft}}}
\SKV@ifundef\iffinal
  {\SKV@pdef*\iffinal{\SKV@iffinal}}%
  {\SKV@vbsmsg{info}{\SKV@useinfo{iffinal}}}
\SKV@ifundef\ifnotfinal
  {\SKV@pdef*\ifnotfinal{\SKV@ifnotfinal}}%
  {\SKV@vbsmsg{info}{\SKV@useinfo{ifnotfinal}}}
\SKV@def\SKV@star@or@long#1{%
  \SKV@ifstar
    {\let\l@ngrel@x\relax\def\@star@or@none{*}#1}%
    {\let\l@ngrel@x\long\def\@star@or@none{}#1}%
}
\SKV@pdef\requirecmd{\SKV@star@or@long\SKV@require@cmd}
\SKV@def\SKV@require@cmd#1{%
  \SKV@ensurescape{#1}%
  \SKV@ifdefined{#1}%
    {\CheckCommand\@star@or@none}{\newcommand\@star@or@none}{#1}%
}
\def\@check@eq#1#2{%
  \SKV@ifx{#1}{#2}{}{%
    \SKV@vbsmsg{warn}{%
      Previous definition of '\string#1'\SKV@MB
      doesn't match your new definition.\SKV@MB
      * I haven't redefined '\string#1' *}%
  }%
}
\SKV@pdef*\newswitch#1#2{%
  \SKV@ensurenoscape{#1}%
  \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}%
        }%
      }%
    }%
  }%
  \expandafter\SKV@ifdefinable\csname if#1\endcsname{%
    \csname newif\expandafter\endcsname\csname if#1\endcsname
    \csname #1\SKV@resvd\endcsname
  }%
}
\SKV@newlet\NewSwitches\NewIfs
\SKV@def*\setswitch#1#2{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsundef{if#1}{%
    \SKV@noswerr{#1}%
  }{%
    \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}%
          }%
        }%
      }%
    }%
    \csname#1\SKV@resvd\endcsname
  }%
}
\SKV@def*\switchon#1{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsundef{if#1}{\SKV@noswerr{#1}}{\@nameuse{#1true}}%
}
\SKV@newlet\switchtrue\switchon
\SKV@def*\switchoff#1{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsundef{if#1}{\SKV@noswerr{#1}}{\@nameuse{#1false}}%
}
\SKV@newlet\switchfalse\switchoff
\SKV@def*\ifswitchon#1{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsundef{if#1}{\SKV@noswerr{#1}\@gobbletwo}%
    {\@nameuse{@\@nameuse{if#1}first\else second\fi oftwo}}%
}
\SKV@newlet\ifswitchtrue\ifswitchon
\SKV@def*\ifswitchoff#1{%
  \SKV@ensurenoscape{#1}%
  \SKV@ifcsundef{if#1}{\SKV@noswerr{#1}\@gobbletwo}%
    {\@nameuse{@\@nameuse{if#1}second\else first\fi oftwo}}%
}
\SKV@newlet\ifswitchfalse\ifswitchoff
\SKV@pdef*\SKV@noswerr#1{%
  \SKV@err{Switch '\string#1' is undefined}%
  {You need to first define the switch '\string#1'.}%
}
\SKV@def*\SKV@swvalerr#1#2{%
  \SKV@err{Invalid switch value '#2' for switch '\string#1'}%
    {Valid switch values are 'true', 'on', 'false', and 'off'.}%
}
\SKV@pdef*\SKV@undeftog@err#1{%
  \SKV@err{Toggle '#1' undefined}%
    {You need to first define '#1' before use.}%
}
\SKV@pdef*\deftog#1{%
  \SKV@ifcsundef{SKV@toggle@#1}{}{%
    \SKV@vbsmsg{warn}{Toggle '#1' redefined\on@line}%
  }%
  \SKV@aftercs\let{SKV@toggle@#1}\@secondoftwo
}
\SKV@pdef*\newtog#1{%
  \SKV@ifcsdef{SKV@toggle@#1}{%
    \SKV@err{Toggle '#1' already defined}%
      {Please provide a new toggle or redefine '#1'.}%
  }{\SKV@aftercs\let{SKV@toggle@#1}\@secondoftwo}%
}
\SKV@pdef*\providetog#1{%
  \SKV@ifcsdef{SKV@toggle@#1}{%
    \SKV@vbsmsg{info}%
      {Toggle '#1' already defined.\SKV@MB Not redefined\on@line}%
  }{\SKV@aftercs\let{SKV@toggle@#1}\@secondoftwo}%
}
\SKV@pdef*\requiretog#1{\SKV@aftercs\requirecmd{SKV@toggle@#1}[2]{##2}}
\SKV@def*\settog#1#2{%
  \SKV@ifcsdef{SKV@toggle@#1}{%
    \SKV@ifcsdef{SKV@t@ggle#2}{%
      \SKV@aftercs\let{SKV@toggle@#1\expandafter}%
        \csname SKV@t@ggle#2\endcsname
    }{%
      \SKV@err{Inadmissible value '#2' for toggle '#1'}%
        {Valid values for toggles are 'true' and 'false'.}%
    }%
  }{\SKV@undeftog@err{#1}}%
}
\SKV@def*\togtrue#1{%
  \SKV@ifcsdef{SKV@toggle@#1}{%
    \expandafter\let\csname SKV@toggle@#1\endcsname\SKV@t@ggletrue
  }{\SKV@undeftog@err{#1}}%
}
\SKV@def*\togfalse#1{%
  \SKV@ifcsdef{SKV@toggle@#1}{%
    \expandafter\let\csname SKV@toggle@#1\endcsname\SKV@t@gglefalse
  }{%
    \SKV@undeftog@err{#1}%
  }%
}
\SKV@newlet\SKV@t@ggletrue\@firstoftwo
\SKV@newlet\SKV@t@gglefalse\@secondoftwo
\SKV@def*\iftog#1{%
  \SKV@ifcsdef{SKV@toggle@#1}{\@nameuse{SKV@toggle@#1}}%
    {\SKV@undeftog@err{#1}}%
}
\SKV@def*\ifnottog#1{%
  \SKV@ifcsdef{SKV@toggle@#1}{%
    \@nameuse{SKV@toggle@#1}\@secondoftwo\@firstoftwo}%
      {\SKV@undeftog@err{#1}\@gobbletwo}%
}
\deftog{pdf}
\SKV@ifundef\pdfoutput{}{%
  \ifnum\pdfoutput<\@ne
    \SKV@pdef*\SKV@ifpdf{\@secondoftwo}%
  \else
    \togtrue{pdf}%
    \SKV@pdef*\SKV@ifpdf{\@firstoftwo}%
  \fi
  \SKV@pdef*\SKV@ifnotpdf{\SKV@ifpdf\@secondoftwo\@firstoftwo}%
}
\SKV@ifundef\ifnotpdf
  {\let\ifnotpdf\SKV@ifnotpdf}%
  {\SKV@vbsmsg{info}{\SKV@useinfo{ifnotpdf}}}
\SKV@AtDocumentStart{%
  \SKV@ifundef\ifpdf
    {\SKV@pdef*\ifpdf{\SKV@ifpdf}}%
    {\SKV@vbsmsg{info}{\SKV@useinfo{ifpdf}}}%
}
\SKV@pdef*\SKV@definedkey@err#1{%
  \SKV@ifcsundef{\XKV@header#1}{}{%
    \SKV@err{Key '#1' already defined in family '\XKV@tfam'\SKV@MB
      with prefix '\SKV@pref'}{Use another key name instead of '#1'.}%
  }%
}
\SKV@pdef*\define@menukey{\define@choicekey}
\SKV@pdef*\define@togkey{\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}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
    \SKV@csundef{SKV@toggle@#1\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \ifXKV@pl
    \def\SKV@n@xt{\SKV@aftercs\SKV@d@f@ne@togkey}%
  \else
    \def\SKV@n@xt{\SKV@aftercs\SKV@d@fine@togkey}%
  \fi
  \begingroup
  \edef\SKV@tempa{\endgroup
    {\XKV@header\SKV@resa}{\SKV@resa}{#1\SKV@resa}{#3}}%
  \aftergroup\SKV@n@xt\SKV@tempa
}
\SKV@def*\SKV@d@fine@togkey#1#2#3#4#5{%
  \SKV@d@f@ne@t@gkey#1{#2}{#3}{#4}{{\settog{#3}{\XKV@resa}#5}}%
}
\SKV@def*\SKV@d@f@ne@togkey#1#2#3#4#5#6{%
  \SKV@d@f@ne@t@gkey#1{#2}{#3}{#4}%
    {{\settog{#3}{\XKV@resa}#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
  \ifXKV@pl
    \def#1##1{\XKV@pltrue\XKV@sttrue
      \XKV@checkchoice[\XKV@resa]{##1}{true,false}#5%
    }%
  \else
    \def#1##1{\XKV@plfalse\XKV@sttrue
      \XKV@checkchoice[\XKV@resa]{##1}{true,false}#5%
    }%
  \fi
}
\SKV@pdef*\define@togkeys{\XKV@plfalse\XKV@testoptd\SKV@define@togkeys{}}
\SKV@def*\SKV@define@togkeys#1#2[#3]{%
  \SKV@despacelist{#2}%
  \SKV@for*[,]\SKV@resa\SKV@tempa{%
    \SKV@expargs{3}%
      \SKV@d@fine@togkeys{{\SKV@tempa}}{{#1}{#3}}\@nil
  }%
}
\SKV@def*\SKV@d@fine@togkeys#1#2#3{%
  \SKV@findkeypointers{#1}%
  \SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
    \SKV@vbsmsg{warn}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
    \SKV@csundef{SKV@toggle@#2\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \edef\SKV@tempa{%
    \noexpand\SKV@d@f@ne@t@gkey\@nameuse{\XKV@header\SKV@resa}%
      {\SKV@resa}{#2\SKV@resa}{#3}%
      {{\noexpand\settog{#2\SKV@resa}{\noexpand\XKV@resa}}}%
  }%
  \SKV@tempa
}
\SKV@pdef*\newordkey{\XKV@testoptb\SKV@newordkey}
\SKV@def*\SKV@newordkey#1{%
  \SKV@findkeypointers{#1}%
  \SKV@expnext\SKV@definedkey@err\SKV@resa
  \begingroup
  \edef\SKV@tempa{\endgroup
    \SKV@ifbrack{\noexpand\XKV@d@fine@key{\SKV@resa}}%
      {\noexpand\SKV@d@fine@key{\SKV@resa}}%
  }%
  \SKV@tempa
}
\SKV@pdef*\newcmdkey{\XKV@testoptd\SKV@newcmdkey{cmd}}
\SKV@def*\SKV@newcmdkey#1#2[#3]#4{%
  \SKV@findkeypointers{#2}%
  \SKV@expnext\SKV@definedkey@err\SKV@resa
  \ifXKV@st
    \SKV@afterfi
    \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}}%
  \expandafter\expandafter\expandafter\endgroup
    \expandafter\SKV@tempa\expandafter{\SKV@tempb}%
}
\SKV@pdef*\newcmdkeys{\XKV@testoptd\SKV@newcmdkeys{cmd}}
\SKV@def*\SKV@newcmdkeys#1#2[#3]{%
  \SKV@despacelist{#2}%
  \SKV@for*[,]\SKV@resa\SKV@tempa{%
    \edef\SKV@tempa{\noexpand\SKV@newcmdkey{#1}{\SKV@tempa}}%
    \SKV@tempa[#3]{}%
  }%
}
\SKV@pdef*\newchoicekey{\XKV@testopta{\XKV@testoptb\SKV@newchoicekey}}
\SKV@def*\SKV@newchoicekey#1{%
  \SKV@findkeypointers{#1}%
  \SKV@expnext\SKV@definedkey@err\SKV@resa
  \begingroup
  \edef\SKV@tempa##1{\endgroup\SKV@testopt{##1{\SKV@resa}}{}}%
  \SKV@tempa\XKV@d@fine@choicekey
}
\let\newmenukey\newchoicekey
\SKV@pdef*\newboolkey{\XKV@t@stopta{\XKV@testoptd\SKV@newboolkey{}}}
\SKV@def*\SKV@newboolkey#1#2[#3]{%
  \SKV@findkeypointers{#2}%
  \SKV@expnext\SKV@definedkey@err\SKV@resa
  \ifXKV@pl
    \def\SKV@n@xt{\SKV@aftercs\XKV@d@f@ne@boolkey}%
  \else
    \def\SKV@n@xt{\SKV@aftercs\XKV@d@fine@boolkey}%
  \fi
  \edef\SKV@tempa{{\XKV@header\SKV@resa}{\SKV@resa}{#1\SKV@resa}{#3}}%
  \expandafter\SKV@n@xt\SKV@tempa
}
\SKV@pdef*\newboolkeys{\XKV@plfalse\XKV@testoptd\SKV@newboolkeys{}}
\SKV@def*\SKV@newboolkeys#1#2[#3]{%
  \SKV@despacelist{#2}%
  \SKV@for*[,]\SKV@resa\SKV@tempa{%
    \SKV@definedkey@err\SKV@tempa
    \SKV@expargs{3}%
      \XKV@d@fine@boolkeys{{\SKV@tempa}}{{#1}{#3}}\@nil
  }%
}
\SKV@pdef*\newtogkey{\XKV@t@stopta{\XKV@testoptd\SKV@newtogkey{}}}
\SKV@def*\SKV@newtogkey#1#2[#3]{%
  \SKV@findkeypointers{#2}%
  \SKV@expnext\SKV@definedkey@err\SKV@resa
  \ifXKV@pl
    \def\SKV@n@xt{\SKV@aftercs\SKV@d@f@ne@togkey}%
  \else
    \def\SKV@n@xt{\SKV@aftercs\SKV@d@fine@togkey}%
  \fi
  \begingroup
  \edef\SKV@tempa{\endgroup
    {\XKV@header\SKV@resa}{\SKV@resa}{#1\SKV@resa}{#3}}%
  \aftergroup\SKV@n@xt\SKV@tempa
}
\SKV@pdef*\newtogkeys{\XKV@plfalse\XKV@testoptd\SKV@newtogkeys{}}
\SKV@def*\SKV@newtogkeys#1#2[#3]{%
  \SKV@despacelist{#2}%
  \SKV@for*[,]\SKV@resa\SKV@tempa{%
    \SKV@definedkey@err\SKV@tempa
    \SKV@expargs{3}\SKV@d@fine@togkeys{{\SKV@tempa}}{{#1}{#3}}\@nil
  }%
}
\SKV@pdef*\define@biboolkeys{\SKV@compopta\define@boolkey\SKV@biboolkeys}
\SKV@pdef*\newbiboolkeys{\SKV@compopta\newboolkey\SKV@biboolkeys}
\SKV@pdef*\define@uniboolkeys{\SKV@compopta\define@boolkey\SKV@uniboolkeys}
\SKV@pdef*\newuniboolkeys{\SKV@compopta\newboolkey\SKV@uniboolkeys}
\SKV@pdef*\define@biuniboolkeys{%
  \SKV@savstate
  \SKV@t@stoptb{\SKV@compopta\define@boolkey\SKV@biuniboolkeys}%
}
\SKV@pdef*\newbiuniboolkeys{%
  \SKV@savstate
  \SKV@t@stoptb{\SKV@compopta\newboolkey\SKV@biuniboolkeys}%
}
\SKV@pdef*\define@bitogkeys{\SKV@compopta\define@togkey\SKV@bitogkeys}
\SKV@pdef*\newbitogkeys{\SKV@compopta\newtogkey\SKV@bitogkeys}
\SKV@pdef*\define@unitogkeys{\SKV@compopta\define@togkey\SKV@unitogkeys}
\SKV@pdef*\newunitogkeys{\SKV@compopta\newtogkey\SKV@unitogkeys}
\SKV@pdef*\define@biunitogkeys{%
  \SKV@savstate
  \SKV@t@stoptb{\SKV@compopta\define@togkey\SKV@biunitogkeys}%
}
\SKV@pdef*\newbiunitogkeys{%
  \SKV@savstate
  \SKV@t@stoptb{\SKV@compopta\newtogkey\SKV@biunitogkeys}%
}
\SKV@def*\SKV@compopta#1#2{%
  \let\SKV@c@mpkey#1\let\SKV@co@pkey#2%
  \SKV@testopt{\SKV@compoptb}{KV}%
}
\SKV@def*\SKV@compoptb[#1]#2{\SKV@testopt{\SKV@compoptc[#1]{#2}}{mp@}}
\SKV@def*\SKV@compoptc[#1]#2[#3]#4{%
  \SKV@testopt{\SKV@co@pkey[#1]{#2}[#3]{#4}}{true}}
\SKV@def*\SKV@biboolkeys[#1]#2[#3]#4[#5]#6#7#8{%
  \@namedef{#1@#2@#4@func}{%
    #7\relax
    \ifswitchon{#3#4}{\switchoff{#3#6}}{\switchon{#3#6}#8\relax}%
  }%
  \@namedef{#1@#2@#6@func}{%
    #8\relax
    \ifswitchon{#3#6}{\switchoff{#3#4}}{\switchon{#3#4}#7\relax}%
  }%
  \SKV@compk@y{#1}{#2}{#3}{#4}{#5}{#6}%
}
\SKV@def*\SKV@uniboolkeys[#1]#2[#3]#4[#5]#6#7#8{%
  \@namedef{#1@#2@#4@func}{%
    #7\relax
    \ifswitchon{#3#4}{\switchon{#3#6}#8\relax}{\switchoff{#3#6}}%
  }%
  \@namedef{#1@#2@#6@func}{%
    #8\relax
    \ifswitchon{#3#6}{\switchon{#3#4}#7\relax}{\switchoff{#3#4}}%
  }%
  \SKV@compk@y{#1}{#2}{#3}{#4}{#5}{#6}%
}
\SKV@def*\SKV@biuniboolkeys[#1]#2[#3]#4[#5]#6#7#8{%
  \SKV@aftercs\def{#1@#2@#6@func}{#8\relax}%
  \ifswitchon{SKV@st}{%
    \ifswitchon{SKV@pl}{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax\ifswitchon{#3#4}{}{\switchoff{#3#6}}%
      }%
    }{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax
        \ifswitchon{#3#4}{}{\switchon{#3#6}\@nameuse{#1@#2@#6@func}}%
      }%
    }%
  }{%
    \ifswitchon{SKV@pl}{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax\ifswitchon{#3#4}{\switchoff{#3#6}}{}%
      }%
    }{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax
        \ifswitchon{#3#4}{\switchon{#3#6}\@nameuse{#1@#2@#6@func}}{}%
      }%
    }%
  }%
  \SKV@resstate
  \SKV@compk@y{#1}{#2}{#3}{#4}{#5}{#6}%
}
\SKV@def*\SKV@bitogkeys[#1]#2[#3]#4[#5]#6#7#8{%
  \@namedef{#1@#2@#4@func}{%
    #7\relax
    \iftog{#3#4}{\togfalse{#3#6}}{\togtrue{#3#6}#8\relax}%
  }%
  \@namedef{#1@#2@#6@func}{%
    #8\relax
    \iftog{#3#6}{\togfalse{#3#4}}{\togtrue{#3#4}#7\relax}%
  }%
  \SKV@compk@y{#1}{#2}{#3}{#4}{#5}{#6}%
}
\SKV@def*\SKV@unitogkeys[#1]#2[#3]#4[#5]#6#7#8{%
  \@namedef{#1@#2@#4@func}{%
    #7\relax
    \iftog{#3#4}{\togtrue{#3#6}#8\relax}{\togfalse{#3#6}}%
  }%
  \@namedef{#1@#2@#6@func}{%
    #8\relax
    \iftog{#3#6}{\togtrue{#3#4}#7\relax}{\togfalse{#3#4}}%
  }%
  \SKV@compk@y{#1}{#2}{#3}{#4}{#5}{#6}%
}
\SKV@def*\SKV@biunitogkeys[#1]#2[#3]#4[#5]#6#7#8{%
  \@namedef{#1@#2@#6@func}{#8}%
  \ifswitchon{SKV@st}{%
    \ifswitchon{SKV@pl}{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax\ifnottog{#3#4}{\togfalse{#3#6}}{}%
      }%
    }{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax\ifnottog{#3#4}{\togtrue{#3#6}#8\relax}{}%
      }%
    }%
  }{%
    \ifswitchon{SKV@pl}{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax\iftog{#3#4}{\togfalse{#3#6}}{}%
      }%
    }{%
      \@namedef{#1@#2@#4@func}{%
        #7\relax\iftog{#3#4}{\togtrue{#3#6}#8\relax}{}%
      }%
    }%
  }%
  \SKV@resstate
  \SKV@compk@y{#1}{#2}{#3}{#4}{#5}{#6}%
}
\SKV@def*\SKV@compk@y#1#2#3#4#5#6{%
  \SKV@c@mpkey+[#1]{#2}[#3]{#4}[#5]{\@nameuse{#1@#2@#4@func}}%
    {\SKV@inputerr{##1}{#4}}%
  \SKV@c@mpkey+[#1]{#2}[#3]{#6}[#5]{\@nameuse{#1@#2@#6@func}}%
    {\SKV@inputerr{##1}{#6}}%
}
\SKV@pdef*\SKV@keylistrema#1\@nil#2{%
  \long\edef\SKV@remainder{\unexpanded{#1}}%
  \SKV@oifblank{\SKV@remainder}{}{%
    \def\SKV@tempa##1#2\@nil{\def\SKV@remainder{##1}}%
    \expandafter\SKV@tempa\SKV@remainder\@nil
  }%
}
\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@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@savstate
  \SKV@t@stopta\SKV@define@keylist
}
\SKV@def*\choicekeyvalues{%
  \SKV@t@stopta{\SKV@testopt\SKV@choic@keyvalues\SKV@keyprefix}}
\SKV@def*\SKV@choic@keyvalues[#1]{%
  \SKV@testopt{\SKV@choic@keyv@lues[#1]}\SKV@keyfamily}
\SKV@def*\SKV@choic@keyv@lues[#1][#2]#3#4{%
  \ifSKV@st
    \SKV@csedef{#1@#2@#3@altlist}{#4}%
  \else
    \SKV@ifcsundef{#1@#2@#3@altlist}{%
      \SKV@csedef{#1@#2@#3@altlist}{#4}%
    }{%
      \SKV@err
        {Problem with \string\choicekeyvalues\space for key '#3'}%
        {You have attempted to set two \string\choicekeyvalues\SKV@MB
        for choice key '#3' in the same family '#2'\SKV@MB
        with the same prefix '#1'. You can only do\SKV@MB 
        that if you use the starred variant of \string\choicekeyvalues.}%
    }%
  \fi
}
\SKV@newlet\CKVS\choicekeyvalues
\SKV@def*\SKV@detok@z@p#1{%
  \edef#1{\detokenize\expandafter{#1}\space}%
  \edef#1{\expandafter\zap@space#1\@empty}%
}
\SKV@def*\SKV@detok@zsp#1{%
  \SKV@ensurescape{#1}%
  \begingroup
  \SKV@for*[,]#1\SKV@tempa{%
    \edef\SKV@tempa{\detokenize\expandafter{\SKV@tempa}\space}%
    \edef\SKV@tempa{\expandafter\zap@space\SKV@tempa\@empty}%
    \SKV@aftercs\xdef{SKV@zsp@\expandafter
      \@gobble\SKV@tempa}{\SKV@expox{\SKV@tempa}}%
  }%
  \endgroup
}
\SKV@def*\SKV@detok@dsp#1{%
  \SKV@ensurescape{#1}%
  \begingroup
  \SKV@for*[,]#1\SKV@tempa{%
    \edef\SKV@tempa{\detokenize\expandafter{\SKV@tempa}}%
    \SKV@despace\SKV@tempa
    \SKV@aftercs\xdef{SKV@dsp@\expandafter
      \@gobble\SKV@tempa}{\SKV@expox{\SKV@tempa}}%
  }%
  \endgroup
}
\SKV@def*\SKV@exceplist{\par,\if,\ifcase,\or,\else,\skif,\iftog,\ifswitch}
\SKV@detok@dsp\SKV@exceplist
\SKV@def*\SKV@noiferr#1#2{%
  \SKV@err{You can't use '\@backslashchar #1' in key macro within keylist}%
  {Use '\@backslashchar #2' instead of '\@backslashchar #1'.}%
}
\SKV@def\SKV@define@multkeys#1,#2,#3,#4\@nil{%
  \let\SKV@altlisterr\z@
  \SKV@trailead{#1}\SKV@tempa
  \SKV@checkchoice{\SKV@tempa}{ord,cmd,bool,tog,choice,menu}{%
    \edef\SKV@keytype{\the\numexpr\nr+1}%
  }{%
    \SKV@checkchoice{\SKV@tempa}{1,2,3,4,5}{%
      \edef\SKV@keytype{\the\numexpr\nr+1}%
    }{%
      \SKV@err{Unknown key type/identifier '\string#1'}%
      {Valid key types are 'ord', 'cmd', 'bool', 'tog',
        'choice', 'menu'\SKV@MB and '1', '2', '3', '4', '5'}%
    }%
  }%
  \SKV@ifnotempty{#2}{}{%
    \SKV@err{No key name specified for key type '\string#1'}%
      {\string\define@keylist: key name required for all keys}%
  }%
  \begingroup
  \SKV@ifblank{#4}{}{%
    \edef\SKV@tempb{\detokenize{#4}\space}%
    \edef\SKV@tempb{\expandafter\zap@space\SKV@tempb\@empty}%
    \@expandtwoargs\SKV@in@\SKV@dsp@if\SKV@tempb
    \ifin@
      \@expandtwoargs\SKV@in@\SKV@dsp@iftog\SKV@tempb
      \ifin@\else
        \@expandtwoargs\SKV@in@\SKV@dsp@ifswitch\SKV@tempb
        \ifin@\else\SKV@noiferr{if}{skif}\fi
      \fi
    \fi
    \@expandtwoargs\SKV@in@\SKV@dsp@par\SKV@tempb
    \ifin@\SKV@afterfi\SKV@noiferr{par}{endgraf}\fi
    \@expandtwoargs\SKV@in@\SKV@dsp@ifcase\SKV@tempb
    \ifin@\SKV@afterfi\SKV@noiferr{ifcase}{skifcase}\fi
    \@expandtwoargs\SKV@in@\SKV@dsp@or\SKV@tempb
    \ifin@\SKV@afterfi\SKV@noiferr{or}{skor}\fi
    \@expandtwoargs\SKV@in@\SKV@dsp@else\SKV@tempb
    \ifin@\SKV@afterfi\SKV@noiferr{else}{skelse}\fi
  }%
  \protected@edef\SKV@tempa{\endgroup
    \ifcase\SKV@keytype\relax
    \or
      \noexpand\SKV@def@ordkey[\SKV@keyprefix]{\SKV@keyfamily}%
        {#2}[#3]{\unexpanded{#4}}%
    \or
      \noexpand\SKV@def@cmdkey[\SKV@keyprefix]{\SKV@keyfamily}%
        [\SKV@macroprefix]{#2}[#3]{\unexpanded{#4}}%
    \or
      \noexpand\SKV@def@boolkey+[\SKV@keyprefix]{\SKV@keyfamily}%
        [\SKV@macroprefix]{#2}[#3]{\unexpanded{#4}}{%
          \unexpanded{\SKV@inputerr{##1}{#2}}%
        }%
    \or
      \noexpand\SKV@def@togkey+[\SKV@keyprefix]{\SKV@keyfamily}%
        [\SKV@macroprefix]{#2}[#3]{\unexpanded{#4}}{%
          \unexpanded{\SKV@inputerr{##1}{#2}}%
        }%
    \or
      \SKV@ifcsdef{\SKV@keyprefix @\SKV@keyfamily @#2@altlist}{}%
        {\let\SKV@altlisterr\@ne}%
      \noexpand\SKV@def@choicekey*+[\SKV@keyprefix]{\SKV@keyfamily}{#2}%
        [\unexpanded{\val\nr}]{%
          \SKV@csuse{\SKV@keyprefix @\SKV@keyfamily @#2@altlist}%
        }[#3]{\unexpanded{#4}}{\unexpanded{\SKV@inputerr{##1}{#2}}}%
    \or
      \SKV@ifcsdef{\SKV@keyprefix @\SKV@keyfamily @#2@altlist}{}%
        {\let\SKV@altlisterr\@ne}%
      \noexpand\SKV@def@choicekey*+[\SKV@keyprefix]{\SKV@keyfamily}{#2}%
        [\unexpanded{\val\nr}]{%
          \SKV@csuse{\SKV@keyprefix @\SKV@keyfamily @#2@altlist}%
        }[#3]{\unexpanded{#4}}{\unexpanded{\SKV@inputerr{##1}{#2}}}%
    \fi
  }%
  \SKV@tempa
  \ifnum\SKV@altlisterr=\@ne
    \SKV@afterfi
      \SKV@err{%
        Choice key '#2' can't be defined.\SKV@MB
        Alternate key values list for '#2' is empty
      }{%
        You need to first define admissible\SKV@MB
        key values through '\string\choicekeyvalues'\SKV@MB
        for choice key '#2'.
      }%
  \fi
}
\SKV@pdef*\SKV@in@#1#2{%
  \def\in@@##1#1##2##3\in@@{\ifx\in@##2\in@false\else\in@true\fi}%
  \in@@#2\@mil#1\in@\in@@
}
\SKV@pdef*\in@tog#1#2{%
  \SKV@in@{#1}{#2}%
  \ifin@\togtrue{in@}\else\togfalse{in@}\fi
}
\deftog{in@}
\SKV@pdef*\in@tok#1#2{%
  \begingroup
  \SKV@expnext\SKV@trailead{\detokenize{#1}}\SKV@tempa
  \SKV@expnext\SKV@trailead{\detokenize{#2}}\SKV@tempb
  \@expandtwoargs\SKV@in@\SKV@tempa\SKV@tempb
  \global\let\ifin@\ifin@
  \endgroup
}
\def\XKV@makepf#1{%
  \SKV@trailead{#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
  \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@expargs{3}\SKV@trailead{{#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
  \fi
  \edef\XKV@header{%
    \XKV@prefix\ifx\XKV@header\@empty\else\XKV@header @\fi}%
}
\SKV@def*\SKV@resolvekey#1#2\@nil#3{%
  \def\SKV@resolve##1#2##2##3\@nil##4{%
    \edef##4{\unexpanded{##2}}%
    \ifx##4\@nnil
      \edef##4{\unexpanded{##1}}%
      \expandafter\@secondoftwo
    \else
      \expandafter\@firstoftwo
    \fi
  }%
  \SKV@resolve#1#2{\@nil}\@nil#3%
}
\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@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@tempa
}
\SKV@def*\SKV@findkeypointers#1{%
  \SKV@resolvekey{#1}\uservalue\savevalue\@nil\SKV@resa
  {%
    \SKV@addtouserval\SKV@addtosave
  }{%
    \SKV@resolvekey{#1}\guservalue\savevalue\@nil\SKV@resa
    {%
      \SKV@gaddtouserval\SKV@addtosave
    }{%
      \SKV@resolvekey{#1}\savevalue\uservalue\@nil\SKV@resa
      {%
        \SKV@addtouserval\SKV@addtosave
      }{%
        \SKV@resolvekey{#1}\gsavevalue\uservalue\@nil\SKV@resa
        {%
          \SKV@addtouserval\SKV@gaddtosave
        }{%
          \SKV@resolvekey{#1}\guservalue\gsavevalue\@nil\SKV@resa
          {%
            \SKV@gaddtouserval\SKV@gaddtosave
          }{%
            \SKV@resolvekey{#1}\gsavevalue\guservalue\@nil\SKV@resa
            {%
              \SKV@gaddtouserval\SKV@gaddtosave
            }{%
              \SKV@resolvekey{#1}\uservalue\@nil\SKV@resa
              {%
                \SKV@addtouserval
              }{%
                \SKV@resolvekey{#1}\guservalue\@nil\SKV@resa
                {%
                  \SKV@gaddtouserval
                }{%
                  \SKV@resolvekey{#1}\savevalue\@nil\SKV@resa
                  {%
                    \SKV@addtosave
                  }{%
                    \SKV@resolvekey{#1}\gsavevalue\@nil\SKV@resa
                    {%
                      \SKV@gaddtosave
                    }{}%
                  }%
                }%
              }%
            }%
          }%
        }%
      }%
    }%
  }%
}
\def\XKV@define@key#1{%
  \SKV@findkeypointers{#1}%
  \SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
    \SKV@vbsmsg{warn}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \begingroup
  \edef\SKV@tempa{\endgroup
    \SKV@ifbrack{\noexpand\XKV@d@fine@key{\SKV@resa}}%
      {\noexpand\SKV@d@fine@key{\SKV@resa}}%
  }%
  \SKV@tempa
}
\def\XKV@d@fine@key#1[#2]#3{%
  \XKV@define@default{#1}{#2}%
  \@namedef{\XKV@header#1}##1{#3}%
}
\def\SKV@d@fine@key#1#2{\@namedef{\XKV@header#1}##1{#2}}
\def\XKV@define@cmdkey#1#2[#3]#4{%
  \SKV@findkeypointers{#2}%
  \SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
    \SKV@vbsmsg{warn}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
    \SKV@csundef{#1\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \ifXKV@st
    \SKV@afterfi
    \SKV@expnext\XKV@define@default\SKV@resa{#3}%
  \fi
  \begingroup
  \def\SKV@tempa{%
    \expandafter\def\csname\XKV@header\SKV@resa\endcsname####1}%
  \@threeexpafter\endgroup\expandafter\SKV@tempa\expandafter%
    {\expandafter\def\csname#1\SKV@resa\endcsname{##1}#4}%
}
\def\XKV@define@choicekey#1{%
  \SKV@findkeypointers{#1}%
  \SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
    \SKV@vbsmsg{warn}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \begingroup
  \edef\SKV@tempa{\endgroup
    \SKV@testopt{\noexpand\XKV@d@fine@choicekey{\SKV@resa}}{}%
  }%
  \SKV@tempa
}
\def\XKV@define@boolkey#1#2[#3]{%
  \SKV@findkeypointers{#2}%
  \SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
    \SKV@vbsmsg{warn}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
    \SKV@csundef{#1\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \ifXKV@pl
    \def\SKV@n@xt{\SKV@aftercs\XKV@d@f@ne@boolkey}%
  \else
    \def\SKV@n@xt{\SKV@aftercs\XKV@d@fine@boolkey}%
  \fi
  \edef\SKV@tempa{{\XKV@header\SKV@resa}{\SKV@resa}{#1\SKV@resa}{#3}}%
  \expandafter\SKV@n@xt\SKV@tempa
}
\def\XKV@d@fine@boolkeys#1#2#3{%
  \SKV@findkeypointers{#1}%
  \SKV@ifcsundef{\XKV@header\SKV@resa}{}{%
    \SKV@vbsmsg{warn}{%
      Key '\SKV@resa' in family '\XKV@tfam' with\SKV@MB
      prefix '\SKV@pref' redefined\on@line}
    \SKV@csundef{\XKV@header\SKV@resa}%
    \SKV@csundef{#2\SKV@resa}%
  }%
  \SKV@expnext\SKV@reservkey@err\SKV@resa
  \SKV@expnext\SKV@suspkey@err\SKV@resa
  \edef\SKV@tempa{%
    \noexpand\XKV@d@f@ne@b@olkey\@nameuse{\XKV@header\SKV@resa}%
    {\SKV@resa}{#2\SKV@resa}{#3}{{\noexpand\@nameuse{#2\SKV@resa
    \noexpand\XKV@resa}}}%
  }%
  \SKV@tempa
}
\SKV@pdef*\reserve@keys{\@testopt\SKV@reserve@keys{KV}}
\SKV@def*\SKV@reserve@keys[#1]#2#3{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@res@rve@keys\SKV@tempa{#2}{#3}%
  }%
}
\SKV@def*\SKV@res@rve@keys#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@for@b\XKV@fams\XKV@tfam{%
    \XKV@makehd\XKV@tfam
    \SKV@res@rve@k@ys{#3}%
  }%
}
\SKV@def*\SKV@res@rve@k@ys#1{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for@b\SKV@tempa\SKV@tempa{%
    \SKV@ifcsdef{\XKV@header\SKV@tempa}{%
      \SKV@err{%
        Key '\SKV@tempa' with prefix '\SKV@pref' in family
          \SKV@MB '\XKV@tfam' is already defined
      }{%
        Key '\SKV@tempa' in family '\XKV@tfam' can't be reserved.
        \SKV@MB You may wish to remove it before reserving it.
        \SKV@MB In that case, you can use '\string\remove@keys'.
      }%
    }{%
      \SKV@csedef{\XKV@header\SKV@tempa}{%
        \SKV@err{%
          Key '\SKV@tempa' with prefix '\SKV@pref' in family
          '\XKV@tfam'\SKV@MB was reserved\on@line
        }{%
          Unreserve '\SKV@tempa' before use.
        }%
      }%
      \@namedef{\XKV@header\SKV@tempa @reser}{}%
    }%
  }%
}
\SKV@def*\SKV@reservkey@err#1{%
  \SKV@ifcsdef{\XKV@header#1@reser}\SKV@err\@gobbletwo
  {Key '#1' with prefix '\SKV@pref'\SKV@MB
    is reserved in family '\XKV@tfam'}{Unreserve '#1' before use.}%
}
\SKV@def*\ifkeyreserved{\@testopt\SKV@ifkeyreserved{KV}}
\SKV@def*\SKV@ifkeyreserved[#1]#2#3{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \XKV@knftrue
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@ifkey@reserved\SKV@tempa{#2}{#3}%
  }%
  \@nameuse{@\ifXKV@knf second\else first\fi oftwo}%
}
\SKV@def*\SKV@ifkey@reserved#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@trailead{#3}\XKV@tkey
  \XKV@whilist\XKV@fams\XKV@tfam\ifXKV@knf\fi{%
    \XKV@makehd\XKV@tfam
    \SKV@ifcsdef{\XKV@header\XKV@tkey @reser}{\XKV@knffalse}{}%
  }%
}
\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@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@ifkey@suspended\SKV@tempa{#2}{#3}%
  }%
  \@nameuse{@\ifXKV@knf second\else first\fi oftwo}%
}
\SKV@def*\SKV@ifkey@suspended#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@trailead{#3}\XKV@tkey
  \XKV@whilist\XKV@fams\XKV@tfam\ifXKV@knf\fi{%
    \XKV@makehd\XKV@tfam
    \SKV@ifcsdef{\XKV@header\XKV@tkey @susp}{\XKV@knffalse}{}%
  }%
}
\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@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@ifk@ydefined\SKV@tempa{#2}{#3}%
  }%
  \@nameuse{@\ifXKV@knf second\else first\fi oftwo}%
}
\SKV@def*\SKV@ifk@ydefined#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@trailead{#3}\XKV@tkey
  \XKV@whilist\XKV@fams\XKV@tfam\ifXKV@knf\fi{%
    \XKV@makehd\XKV@tfam
    \SKV@ifcsdef{\XKV@header\XKV@tkey}{\XKV@knffalse}{}%
  }%
}
\SKV@def*\SKV@disabledkey@err{%
  \SKV@err{%
    Key '\SKV@disabledkey' with prefix '\SKV@pref' in family
    \SKV@MB '\XKV@tfam' was disabled\on@line
  }{%
    You can't set or reset '\SKV@disabledkey' at this\SKV@MB
    late stage. Perhaps you're required to set it \SKV@MB
    earlier, within a package or in the document's preamble.
  }%
}
\def\disable@keys{%
  \SKV@ifstar{\@testopt\XKV@disable@keys{KV}}%
    {\@testopt\SKV@disable@keys{KV}}%
}
\SKV@def*\SKV@disable@keys[#1]#2#3{%
  \SKV@locfalse
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@dis@ble@keys\SKV@tempa{#2}{#3}%
  }%
}
\SKV@def*\SKV@dis@ble@keys#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@for@b\XKV@fams\XKV@tfam{%
    \XKV@makehd\XKV@tfam
    \SKV@dis@ble@k@ys{#3}%
  }%
}
\SKV@def*\SKV@dis@ble@k@ys#1{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for@b\SKV@tempa\SKV@tempa{%
    \SKV@ifcsundef{\XKV@header\SKV@tempa}{%
      \ifSKV@verbose\SKV@disabledkey@warn\fi
    }{%
      \SKV@dis@ble@k@y@\SKV@tempa
    }%
  }%
}
\def\SKV@disabledkey@warn{%
  \SKV@warn{Key '\SKV@tempa' with prefix '\SKV@pref'
    \SKV@MB is undefined in family '\XKV@tfam':
    \SKV@MB can't be \ifSKV@loc localized
    \else disabled\fi\on@line
  }%
}
\def\SKV@disabledkey@info{%
  \SKV@info{Key '\SKV@disabledkey' with prefix '\SKV@pref'
    in family '\XKV@tfam'\SKV@MB was \ifSKV@loc localized
    \else disabled\fi\on@line
  }%
}
\SKV@def*\SKV@dis@ble@k@y@#1{%
  \edef\SKV@disabledkey{#1}%
  \SKV@ifcsundef{\XKV@header#1@default}{%
    \edef#1{\noexpand\XKV@define@key{#1}}%
  }{%
    \edef#1{\noexpand\XKV@define@key{#1}[]}%
  }%
  \SKV@expargs{0}#1\SKV@disabledkey@err\@nil
  \ifSKV@verbose\SKV@disabledkey@info\fi
}
\SKV@pdef*\localize@keys{%
  \SKV@onlypackage\SKV@savstate
  \SKV@t@stopta{\@testopt\SKV@localize@keys{KV}}%
}
\SKV@def*\SKV@localize@keys[#1]#2#3{%
  \SKV@loctrue
  \ifSKV@st
    \expandafter\SKV@BeforeDocumentStart
  \else
    \expandafter\SKV@AfterPackageEnd
  \fi
  {%
    \XKV@checksanitizeb{#1}\SKV@tempa
    \SKV@despacelist*\SKV@tempa
    \SKV@for*[,]\SKV@tempa\SKV@tempa{%
      \SKV@expnext\SKV@dis@ble@keys\SKV@tempa{#2}{#3}%
    }%
  }%
  \SKV@resstate
}
\SKV@def*\SKV@suspkey@err#1{%
  \SKV@ifcsdef{\XKV@header#1@susp}\SKV@err\@gobbletwo
  {Key '#1' was suspended from family '\XKV@tfam'}%
  {You can use \string\restore@key\space to restore '#1'.}%
}
\SKV@def*\SKV@suspkey@e@r{%
  \SKV@err{Key '\SKV@suspkey' in family '\XKV@tfam' was\SKV@MB
    suspended\on@line}{You can use \string\restore@key\space
    to restore '\SKV@suspkey'.}%
}
\SKV@pdef*\suspend@keys{\@testopt\SKV@suspend@keys{KV}}
\SKV@def*\SKV@suspend@keys[#1]#2#3{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@s@spend@keys\SKV@tempa{#2}{#3}%
  }%
}
\SKV@def*\SKV@s@spend@keys#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@for@b\XKV@fams\XKV@tfam{%
    \XKV@makehd\XKV@tfam
    \SKV@s@sp@nd@keys{#3}%
  }%
}
\SKV@def*\SKV@s@sp@nd@keys#1{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \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@MB is undefined in family '\XKV@tfam':
        \SKV@MB can't be suspended\on@line}%
    }{%
      \SKV@s@sp@nd@k@ys\SKV@tempa
    }%
  }%
}
\SKV@def*\SKV@s@sp@nd@k@ys#1{%
  \SKV@ifcsdef{\XKV@header#1@susp}{%
    \SKV@err{%
      Key '#1' with prefix '\SKV@pref'
        was suspended from family '\XKV@tfam'
    }{%
      You can use \string\restore@key\space to restore '#1'.
    }%
  }{%
    \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@MB family '\XKV@tfam' was suspended\on@line}%
  }%
}
\SKV@pdef*\restore@keys{\@testopt\SKV@restore@keys{KV}}
\SKV@def*\SKV@restore@keys[#1]#2#3{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@r@store@keys\SKV@tempa{#2}{#3}%
  }%
}
\SKV@def*\SKV@r@store@keys#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@for@b\XKV@fams\XKV@tfam{%
    \XKV@makehd\XKV@tfam
    \SKV@r@st@re@keys{#3}%
  }%
}
\SKV@def*\SKV@r@st@re@keys#1{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \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@MB is undefined in family '\XKV@tfam':
        \SKV@MB can't be restored\on@line}%
    }{%
      \SKV@r@st@re@k@ys\SKV@tempa
    }%
  }%
}
\SKV@def*\SKV@r@st@re@k@ys#1{%
  \SKV@ifcsundef{\XKV@header#1@susp}{%
    \SKV@err{Key '#1' wasn't suspended from family
      \SKV@MB '\XKV@tfam': can't be restored\on@line}%
      {I can't restore unsuspended key '#1'}%
  }{%
    \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@pref' in family \SKV@MB '\XKV@tfam' restored\on@line}%
  }%
}
\SKV@pdef*\remove@keys{\@testopt\SKV@remove@keys{KV}}
\SKV@def*\SKV@remove@keys[#1]#2#3{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for*[,]\SKV@tempa\SKV@tempa{%
    \SKV@expnext\SKV@r@move@keys\SKV@tempa{#2}{#3}%
  }%
}
\SKV@def*\SKV@r@move@keys#1#2#3{%
  \XKV@makepf{#1}%
  \XKV@checksanitizeb{#2}\XKV@fams
  \SKV@despacelist*\XKV@fams
  \SKV@for@b\XKV@fams\XKV@tfam{%
    \XKV@makehd\XKV@tfam
    \SKV@r@m@ve@keys{#3}%
  }%
}
\SKV@def*\SKV@r@m@ve@keys#1{%
  \XKV@checksanitizeb{#1}\SKV@tempa
  \SKV@despacelist*\SKV@tempa
  \SKV@for@b\SKV@tempa\SKV@tempa{%
    \SKV@ifcsundef{\XKV@header\SKV@tempa @susp}{}{%
      \SKV@err{Key '\SKV@tempa' with prefix '\SKV@pref'
        \SKV@MB was suspended from family '\XKV@tfam':
        \SKV@MB I can't remove/unreserve it\on@line.
        \SKV@MB You need to first restore key '\SKV@tempa'
        \SKV@MB before you can remove/unreserve it}%
        {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@MB is undefined in family '\XKV@tfam':
        \SKV@MB I can't remove or unreserve it\on@line}%
    }{%
      \SKV@r@m@ve@k@ys\SKV@tempa
    }%
  }%
}
\SKV@def*\SKV@r@m@ve@k@ys#1{%
  \begingroup
  \edef\SKV@tempa{\XKV@header#1,\XKV@header#1@default,
    \XKV@header#1@func,\XKV@header#1@altlist,
    \XKV@header#1@reser
  }%
  \SKV@for@b\SKV@tempa\SKV@tempa{%
    \SKV@despace\SKV@tempa
    \SKV@csgundef{\SKV@tempa}%
  }%
  \endgroup
  \SKV@vbsmsg{info}{Key '#1' with prefix '\SKV@pref' in family\SKV@MB
    '\XKV@tfam' was removed\on@line}%
}
\SKV@newlet\unreserve@keys\remove@keys
\SKV@def*\uservaluekeys{\XKV@testoptb\SKV@uservaluekeys}
\SKV@def*\SKV@uservaluekeys#1{%
  \SKV@ifcsundef{SKV@\XKV@header uservalue}{%
    \XKV@checksanitizeb{#1}\SKV@tempa
    \SKV@csxdef{SKV@\XKV@header uservalue}{\SKV@expox{\SKV@tempa}}%
  }{%
    \SKV@aftercs\XKV@merge{SKV@\XKV@header uservalue}{#1}\XKV@getsg
  }%
}
\def\setkeys{%
  \def\skif##1{%
    \SKV@ensurenoscape{##1}%
    \SKV@ifcsdef{if##1}{}{%
      \SKV@err{Undefined boolean '##1'}%
        {Boolean '##1' undefined: This is an '\string\skif' error.}%
    }%
    \csname if##1\endcsname
  }%
  \let\skifx\ifx\let\skifcase\ifcase\let\skor\or
  \let\skelse\else\let\skfi\fi
  \SKV@sktrue\XKV@testopta{\XKV@testoptc\XKV@setkeys}%
}
\def\XKV@setkeys[#1]#2{%
  \XKV@checksanitizea{#2}\XKV@resb
  \SKV@normalizea\XKV@resb
  \let\XKV@naa\@empty
  \XKV@for@o\XKV@resb\XKV@tempa{%
    \expandafter\XKV@g@tkeyname\XKV@tempa=\@nil\XKV@tempa
    \XKV@addtolist@x\XKV@naa\XKV@tempa
  }%
  \ifnum\XKV@depth=\z@\let\XKV@rm\@empty\fi
  \XKV@usepresetkeys{#1}{preseth}%
  \SKV@expnext\XKV@s@tkeys\XKV@resb{#1}%
  \XKV@usepresetkeys{#1}{presett}%
  \let\CurrentOption\@empty
  \SKV@skfalse
}
\def\XKV@s@tk@ys@#1{%
  \SKV@ifcsundef{\XKV@header\XKV@tkey}{%
    \SKV@vbsmsg{warn}{No key macro for key '\XKV@tkey'}%
  }{%
    \XKV@knffalse
    \SKV@ifcsundef{SKV@\XKV@header uservalue}{}{%
      \SKV@aftercs\SKV@testuservaluekey
        {SKV@\XKV@header uservalue}\XKV@tkey
      \ifSKV@uv
        \SKV@ifnotblank{#1}{}{%
          \SKV@err{You're required to supply a value\SKV@MB
            for key '\XKV@tkey'}%
            {Supply a value for key '\XKV@tkey' before continuing.}%
        }%
      \fi
    }%
    \SKV@ifcsundef{XKV@\XKV@header save}{}{%
      \SKV@aftercs\XKV@testsavekey{XKV@\XKV@header save}\XKV@tkey
    }%
    \ifXKV@rkv
      \ifXKV@sg\expandafter\global\fi
      \SKV@aftercs\let{XKV@\XKV@header\XKV@tkey @value}\XKV@tempa
    \fi
    \SKV@expnext\XKV@replacepointers\XKV@tempa
    \SKV@ifblank{#1}{%
      \SKV@ifcsundef{\XKV@header\XKV@tkey @default}{%
        \SKV@err{'\XKV@tkey' in family '\XKV@tfam' with\SKV@MB
          prefix '\XKV@pref' has no default value and\SKV@MB
          you haven't supplied a value for it either}%
          {Supply a value for key '\XKV@tkey' and rerun.}%
      }{%
        \SKV@xaftercs\XKV@default{\XKV@header\XKV@tkey @default}\@nil
      }%
    }{%
      \XKV@savstate
      \csname\XKV@header\XKV@tkey\expandafter
        \endcsname\expandafter{\XKV@tempa}\relax
      \XKV@resstate
    }%
  }%
}
\SKV@def*\SKV@testuservaluekey#1#2{%
  \let\SKV@st@aux\ifSKV@st\SKV@sttrue\SKV@uvfalse
  \XKV@whilist#1\SKV@tempa\ifSKV@st\fi{%
    \ifx#2\SKV@tempa\SKV@uvtrue\SKV@stfalse\fi
  }%
  \let\ifSKV@st\SKV@st@aux\SKV@relax\SKV@st@aux
}
\SKV@def*\SKV@remspaceletter#1#2{%
  \begingroup
  \SKV@toks\expandafter{#2 #1}%
  \def\SKV@tempa##1 #1##2\@nil{%
    \SKV@ifblank{##2}{%
      \SKV@toks{##1}%
    }{%
      \SKV@toks{##1#1##2}%
      \expandafter\SKV@tempa\the\SKV@toks\@nil
    }%
  }%
  \expandafter\SKV@tempa\the\SKV@toks\@nil
  \xdef#2{\the\SKV@toks}%
  \endgroup
}
\SKV@def*\SKV@remletterspace#1#2{%
  \begingroup
  \SKV@toks\expandafter{#2#1 }%
  \def\SKV@tempa##1#1 ##2\@nil{%
    \SKV@ifblank{##2}{%
      \SKV@toks{##1}%
    }{%
      \SKV@toks{##1#1##2}%
      \expandafter\SKV@tempa\the\SKV@toks\@nil
    }%
  }%
  \expandafter\SKV@tempa\the\SKV@toks\@nil
  \xdef#2{\the\SKV@toks}%
  \endgroup
}
\SKV@def*\SKV@remletterletter#1#2{%
  \begingroup
  \SKV@toks\expandafter{#2#1#1}%
  \def\SKV@tempa##1#1#1##2\@nil{%
    \SKV@toks{##1#1##2}%
    \SKV@ifblank{##2}{}{%
      \expandafter\SKV@tempa\the\SKV@toks\@nil}%
  }%
  \expandafter\SKV@tempa\the\SKV@toks\@nil
  \def\SKV@tempa##1#1#1\@nil{\gdef#2{##1}}%
  \expandafter\SKV@tempa\the\SKV@toks#1\@nil
  \endgroup
}
\SKV@def*\SKV@remcommaequal#1#2{%
  \begingroup
  \SKV@toks\expandafter{#2#1}%
  \def\SKV@tempa##1#1##2\@nil{%
    \SKV@ifblank{##2}{%
      \SKV@toks{##1}%
    }{%
      \SKV@toks{##1=##2}%
      \expandafter\SKV@tempa\the\SKV@toks\@nil
    }%
  }%
  \expandafter\SKV@tempa\the\SKV@toks\@nil
  \xdef#2{\the\SKV@toks}%
  \endgroup
}
\SKV@def*\SKV@normalizea#1{%
  \@expandtwoargs\SKV@in@{ ,}{\SKV@expox{#1}}%
  \ifin@\SKV@remspaceletter{,}#1\fi
  \@expandtwoargs\SKV@in@{, }{\SKV@expox{#1}}%
  \ifin@\SKV@remletterspace{,}#1\fi
  \@expandtwoargs\SKV@in@{,,}{\SKV@expox{#1}}%
  \ifin@\SKV@remletterletter{,}#1\fi
  \@expandtwoargs\SKV@in@{ =}{\SKV@expox{#1}}%
  \ifin@\SKV@remspaceletter{=}#1\fi
  \@expandtwoargs\SKV@in@{= }{\SKV@expox{#1}}%
  \ifin@\SKV@remletterspace{=}#1\fi
  \@expandtwoargs\SKV@in@{==}{\SKV@expox{#1}}%
  \ifin@\SKV@remletterletter{=}#1\fi
  \@expandtwoargs\SKV@in@{,=}{\SKV@expox{#1}}%
  \ifin@\SKV@remcommaequal{,=}#1\fi
  \@expandtwoargs\SKV@in@{=,}{\SKV@expox{#1}}%
  \ifin@\SKV@remcommaequal{=,}#1\fi
}
\SKV@def*\SKV@gobblescape{%
  \ifnum\escapechar>255\else
  \ifnum\escapechar<0\else
    \expandafter\expandafter
    \csname @gobble\ifnum\escapechar=32 space\fi
    \@threeexpafter\endcsname
  \fi\fi
  \string%
}
\SKV@def*\SKV@save#1{%
  \SKV@ensurescape{#1}%
  \edef\SKV@tempa{saved\SKV@gobblescape#1}%
  \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
      you can save \string#1\space again
    }\@ehc
  }{%
    \SKV@ifdef{#1}{%
      \SKV@cslet\SKV@tempa{#1}%
    }{%
      \SKV@err{Undefined '\string#1' can't be saved\on@line}%
        {You can't restore undefined commands.\SKV@MB
        So why save undefined '\string#1' here?}%
    }%
  }%
}
\SKV@def*\SKV@restore#1{%
  \SKV@ensurescape{#1}%
  \edef\SKV@tempa{saved\SKV@gobblescape#1}%
  \SKV@ifcsdef\SKV@tempa{%
    \def\SKV@n@xt{\SKV@letcs#1\SKV@tempa\SKV@csundef\SKV@tempa}%
  }{%
    \SKV@err{%
      '\@nameuse\SKV@tempa' is undefined:\SKV@MB
      '\string#1' can't be restored\on@line
    }{%
      '\string#1' can't be restored\on@line.\SKV@MB
      Note that each call to \string\SKV@restore\space
      undefines\SKV@MB the saved command.
    }%
  }%
  \SKV@n@xt
}
\SKV@providedef*\input@path{}
\SKV@pdef*\InputFileOnce{%
  \def\SKV@inputfile##1##2{%
    \InputIfFileExists{##2}{%
      \SKV@aftercs\let{##2@read}\@empty
      \let\SKV@inp@tfile\relax
    }{%
      \typein[\Answer]{^^J! File '\string##2' does not exist.^^J
      Enter filename or 'no' and <return> to continue.}%
      \SKV@oifstrequal{\Answer}{no}{%
        \let\SKV@inp@tfile\relax
      }{%
        \def\SKV@inp@tfile{%
          \SKV@expargs{0}{\SKV@InputFileOnce[##1]}\Answer\@nil
        }%
      }%
    }%
  }%
  \let\SKV@no\z@
  \SKV@save\input@path
  \SKV@t@stopta{\SKV@testopt\SKV@InputFileOnce{.}}%
}
\SKV@def*\SKV@InputFileOnce[#1]#2{%
  \gapptomac\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
        File '#2' can't be read again}%
    }{%
      \SKV@inputfile{#1}{#2}%
    }%
  \fi
  \SKV@inp@tfile
  \ifnum\SKV@no=\z@\SKV@restore\input@path\fi
  \let\SKV@no\@ne
}
\SKV@pdef\SKV@notloaded@err#1{%
  \SKV@ifcsdef{ver@#1.\@pkgextension}{}{%
    \SKV@err{Package '#1' wasn't loaded}%
      {Document has started and package '#1' wasn't 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}}%
  }%
}
\SKV@AtDocumentStart{%
  \let\SKV@do@b\SKV@notloaded@err
  \SKV@notloaded
  \global\let\SKV@do@b\@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
}

\endinput

%%% End of file skeyval.sty %%%
