%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% % This is file 'skeyval.sty', version 1.3, 2013/05/15. % % % % NOTE % % % % Beginning from version 1.0, 2012/09/01, the skeyval package has changed % % radically. Users of pre-version 1.0 of the package can load it now by % % calling: % % % % \usepackage[compatibility]{skeyval} % % \RequirePackage[compatibility]{skeyval} % % or % % \usepackage{skeyval-bc} % % \RequirePackage{skeyval-bc} % % % % LICENSE % % % % 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. % % % % DISTRIBUTION % % % % The following files constitute the skeyval bundle and must be % % distributed as a whole: % % % % README, skeyval.sty, skeyval-core.tex, skeyval-for.tex, % % skeyval-view.sty, skeyval-ltxpatch.sty, skeyval-ltxcmds.tex, % % skeyval-pstkey.sty, skeyval-pstkey.tex, skeyval-testclass.cls, % % skeyval-testpkg.sty, skeyval-pokayoke1, skeyval-pokayoke2, % % skeyval-view-pokayoke1. % % % % Copyright (c) 2010-2013 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \begingroup \catcode035 06 % # \catcode064 11 % @ \catcode123 01 % { \catcode125 02 % } \catcode044 12 % , \def\skv@prova{\endgroup \def\do##1,{% \ifx\do##1\else \catcode##1\string=\the\catcode##1\relax \expandafter\do \fi }% \edef\skv@restorecodes{\do35,64,123,125,61,59,13,\do,}% } \skv@prova \edef\skv@restorecodes{% \unexpanded\expandafter{\skv@restorecodes}% \endlinechar\the\endlinechar\relax } \endlinechar13 % \catcode035 06 % # \catcode064 11 % @ \catcode123 01 % { \catcode125 02 % } \catcode061 12 % = \catcode044 12 % , \def\do#1=#2,{% \ifx\do#1\else \edef\skv@restorecodes{% \unexpanded\expandafter{\skv@restorecodes}% \catcode#1=\the\catcode#1\relax }% \catcode#1=#2\relax \expandafter\do \fi } \do 032=10,033=12,036=03,038=04,040=12,041=12,042=12,043=12,% 059=12,045=12,047=12,058=12,063=12,091=12,093=12,126=13,\do=,% \ProvidesPackage{skeyval}[2013/05/15 v1.3 Robust key-value parser (AM)] \NeedsTeXFormat{LaTeX2e}[2011/06/27] \input skeyval-core \skvrobustdef*\skvafterendpackage{% \skvifcsdefTF{\@currname.\@currext-skv@endpkghook}{}{% \@namedef{\@currname.\@currext-skv@endpkghook}{}% }% \expandafter\g@addto@macro \csname\@currname.\@currext-skv@endpkghook\endcsname } \skvrobustdef*\skvafterpackage#1{% \skvafterbegindocument{% \skvifcsdefTF{ver@#1.\@pkgextension}{}{% \skv@warn{Package '#1' was never loaded}% }% } \skvifcsdefTF{ver@#1.\@pkgextension}{% \@firstofone }{% \skvappendtomacro{#1.\@pkgextension-skv@endpkghook}% }% } \xdef\@popfilename{% \unexpanded{% \csname\@currname.\@currext-skv@endpkghook\endcsname \expandafter\let \csname\@currname.\@currext-skv@endpkghook\endcsname\relax }% \unexpanded\expandafter{\@popfilename}% } \skvundef\skv@documentclass \skvrobustdef*\skv@getdocumentclass{% \ifcase0% \ifx\@filelist\@undefined 1\fi \ifx\@filelist\relax 1\fi \ifx\@filelist\@gobble 1\fi\relax \skvcommaparse*\@filelist\skv@tempa{% \filename@parse\skv@tempa \ifx\filename@ext\@clsextension \skvifcsdefFT{opt@\filename@area\filename@base.\filename@ext}{}{% \edef\skv@documentclass{% \filename@area\filename@base.\filename@ext }% }% \fi \ifx\skv@documentclass\@undefined\else\skvbreakloop\fi }% \fi } % The following packages need access to the original \@classoptionslist: \skvnewdef*\skv@optionprocessorpackages{% xkeyval,kvoptions,catoptions,biblatex,pgfopts,ltxkeys% } % Filter class options to remove those with '=': \skvrobustdef*\skv@filterclassoptions{% \ifcase0% \ifx\@classoptionslist\@undefined 1\fi \ifx\@classoptionslist\relax 1\fi\relax \global\let\skv@filterclassoptions\relax \skvkvnormalize\@classoptionslist \let\skvoriginalclassoptionslist\@classoptionslist \let\skv@classoptionslist\@classoptionslist \let\@classoptionslist\@empty \skvcommaloop*\skvoriginalclassoptionslist\skv@tempa{% \skvxifinTF{=}{\skvexpandonce\skv@tempa}{}{% \skvaddtolist*\@classoptionslist\skv@tempa }% }% \def\@fileswith@ptions##1[##2]##3{% \edef\skv@tempa{\unexpanded{##3}}% \skvcsvnormalize\skv@tempa \skvcommaloop*\skv@optionprocessorpackages\skv@prova{% \skvxifinTF{,\skv@prova,}{,\skv@tempa,}{% \let\@classoptionslist\skvoriginalclassoptionslist \skvbreakloop }{}% }% \skvifnextchar[{\@fileswith@pti@ns##1[##2]##3}% {\@fileswith@pti@ns##1[##2]##3[]}% }% \fi } \skvrobustdef*\skvbeforebegindocument{% \skvgappendtomacro\skv@beforebegindoc } \skvnewdef*\skv@beforebegindoc{} \skvprependtomacro\document{% \endgroup \let\skvbeforebegindocument\@firstofone \skv@beforebegindoc \gdef\skvbeforebegindocument{\skv@notprerr\skvbeforebegindocument}% \global\let\skv@beforebegindoc\relax \begingroup } \skvrobustdef*\skvafterbegindocument{% \skvgappendtomacro\skv@afterbegindoc } \skvnewdef*\skv@afterbegindoc{} \skvgappendtomacro\document{% \let\skvafterbegindocument\@firstofone \skv@afterbegindoc \gdef\skvafterbegindocument{\skv@notprerr\skvafterbegindocument}% \global\let\skv@afterbegindoc\relax \ignorespaces } \skvrobustdef*\skv@notprerr#1{% \@latex@error{Command \detokenize{#1} should be used only in preamble}\skv@ehd } \skvnewdef*\skv@everypagehook{} \skvrobustdef*\skvatbegineverypage{\skvgappendtomacro\skv@everypagehook} \skvafterbegindocument{% \let\skv@savedoutputpage\@outputpage \def\@outputpage{% \let\skv@savedbegindvi\@begindvi \def\@begindvi{% \skv@everypagehook \skv@savedbegindvi }% \skv@savedoutputpage \let\@begindvi\skv@savedbegindvi }% } \skvnewdef*\skv@preamblecmdhook{} \skvrobustdef*\skvonlypreamble#1{% \def\skv@provb##1{% \skvifntypeTF{##1}{}{% \skv@err{More than one macro \MessageBreak '\detokenize{##1}'. \MessageBreak Maybe a comma is missing in the list}\skv@ehd }% \skvxifinTF{\detokenize{\do##1}}{\skvoxdetok\skv@preamblecmdhook}{% \skv@warn{Command '\noexpand##1' multiply \MessageBreak submitted to \string\skvonlypreamble: ignored}% }{% \xdef\skv@preamblecmdhook{% \skvexpandonce\skv@preamblecmdhook\unexpanded{\do##1}% }% }% }% \skvcommaparse{#1}\skv@prova{% \expandafter\skv@provb\expandafter{\skv@prova}% }% } \AtEndOfPackage{% \skvafterbegindocument{% \def\do#1{% \skvifdefTF#1{% \gdef#1{\@latexerr{'\string#1' is a preamble command}\skv@ehd}% }{% \ifx\relax#1\else \@@warning{Undefined command '\unexpanded{#1}' \MessageBreak appeared in \string\skvonlypreamble. \MessageBreak Only defined commands should be \MessageBreak submitted to \string\skvonlypreamble.}% \fi }% }% \skv@preamblecmdhook \let\skv@preamblecmdhook\relax \let\do\relax }% } %%+++++++++++++++++ Utilities for handling options ++++++++++++++++%% % \skvunknownoptionhandler[]<>{} % \skvrobustdef*\skvunknownoptionhandler{% \skv@testopt\skv@unknownoptionhandler\skvdefaultprefix } \skvrobustdef*\skv@unknownoptionhandler[#1]{% \skvifnextchar<{\skv@unkn@wnoptionhandler{#1}}% {\skv@unkn@wnoptionhandler{#1}<\@currname.\@currext>}% } \skvrobustdef*\skv@unkn@wnoptionhandler#1<#2>{% \skv@unknownkeyhandler[#1]{#2}% } \skvrobustdef*\skv@testopte#1{\skv@testopta{\skv@t@stopte{#1}}} \skvrobustdef*\skv@t@stopte#1{\skv@testopt{\skv@t@st@pte{#1}}\skvdefaultprefix} \skvrobustdef*\skv@t@st@pte#1[#2]{% % Only one prefix is allowed: \skvxifinTF{,}{\detokenize{#2}}{% \skv@err{Only one prefix is allowed, but you gave '#2'}\skv@ehd }{% \skv@makeprefix{#2}% \skvifnextchar<{\skv@@t@st@pte{#1}}% {\skv@@t@st@pte{#1}<\@currname.\@currext>}% }% } \skvrobustdef*\skv@@t@st@pte#1<#2>{% \edef\skv@fams{#2}% \skvxifinTF{,}{\detokenize{#2}}{% \skvcsvnormalize\skv@fams }{% \skvdespacecontent\skv@fams }% \skv@testopt{#1}{}% } \skvrobustdef*\skveveryunknownoption{\skvdeclareoption*} % \skvdeclareoption[]<>{}[]{} % \skvdeclareoption*{} \skvrobustdef*\skvdeclareoption{% \let\@fileswith@pti@ns\@badrequireerror \let\skvdefkey\skvordkey \skvifstar\skv@dox\skv@dox@a } % \skvdeclarevoidoption[]<>{}[]{} \skvrobustdef*\skvdeclarevoidoption{% \let\@fileswith@pti@ns\@badrequireerror \let\skvdefkey\skvvoidkey \skv@dox@a } % \skvdeclareobsoleteoption % []{}{}{}[]{} \skvrobustdef*\skvdeclareobsoleteoption{% \let\@fileswith@pti@ns\@badrequireerror \let\skvdefkey\skvobsoletekey \skv@dox@a } % \skvdeclarebooloption[]<>[]{}[]{} \skvrobustdef*\skvdeclarebooloption{% \let\@fileswith@pti@ns\@badrequireerror \let\skvdefkey\skvboolkey \skv@dox@a } % \skvdeclarecmdoption[]<>[]{}[]{} \skvrobustdef*\skvdeclarecmdoption{% \let\@fileswith@pti@ns\@badrequireerror \let\skvdefkey\skvcmdkey \skv@dox@a } % Our default action for unknown options is tied to \@currname % and \@currext: \skvrobustdef\skv@dox#1{% \skvcsedef{skv@dox@\@currname.\@currext}{% \unexpanded{% \ifx\skvcurrentvalue\skv@novaluetoks \def\skvcurrentvalue{no value}% \fi #1% }% }% } \skvrobustdef*\skv@dox@a{\skv@testopt\skv@dox@b\skvdefaultprefix} \skvrobustdef*\skv@dox@b[#1]{% \skvifnextchar<{\skv@dox@c{#1}}{\skv@dox@c{#1}<\@currname.\@currext>}% } \skvrobustdef*\skv@dox@c#1<#2>{\skvdefkey[#1]{#2}} % Declare options with default values that will be used when the options % are called without user values. % % \skvdeclarepassedoptions[]{}{