From fee6ae63b6689ddbae970ff9114c6ed976bf1dab Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 13 Feb 2013 00:03:06 +0000 Subject: skeyval (12feb13) git-svn-id: svn://tug.org/texlive/trunk@29092 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/skeyval/skeyval.sty | 797 +++++++++++++----------- 1 file changed, 437 insertions(+), 360 deletions(-) (limited to 'Master/texmf-dist/tex/latex/skeyval/skeyval.sty') diff --git a/Master/texmf-dist/tex/latex/skeyval/skeyval.sty b/Master/texmf-dist/tex/latex/skeyval/skeyval.sty index fce36938787..010ce8c51fd 100644 --- a/Master/texmf-dist/tex/latex/skeyval/skeyval.sty +++ b/Master/texmf-dist/tex/latex/skeyval/skeyval.sty @@ -1,5 +1,19 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'skeyval.sty', version 1.1a, 2012/10/16. % +% This is file 'skeyval.sty', version 1.2, 2013/02/10. % +% % +% 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, % @@ -15,6 +29,8 @@ % 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: % % % @@ -23,7 +39,7 @@ % skeyval-pstkey.sty, skeyval-pstkey.tex, skeyval-testclass.cls, % % and skeyval-testpkg.sty. % % % -% Copyright (c) 2010-2012 Ahmed Musa (amusa22@gmail.com). % +% Copyright (c) 2010-2013 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \begingroup @@ -67,19 +83,19 @@ \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}[2012/10/16 v1.1a Robust key-value parser (AM)] +\ProvidesPackage{skeyval}[2013/02/10 v1.2 Robust key-value parser (AM)] \NeedsTeXFormat{LaTeX2e}[2011/06/27] \input skeyval-core -\skvrobustdef*\skvAfterEndPackage{% +\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{% +\skvrobustdef*\skvafterpackage#1{% \skvafterbegindocument{% \skvifcsdefTF{ver@#1.\@pkgextension}{}{% \skv@warn{Package '#1' was never loaded}% @@ -99,13 +115,12 @@ }% \unexpanded\expandafter{\@popfilename}% } +\skvundef\skv@documentclass \skvrobustdef*\skv@getdocumentclass{% - \skv@swafalse - \ifx\@filelist\@undefined\else - \ifx\@filelist\relax\else - \ifx\@filelist\@gobble\else\skv@swatrue\fi - \fi\fi - \ifskv@swa + \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 @@ -119,20 +134,22 @@ }% \fi } -\skv@getdocumentclass + +% 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{% - \skv@swafalse - \ifx\@classoptionslist\@undefined\else - \ifx\@classoptionslist\relax\else\skv@swatrue\fi - \fi - \ifskv@swa - \let\skv@filterclassoptions\relax + \ifcase0% + \ifx\@classoptionslist\@undefined 1\fi + \ifx\@classoptionslist\relax 1\fi\relax + \global\let\skv@filterclassoptions\relax \skvkvnormalize\@classoptionslist - \let\skv@origclassoptlist\@classoptionslist + \let\skvoriginalclassoptionslist\@classoptionslist \let\skv@classoptionslist\@classoptionslist \let\@classoptionslist\@empty - \skvcommaloop*\skv@origclassoptlist\skv@tempa{% + \skvcommaloop*\skvoriginalclassoptionslist\skv@tempa{% \skvxifinTF{=}{\skvexpandonce\skv@tempa}{}{% \skvaddtolist*\@classoptionslist\skv@tempa }% @@ -140,11 +157,9 @@ \def\@fileswith@ptions##1[##2]##3{% \edef\skv@tempa{\unexpanded{##3}}% \skvcsvnormalize\skv@tempa - % The following packages need access to the original - % \@classoptionslist. - \skvcommaloop{xkeyval,kvoptions,keyval2e,ltxkeys}\skv@prova{% + \skvcommaloop*\skv@optionprocessorpackages\skv@prova{% \skvxifinTF{,\skv@prova,}{,\skv@tempa,}{% - \let\@classoptionslist\skv@origclassoptlist + \let\@classoptionslist\skvoriginalclassoptionslist \skvbreakloop }{}% }% @@ -153,15 +168,6 @@ }% \fi } -\skvifdefFT\skv@documentclass{% - \let\skv@documentclass\@empty - \let\skv@classoptionslist\@empty - \edef\@popfilename{% - \skvexpandonce\@popfilename\skv@filterclassoptions - }% -}{% - \skv@filterclassoptions -} \skvrobustdef*\skvbeforebegindocument{% \skvgappendtomacro\skv@beforebegindoc } @@ -187,7 +193,7 @@ } \skvrobustdef*\skv@notprerr#1{% \@latex@error{Command \detokenize{#1} should be used only - in preamble}\@ehd + in preamble}\skv@ehd } \skvnewdef*\skv@everypagehook{} \skvrobustdef*\skvatbegineverypage{\skvgappendtomacro\skv@everypagehook} @@ -206,29 +212,37 @@ \skvnewdef*\skv@preamblecmdhook{} \skvrobustdef*\skvonlypreamble#1{% - \def\do##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}% + \skvexpandonce\skv@preamblecmdhook\unexpanded{\do##1}% }% }% }% \skvcommaparse{#1}\skv@prova{% - \expandafter\do\expandafter{\skv@prova}% + \expandafter\skv@provb\expandafter{\skv@prova}% }% } \AtEndOfPackage{% \skvafterbegindocument{% \def\do#1{% \skvifdefTF#1{% - \gdef#1{\@latexerr{'\string#1' is a preamble command}\@ehd}% + \gdef#1{\@latexerr{'\string#1' is a preamble command}\skv@ehd}% }{% - \@@warning{Undefined command '\unexpanded{#1}' - appeared in \string\skvonlypreamble}% + \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 @@ -242,7 +256,7 @@ % \skvunknownoptionhandler[]<>{} % \skvrobustdef*\skvunknownoptionhandler{% - \skv@testopt\skv@unknownoptionhandler\skv@defaultpref + \skv@testopt\skv@unknownoptionhandler\skvdefaultprefix } \skvrobustdef*\skv@unknownoptionhandler[#1]{% \skvifnextchar<{\skv@unkn@wnoptionhandler{#1}}% @@ -251,14 +265,12 @@ \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}}\skv@defaultpref} +\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'}\@ehd + \skv@err{Only one prefix is allowed, but you gave '#2'}\skv@ehd }{% \skv@makeprefix{#2}% \skvifnextchar<{\skv@@t@st@pte{#1}}% @@ -289,6 +301,14 @@ \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 @@ -302,44 +322,40 @@ \skv@dox@a } -% Our default action for unknown options is tied to \@currname & \@currext: +% Our default action for unknown options is tied to \@currname +% and \@currext: \skvrobustdef\skv@dox#1{% - \skvcsedef{skv@dox@\@currname @\@currext}{% + \skvcsedef{skv@dox@\@currname.\@currext}{% \unexpanded{% - \begingroup \ifx\skvcurrentvalue\skv@novaluetoks \def\skvcurrentvalue{no value}% \fi - \@onelevel@sanitize\CurrentOption - \@onelevel@sanitize\skvcurrentvalue #1% - \endgroup }% }% } -\skvrobustdef*\skv@dox@a{\skv@testopt\skv@dox@b\skv@defaultpref} +\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>}% + \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[]{}{