%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% % This is 'catoptions' package (Version 0.2.6, September 2011) % % % % The catoptions package changes LaTeX package loading internals % % so that all subsequently loaded packages can rely on having % % normal catcodes in effect. The package also contains some useful % % facilities unconnected with catcodes. In particular, it contains % % options processing facilities that have the familiar and simple % % syntax of LaTeX's legacy options parsing mechanism, but with % % improved robustness in terms of option value default, preservation % % of braces in option values, and parsing of expandable package % % and class option values. Also, the package contains some API. % % % % The catcode facilities of the package are an extension of the % % 'pcatcode' package by Michael J. Downes and David M. Jones. % % % % 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 LPPL maintenance status of this software is 'author-maintained'. % % % % Copyright (c) 2010-2011 Ahmed Musa (amusa22@gmail.com). % % % %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \begingroup \chardef\%\catcode37\catcode37 14\relax\expandafter\iffalse\string\ \fi\let\e\endlinechar\chardef\E\e\e13\chardef\n\catcode\e\catcode\e5% \chardef\s\catcode32 \catcode32\string=10 \chardef\=\catcode61 \catcode61\string=12 \chardef\l=\catcode123 \catcode123=1 \chardef\r=\catcode125 \catcode125=2 \chardef\[=\catcode91 \catcode91=12 \chardef\]=\catcode93 \catcode93=12 \chardef\^=\catcode94 \catcode94=7 \chardef\.=\catcode46 \catcode46=12 \chardef\/=\catcode47 \catcode47=12 \chardef\~=\catcode126 \catcode126=13 \chardef\&=\catcode38 \catcode38=4 \chardef\$=\catcode36 \catcode36=3 \chardef\_=\catcode95 \catcode95=8 \chardef\+=\catcode43 \catcode43=12 \chardef\!=\catcode33 \catcode33=12 \chardef\'=\catcode39 \catcode39=12 \chardef\(=\catcode40 \catcode40=12 \chardef\)=\catcode41 \catcode41=12 \chardef\*=\catcode42 \catcode42=12 \chardef\,=\catcode44 \catcode44=12 \chardef\-=\catcode45 \catcode45=12 \chardef\:=\catcode58 \catcode58=12 \chardef\<=\catcode60 \catcode60=12 \chardef\>=\catcode62 \catcode62=12 \chardef\`=\catcode96 \catcode96=12 \edef\x{% \endgroup \def\noexpand\cptrestorecatcodes{% \endlinechar=\number\E \catcode\number\e=\number\n \catcode32=\number\s \catcode123=\number\l \catcode125=\number\r \catcode37=\number\% \catcode61=\number\= \catcode91=\number\[ \catcode93=\number\] \catcode94=\number\^ \catcode46=\number\. \catcode47=\number\/ \catcode126=\number\~ \catcode38=\number\& \catcode36=\number\$ \catcode95=\number\_ \catcode43=\number\+ \catcode33=\number\! \catcode39=\number\' \catcode40=\number\( \catcode41=\number\) \catcode42=\number\* \catcode44=\number\, \catcode45=\number\- \catcode58=\number\: \catcode60=\number\< \catcode62=\number\> \catcode96=\number\` }% } \x \catcode37 14\relax\expandafter\iffalse\string\ \fi\endlinechar13\catcode13 5% \catcode61\string=12 \catcode32=10 \catcode123=1 \catcode125=2 \catcode91=12 \catcode93=12 \catcode46=12 \catcode47=12 \catcode94=7 \catcode126=13 \edef\cpt@hashchar{\string#} \m@ne=-1\z@=0pt\p@=1pt \@ifdefinable\m@one{\newcount\m@one\m@one\m@ne} \@ifdefinable\z@pt{\newdimen\z@pt\z@pt\z@} \chardef\active=13 \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{catoptions} [2011/09/10 v0.2.6 Securing catcodes and parsing options (AM)] \ifcase% \ifx\eTeXversion\cpt@undefined\z@pt\else \ifnum\eTeXversion<\tw@\z@pt\else\@ne\fi\fi \PackageError{catoptions}{eTeX not loaded or old version} {This package requires eTeX version 2 or higher.}% \expandafter\endinput \fi \ifx\pdfstrcmp\cpt@undefined \PackageError{catoptions} {You aren't using pdfTeX version 1.50.0} {This package requires pdfTeX version 1.50.0}% \fi \newcommand*\MsgBrk{\MessageBreak} \def\cptloggingall{\loggingall\tracingifs\@ne} \@ifdefinable\showcsn{% \protected\def\showcsn#1#{\expandafter\show\csname#1\endcsname}% } \newcommand*\cptnormalcatcodes{% \endlinechar13 \catcode33=12\catcode34=12\catcode35=6\catcode36=3\catcode37=14 \catcode38=4\catcode39=12\catcode40=12\catcode41=12\catcode42=12 \catcode43=12\catcode44=12\catcode45=12\catcode46=12\catcode47=12 \catcode58=12\catcode59=12\catcode60=12\catcode61=12\catcode62=12 \catcode63=12\catcode91=12\catcode92=0\catcode93=12\catcode94=7 \catcode95=8\catcode96=12\catcode123=1\catcode124=12\catcode125=2 \catcode126=13\catcode32=10\catcode13=5\catcode9=10\catcode10=12 } \begingroup \let\s\string \escapechar\m@one \xdef\cpt@otherchars{% \s\!\s\"\s\#\s\$\s\%\s\&\s\'\s\(\s\)\s\*\s+\s\,\s\-\s\.\s\/\s\:% \s\;\s\<\s\=\s\>\s\?\s\[\s\\\s\]\s\^\s\_\s\`\s\{\s\|\s\}\s\~% } \endgroup \def\cpt@spcatcodestack{} \def\cpt@sppushcatcodes{% \edef\cpt@spcatcodestack{% \catcode\number`\ =\the\catcode`\ % \catcode\number`\^^I=\the\catcode`\^^I \catcode\number\endlinechar=\the\catcode`\ \endlinechar=\the\endlinechar {\cpt@spcatcodestack}% }% } \newcommand*\BeginOverlookWhiteSpace{% \pushnumber\cpt@overlooknr \ifnum\cpt@overlooknr>\@ne \cpt@err{There is an unclosed \string\BeginOverlookWhiteSpace}\@ehc \fi \cpt@sppushcatcodes \catcode`\ =9\relax \catcode`\^^I=9\relax \endlinechar\m@one } \newcommand*\EndOverlookWhiteSpace{% \def\reserved@a##1##{##1\xdef\cpt@spcatcodestack}% \expandafter\reserved@a\cpt@spcatcodestack \undefcs\cpt@overlooknr } \newcommand*\BeginOverlookEndline{% \pushnumber\cpt@overlookendlinenr \ifnum\cpt@overlookendlinenr>\@ne \cpt@err{There is an unclosed \string\BeginOverlookEndline}\@ehc \fi \chardef\cpt@savendlinechar=\number\endlinechar \endlinechar\m@one } \newcommand*\EndOverlookEndline{% \endlinechar\cpt@savendlinechar \undefcs\cpt@overlookendlinenr } \newcommand*\cpt@catcodestack{} \newcommand*\cptpushcatcodes{% \begingroup \def\x##1{% \ifx##1\@nnil\else \catcode\number`##1=\the\catcode`##1\relax \expandafter\x \fi }% \xdef\cpt@catcodestack{% \expandafter\x\cpt@otherchars\ \ \^^I\^^J\@nnil{\cpt@catcodestack}% }% \endgroup } \cptpushcatcodes \cptnormalcatcodes \newcommand*\cptpopcatcodes{% \begingroup \def\x##1##{\endgroup##1\xdef\cpt@catcodestack}% \expandafter\x\cpt@catcodestack } \@ifdefinable\currentcatcodesubset\relax \newcommand*\GetCurrentCatcodeSubset{% \begingroup \def\x##1{% \ifx##1\@nnil\else \@space(\string##1\@firstofone{:\number\catcode`##1})% \expandafter\x \fi }% \edef\x{% \def\noexpand\currentcatcodesubset{% \x\^^I\^^J\^^L\^^M\ \!\"\#\$\%\&% \'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\}\|\~\@nnil }% }% \expandafter\endgroup\x } \newcommand*\cpt@setupsafeactivesedef{% \begingroup \endlinechar\m@one \def\siso@do##1{\catcode`##1\string=\active}% \simpleexpandarg\siso@@loop\cpt@otherchars \gdef\cptsafeactivesedef##1##2{% \begingroup \def\siso@do####1{% \ifnum\catcode`####1\string=\active\edef####1{\string####1}\fi }% \simpleexpandarg\siso@@loop\cpt@otherchars \cptexpandsecond\endgroup {\edef\noexpand##1{\noexpand\unexpanded{##2}}}% }% \endgroup } \newcommand*\declarefutureletset[2][fl@]{% \xdef\cpt@fletprefix{\cpttrimspaces{#1}}% \cptexpandargonce{\cptfiltermergecsv[,]\cpt@fletprefixes}% \cpt@fletprefix\nofilter \ifblankTF{#2}{% \def\neededfutureletchars{}% }{% \def\neededfutureletchars{#2}% \cpt@sttrue\cpt@csvnormalize[,]\neededfutureletchars \oifstrcmpFT\neededfutureletchars{all}{}{% \def\neededfutureletchars{}% \def\cpt@tempa##1\@##2\@{% \ifx##1\end\else \cptgaddtolist\neededfutureletchars{##1}% \expandafter\cpt@tempa \fi }% \expandafter\cpt@tempa\cpt@futureletchars\end\@\@ }% }% \globalize\neededfutureletchars \globalize\cpt@fletprefixes } \begingroup \cptrestorecatcodes \begingroup \catcode`\3="3 \catcode`\4="4 \catcode`\7="7 \catcode`\8="8 \catcode`\A="A \catcode`\B="B \catcode`\C="C \catcode`\D="D \gdef\cpt@flet@a#1#2{% \begingroup \edef\cpt@tempa{\noexpandcsn{\cpt@fletprefix#1}}% \edef\cpt@tempb{\noexpandcsn{if\cpt@fletprefix#1}}% \oifinset@sp@TF,\cpt@tempa\cptfutureletmacros{}{% \xdef\cptfutureletmacros{% \ifcsnullTF\cptfutureletmacros{}% {\expandcsonce\cptfutureletmacros,}% \expandcsonce\cpt@tempa,\expandcsonce\cpt@tempb }% }% \def\siso@do##1{\lccode`##1=`#2}% \siso@@loop{034678BCD}% \ifnum\catcode`#2=\active \def\do##1{\noexpand\do\noexpand##1\noexpand}% \lowercase{% \xdef\cpt@activecharacters{% \cpt@activecharacters \do#2D% }% }% \fi \xdef\cpt@tempa{% \let\noexpand\cpt@tempa\noexpand\cpt@undefined \gletcs\expandcsonce\cpt@tempa= % }% \aftergroup\cpt@tempa \lowercase{% \expandafter\endgroup \ifcase\numexpr\catcode`#2\relax 0\or \bgroup\or \egroup\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or \@sptoken\or B\or C\else D\fi }% } \endgroup \gdef\cpt@futureletchars{% space\@\ \@ exclam\@\!\@ dblquote\@\"\@ hash\@\#\@ dollar\@\$\@ ampersand\@\&\@ rquote\@\'\@ lparen\@\(\@ rparen\@\)\@ star\@\*\@ plus\@\+\@ comma\@\,\@ hyphen\@\-\@ period\@\.\@ slash\@\/\@ colon\@\:\@ semicolon\@\;\@ less\@\<\@ equal\@\=\@ greater\@\>\@ question\@\?\@ lbracket\@\[\@ rbracket\@\]\@ hat\@\^\@ underscore\@\_\@ lquote\@\`\@ lbrace\@\{\@ vert\@\|\@ rbrace\@\}\@ tilde\@\~\@ bslash\@\\\@ } \gdef\cptfutureletsetup{% \gdef\cpt@activecharacters{}% \gdef\cptfutureletmacros{}% \def\cpt@flet@b##1\@##2\@{% \ifxTF##1\end{}{% \oifinset@sp@FT,{##1}\neededfutureletchars{}{% \cpt@flet@a{##1}{##2}% }% \cpt@flet@b }% }% \def\csv@do##1{% \gundefcsn{##1\curropt}% \gundefcsn{if##1\curropt}% }% \def\cpt@fletundef##1\@##2\@{% \ifxTF##1\end{}{% \def\curropt{##1}% \csv@@parse*[,]\cpt@fletprefixes \cpt@fletundef }% }% \def\cpt@fletdef##1\@##2\@{% \ifxTF##1\end{}{% \oifinset@sp@FT,{##1}\neededfutureletchars{}{% \csn@xdef{if\cpt@fletprefix##1}####1{% \noexpand\usename{@\noexpand\ifx \noexpandcsn{\cpt@fletprefix##1}% ####1\unexpanded{\@empty first\else second\fi oftwo}% }% }% }% \cpt@fletdef }% }% \expandafter\cpt@fletundef\cpt@futureletchars\end\@\@ \expandafter\cpt@fletdef\cpt@futureletchars\end\@\@ \expandafter\cpt@flet@b\cpt@futureletchars\end\@\@ } \AtBeginDocument{\cptrestorecatcodes} \gdef\futureletresetactives{% \begingroup \defpass\cpt@tempa##1{\endgroup \def\do####1####2{\let####1=##1####2}% }{ }% \cpt@activecharacters \let\do\relax } \endgroup \long\protected\def\cpt@ifnextchar#1#2#3{% \begingroup \let\reserved@a=#1% \toks@{\endgroup#2}\toks1{\endgroup#3}% \global\futurelet\@let@token\cpt@ifnext } \protected\def\cpt@ifnext{% \ifx\@let@token\@sptoken \toks2{\cpt@ifn@xt}% \else \ifx\@let@token\reserved@a \toks2\expandafter{\the\toks@}% \else \toks2\expandafter{\the\toks1}% \fi \fi \the\toks2 } \@namedef{cpt@ifn@xt} {\global\futurelet\@let@token\cpt@ifnext} \newcommand\ifnextcharTF[3]{% \begingroup \cpt@ifnextchar\relax {\cpt@ifnextcharacter{#1}{#2}{#3}}% {\cpt@ifnextcharacter{#1}{#2}{#3}}% } \long\def\cpt@ifnextcharacter#1#2#3{% \ifcase \ifcat\noexpand\@let@token\bgroup 1\fi \ifcat\noexpand\@let@token\egroup 1\fi 0\let\next\cpt@ifn@xtcharacter \else \def\next{\endgroup\cpt@ifnextchar}% \fi \next{#1}{#2}{#3}% } \long\def\cpt@ifn@xtcharacter#1#2#3#4{% \escapechar92\relax \edef\x{\cpt@ifn@xtch@racter{#1}\cpt@ifn@xtch@racter{#4}}% \expandafter\endgroup\csname @\expandafter \ifx\x first\else second\fi oftwo\endcsname {#2}{#3}#4% } \long\def\cpt@ifn@xtch@racter#1{% \expandafter\cpt@ifn@xtch@r@cter\string#1\relax\noboundary{#1}% } \long\def\cpt@ifn@xtch@r@cter#1#2\noboundary#3{% \ifx\relax#2#1\else\noexpand#3\fi } \protected\def\cpt@starorlong#1{% \cpt@ifstar{\let\l@ngrel@x\relax#1}{\let\l@ngrel@x\long#1}% } \protected\def\cpt@ifstar#1{\ifnextcharTF*{\@firstoftwo{#1}}} \newcommand\cptswap[2]{#2#1} \newcommand\cptswapfirstbraced[2]{#2{#1}} \newcommand\cptswapsecondbraced[2]{{#2}#1} \cptswap{ }{\let\cptsptoken= } \def\@space{ } \@ifdefinable\ifsecondisnilTF\relax \def\ifsecondisnilTF#1#2\cpt@nil{\ifxTF#2\cpt@nnil} \newcommand\iflacus[1]{% \ifcat$\detokenize\expandafter{\@gobble#1.}$% \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi } \newcommand\aftercsname[2]{% \expandafter\cptswap\expandafter{\csname#2\endcsname}{#1}% } \newcommand\xaftercsname[2]{% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\cptswap \expandafter\expandafter\expandafter{\csname#2\endcsname}{#1}% } \newcommand\cptremovescape[1]{% \iflacus{#1}{}{\expandafter\@gobble\string#1}% } \newcommand\cptgobblescape[1]{% \iflacus{#1}{}{% \ifnum\escapechar>\@cclv\else \ifnum\escapechar<\z@pt\else \expandafter\expandafter \csname @gobble\ifnum\escapechar=\@xxxii @space\fi \cptthreexp\endcsname \fi \fi \string#1% }% } \@ifdefinable\defpass\relax \@ifdefinable\edefpass\relax \protected\def\defpass#1#2#{\afterassignment#1\long\def#1#2} \protected\def\edefpass#1#2#{\afterassignment#1\long\edef#1#2} \newcommand\usename[1]{\csname#1\endcsname}% long! \newcommand\usecsn[1]{% \ifcsname#1\endcsname\expandafter\@iden\else \expandafter\@gobble\fi{\usename{#1}}% } \newcommand\uselivecs[1]{% \ifdefTF{#1}{#1}{\cpt@notdeferr{#1}}% } \newcommand\uselivecsn[1]{% \ifcsndefTF{#1}{% \usename{#1}% }{% \let\relax\relax \cpt@err{Command '\@backslashchar#1' undefined}\@ehc }% } \@ifdefinable\usedefname{\let\usedefname\uselivecsn} \newcommand\ifxTF[2]{% \usename{@\ifx#1#2\@empty first\else second\fi oftwo}% } \newcommand\ifxFT[2]{\ifxTF{#1}{#2}\@secondoftwo\@firstoftwo} \newcommand\ifcsemptyTF[1]{\ifxTF#1\@empty} \newcommand*\defifxTF[2]{% \begingroup \edef\cpt@tempa{\unexpanded{#1}}% \expandafter\endgroup\ifx#2\cpt@tempa \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi } \newcommand*\ifcondTF[1]{% \long\def\ifcondTF##1\fi##2##3{% \romannumeral##1#1\expandafter\@firstoftwo\else \expandafter\@secondoftwo\fi{0 ##2}{0 ##3}% }% } \ifcondTF{ } \long\def\ifcondFT#1\fi#2#3{\ifcondTF#1\fi{#3}{#2}} \newcommand*\ifcsnameTF[1]{% \iflacus{#1}\@secondoftwo{% \usename{@\ifcsname#1\endcsname first\else second\fi oftwo}% }% } \newcommand*\ifcsnameFT[1]{\ifcsnameTF{#1}\@secondoftwo\@firstoftwo} \newcommand*\ifnamedefTF[1]{% \ifcsnameTF{#1}{% \usename{@\expandafter\ifx\csname#1\endcsname\relax second\else first\fi oftwo}% }{% \@secondoftwo }% } \protected\def\cpt@notdefinable{% \@latex@error {Command '\@backslashchar\reserved@a' already exists}% {Command '\@backslashchar\reserved@a' already defined, \MsgBrk or name '\@backslashchar\@qend\reserved@a' illegal.} } \newcommand*\if@@definable[2]{% \edef\reserved@a{\cptremovescape{#1}}% \begingroup \ifnamedefTF\reserved@a{% \endgroup\cpt@notdefinable }{% \edef\reserved@b{\expandafter\@carcube\reserved@a xxx\@nil}% \ifx\reserved@b\@qend \toks@{\cpt@notdefinable}% \else \ifx\reserved@a\@qrelax \toks@{\cpt@notdefinable}% \else \toks@{#2}% \fi \fi \expandafter\endgroup\the\toks@ }% } \@ifdefinable\ifchoicefoundTF\relax \protected\def\ifchoicefoundTF\endgroup{% \expandafter\endgroup\ifcpt@choicefd \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi } \protected\def\cpt@oneoftwo#1\endgroup{% \let\@firstoftwo\relax \let\@secondoftwo\relax \cptpassexpanded{% \endgroup \ifcase#1\relax \ifboolTF{cpt@choicefd}\@firstoftwo\@secondoftwo \or \ifboolTF{cpt@choicefd}\@secondoftwo\@firstoftwo \else \cpt@err{Invalid number '#1'}\noexpand\@ehc \fi }% } \if@@definable\cpt@ifseeparameter\relax \protected\def\cpt@ifseeparameter#1#{% \xifinsetTF {\detokenize{macro parameter character}} {\meaning\@let@token}% } \newcommand*\cptnewbool[1]{% \expandafter\if@@definable\csname if#1\endcsname {\expandafter\newif\csname if#1\endcsname}% } \newcommand*\cptnewcount[1]{% \expandafter\if@@definable\csname#1\endcsname {\expandafter\newcount\csname#1\endcsname}% } \begingroup \uccode`\~=`\,% \uppercase{\endgroup \def\cptcommanormalize#1{% \unexpanded\expandafter{\romannumeral-`\q \cpt@activecomma,#1,~\cpt@nil}% }% \def\cpt@activecomma#1~#2\cpt@nil{% \iflacus{#2} {\cpt@spacecomma#1 ,\cpt@nil} {\cpt@activecomma#1,#2\cpt@nil}% }% } \def\cpt@spacecomma#1 ,#2\cpt@nil{% \iflacus{#2} {\cpt@commaspace#1, \cpt@nil} {\cpt@spacecomma#1,#2\cpt@nil}% } \def\cpt@commaspace#1, #2\cpt@nil{% \iflacus{#2} {\cpt@doublecomma#1,,\cpt@nil} {\cpt@commaspace#1,#2\cpt@nil}% } \def\cpt@doublecomma#1,,#2\cpt@nil{% \iflacus{#2} {\iflacus{#1}{}{\expandafter\noexpand\@gobble#1}} {\cpt@doublecomma#1,#2\cpt@nil}% } \newcommand*\cptexpandnext[1]{% \iflacus{#1}{% \cpt@undefined }{% \expandafter\iflacus\expandafter{\@gobble#1}{% \expandafter#1\expandafter }{% \cpt@undefined }% }% } \newcommand*\cpt@ppcmds[4]{% \ifcase0\ifnum#1=1 1 \else\ifnum#1=-1 1 \fi\fi \cpt@err{Invalid stack direction '#1'}\@ehc \fi \ifcondTF\ifnum#1=1\fi{% \edef\reserved@a##1##{##1\gdef\expandafter\noexpand \csname\cptremovescape#2@stack\endcsname}% \expandafter\expandafter\expandafter\reserved@a \csname\cptremovescape#2@stack\endcsname }{% \global\advance#4\@ne \begingroup \toks@{}\toks1{}\toks2{}% \def\cpt@tempa##1{\cptremovescape##1@\romannumeral#4\endcsname}% \def\do##1,{% \ifnot@nil{##1}{% \toks@\expandafter\expandafter\expandafter {\expandafter\the\expandafter\toks@\expandafter \let\csname\cpt@tempa{##1}##1}% \toks1\expandafter\expandafter\expandafter {\expandafter\the\expandafter\toks1\expandafter \let\expandafter##1\csname\cpt@tempa{##1}}% \toks2\expandafter\expandafter\expandafter {\expandafter\the\expandafter\toks2\expandafter \let\csname\cpt@tempa{##1}\cpt@undefined}% \do }% }% \edef\reserved@a{\cptcommanormalize{#3}}% \expandafter\do\reserved@a,\@nil,% \expandafter\xdef\csname\cptremovescape#2@stack\endcsname{% \the\toks1\relax\the\toks2\global\advance#4\m@one \@ifundefined{\cptremovescape#2@stack}{{}}{% {\unexpanded\expandafter\expandafter\expandafter {\csname\cptremovescape#2@stack\endcsname}}% }% }% \expandafter\endgroup\the\toks@ }% } \newcommand*\cpt@pushcmds[3]{\cpt@ppcmds\m@one#1{#2}#3} \newcommand*\cpt@popcmds[1]{\cpt@ppcmds1#1\relax\relax} \cptnewcount{cpt@csvdepth} \cptnewbool{loopbreak} \if@@definable\loopbreak{\let\loopbreak\loopbreaktrue} \newcommand*\cpt@commanil{\cpt@commanil} \newcommand*\docommalist{\cpt@ifstar\cpt@docommalist\cpt@doc@mmalist} \newcommand*\cpt@docommalist[1]{% \expandafter\cpt@doc@mmalist\expandafter{#1}% } \newcommand*\cpt@doc@mmalist[2]{% \cpt@pushcmds\docommalist{\ifloopbreak,\cpt@commaact}\cpt@csvdepth \def\cpt@commaact##1{#2}% \def\cpt@commado##1,{% \@nameuse{@\ifloopbreak first\else second\fi oftwo}{% \def\reserved@a####1\cpt@commanil,{}\reserved@a }{% \edef\reserved@a{\unexpanded\expandafter{\@gobble##1}}% \ifxTF\reserved@a\cpt@commanil{}{% \expandafter\cpt@commaact\expandafter{\reserved@a}\relax \cpt@commado.% }% }% }% \loopbreakfalse \edef\reserved@a{\cptcommanormalize{#1}}% \expandafter\cpt@commado\expandafter.\reserved@a,\cpt@commanil,% \cpt@popcmds\docommalist } \docommalist{st,pl,pm,cl}{\cptnewbool{cpt@#1}} \newcommand*\cpt@cmdsuffixcheck{\@iden} \AtEndOfPackage{\DefSuffixChecker\cpt@cmdsuffixcheck{*}{!}} \if@@definable\shelldef{% \protected\def\shelldef{% \cpt@cmdsuffixcheck{% \cpt@ifstar{\cpt@sttrue\cpt@shelldef} {\cpt@stfalse\cpt@shelldef}% }% }% } \protected\def\cpt@shelldef{% \ifnextcharTF !{\@firstoftwo{\cpt@cltrue\cpt@shelld@f}} {\cpt@clfalse\cpt@shelld@f}% } \protected\def\cpt@shelld@f#1{% \if\expandafter\@car\string#1x\@nil\@backslashchar\else \@latex@error{Token '\detokenize{#1}' not escaped}\@ehc \fi \if@@definable#1{% \ifcpt@cl\global\fi\ifcpt@st\else\long\fi \protected\def#1% }% } \shelldef*\cpt@notdeferr#1{% \@latex@error{Command '\detokenize{#1}' isn't defined} {I expected '\detokenize{#1}' to be defined.}% } \shelldef*\cpt@isdeferr#1{% \@latex@error{Command '\detokenize{#1}' is already defined} {I expected '\detokenize{#1}' to be undefined.}% } \shelldef*\cpt@notcserr#1{% \@latex@error{Token '\detokenize{#1}' not a macro \MsgBrk or is currently undefined} {I expected '\detokenize{#1}' to be defined.}% } \shelldef*\cpt@iscserr#1{% \@latex@error{Token '\detokenize{#1}' is a macro: \MsgBrk not currently undefined} {I didn't expect '\detokenize{#1}' to be defined.}% } \shelldef*\cpt@notescapederr#1{% \@latex@error{Token '\detokenize{#1}' not escaped \MsgBrk or is an active character}{I expected the first token of\MsgBrk'\detokenize{#1}' to be escape character.}% } \shelldef*\cpt@isescapederr#1{% \@latex@error{Token '\detokenize{#1}' is escaped}{% I didn't expect the first character of '\detokenize{#1}' \MsgBrk to be the escape character.}% } \shelldef*\cpt@notbracederr#1{% \@latex@error{Token '\detokenize{#1}' isn't braced} {I expected '\detokenize{#1}' to be braced.}% } \shelldef*\cpt@isbracederr#1{% \@latex@error{Token '\detokenize{#1}' is braced} {I didn't expect '\detokenize{#1}' to be braced.}% } \shelldef*\cpt@notonetokenerr#1{% \@latex@error{'\detokenize{#1}' is not one token} {I expected '\detokenize{#1}' to be one token.}% } \shelldef*\cpt@isonetokenerr#1{% \@latex@error{'\detokenize{#1}' is one token} {I didn't expect '\detokenize{#1}' to be one token.}% } \shelldef*\cpt@notblankerr#1{% \@latex@error{'\detokenize{#1}' is not blank or empty} {I expected '\detokenize{#1}' to be blank.}% } \shelldef*\cpt@isblankerr#1{% \@latex@error {Blank/empty token for command '\detokenize{#1}'} {I didn't expect a blank argument/token here.}% } \shelldef*\cpt@notexpandableerr#1{% \@latex@error{'\detokenize{#1}' is not expandable \MsgBrk or is undefined} {I expected '\detokenize{#1}' to be expandable.}% } \shelldef*\cpt@toodeep#1#2{% \@latex@error{Command '\detokenize{#1}' nested too deeply} {Command '\detokenize{#1}' nested beyond level '#2'.}% } \begingroup \catcode`\&=7 \protected\gdef\cpt@getmacroprefix#1{% \begingroup \edef\cpt@tempa##1{\def##1####1\detokenize{macro}:####2&}% \cpt@tempa\@ifmacro{% \def\macroprefix{##1}% \usename{@\ifblankTF{##2}{second}{first}oftwo}% }% \edef\cpt@tempb##1{##1\detokenize{macro}:&}% \cpt@tempb{\expandafter\@ifmacro\meaning#1}{% \@testtrue }{% \@testfalse\def\macroprefix{}% }% \cpteveryscan \cptpassexpanded{% \endgroup \ifxTF\macroprefix\@empty{\@iden}{\noexpand\scantokens}% {\def\noexpand\macroprefix{\macroprefix}\relax}% }% } \gdef\cpt@getprefix#1>#2&{#1} \protected\gdef\ifprotectedTF#1{% \begingroup \edef\cpt@tempa##1{\def##1####1\string\protected####2&}% \cpt@tempa\cpt@tempa{% \aftercsname\endgroup{@\ifblankTF{##2}{second}{first}oftwo}% }% \edef\cpt@tempb##1{% ##1\expandafter\cpt@getprefix\meaning#1&\string\protected&% }% \cpt@tempb\cpt@tempa } \endgroup \shelldef*\shelllet#1{\cpt@ifeql{\cpt@shelllet{#1}}{\cpt@shelllet{#1}}} \shelldef*\cpt@shelllet#1#2{% \iflacus{#2}{% \cpt@isblankerr\shelllet }{% \expandafter\iflacus\expandafter{\@gobble#2}{% \ifcsdefinable#1{% \ifprotectedTF#2{\let#1=#2}{% \ifcsndefinable{shell@\cptremovescape#1}{% \letcsntocs{shell@\cptremovescape#1}=#2% \protected\edef#1{\cptmakecs{shell@\cptremovescape#1}}% }% }% }% }{% \cpt@notonetokenerr{#2}% }% }% } \shelldef\showruntime#1\runtime{% \pdfresettimer#1% \message{Run time: \the\pdfelapsedtime}% } \newcommand*\ifdocstartedTF{% \ifdefTF\cpt@docstarted\@firstoftwo\@secondoftwo } \shelldef*\UseNormalCatcodes{% \ifdocstartedTF{% \cpt@err{\noexpand\UseNormalCatcodes is a preamble command}\@ehc }{}% \xdef\@pushfilename{% \gletcs\UseNormalCatcodes\UseNorm@lCatcodes \expandcsonce\@pushfilename }% \let\UseNormalCatcodes\relax \cptpushcatcodes \cptnormalcatcodes \ifxTF\@currname\@empty{% \BeforeStartOfDocument{% \cptpopcatcodes }% }{% \AfterEndOfStyleFile{% \cptpopcatcodes }% }% } \if@@definable\UseNorm@lCatcodes{% \global\let\UseNorm@lCatcodes\UseNormalCatcodes } \newcommand*\newcomment{% \begingroup \def\comment@envir{newcomment}% \def\do##1{\catcode`##1=12\relax}% \dospecials \endlinechar`\^^M\catcode`\^^M=12\relax \cpt@commentloop } \newcommand*\cpt@commentend{% \ifx\@currenvir\comment@envir \let\endnewcomment\relax \def\next{\endgroup\end{newcomment}}% \else \let\next\endgroup \fi \next } \begingroup \catcode`\^^M=12 % \endlinechar\m@one% \gdef\cpt@commentloop#1^^M{% \def\comment@stuff{#1}% \ifx\comment@stuff\endnewcomment \let\next\cpt@commentend \else \ifx\comment@stuff\end@newcomment \let\next\cpt@commentend \else \ifx\comment@stuff\end@comment \def\next{\@latex@error {Bad end for \string\newcomment}\@ehc}% \else \let\next\cpt@commentloop \fi \fi \fi \next } \endgroup \begingroup \catcode`\{=12 \catcode`\}=12 \catcode`\!=0 \catcode`\[=1 \catcode`\]=2 \catcode`\\=12 !gdef!end@newcomm@nt[\endnewcomment] !gdef!end@newcomment[\end{newcomment}] !gdef!end@comment[\end{comment}] !endgroup \long\def\@gobblethree#1#2#3{} \long\def\@firstofthree#1#2#3{#1} \long\def\@secondofthree#1#2#3{#2} \long\def\@thirdofthree#1#2#3{#3} \let\@iden\@firstofone \newcommand\cptalloftwo[2]{#1#2} \if@@definable\cpt@nil{\let\cpt@nil\relax} \def\cpt@nnil{\cpt@nil} \newcommand*\cptrmstop{0 } \if@@definable\cptrm{\let\cptrm\romannumeral} \long\def\cpt@car#1#2\car@nil{#1} \long\def\cpt@cdr#1#2\cdr@nil{#2} \if@@definable\cpt@relax{\let\cpt@relax\relax} \if@@definable\gobble@to@relax\relax \long\def\gobble@to@relax#1\cpt@relax{} \def\cpt@defrelax\fi{% \fi\defpass\cpt@relax##1\cpt@relax{\endgroup}% } \long\def\remove@to@nnil#1\@nnil{} \long\def\catch@to@nnil#1\@nnil{#1} \long\def\remove@to@dot#1.{} \long\def\catch@to@dot#1.{#1} \long\def\remove@to@space#1 {} \@namedef{@gobblespace} {} \protected\def\ifnot@nil#1{% \edef\reserved@a{\unexpanded{#1}}% \ifxTF\reserved@a\@nnil\@gobble\@iden } \newcommand*\ifsentinelTF[1]{% \edef\reserved@a{\unexpanded{#1}}% \ifxTF\reserved@a\currsentinel } \if@@definable\csvbreak{\let\csvbreak\relax} \newcommand*\cpt@csvbreak{\csvbreak} \if@@definable\csvpause{\let\csvpause=\relax} \newcommand*\cpt@csvpause{\csvpause} \if@@definable\tsvbreak{\let\tsvbreak\relax} \newcommand*\cpt@tsvbreak{\tsvbreak} \newcommand*\ifcsvbreakTF[1]{% \edef\reserved@a{\unexpanded{#1}}% \ifxTF\reserved@a\cpt@csvbreak } \if@@definable\cptdoremainder{\let\cptdoremainder\@gobble} \shelldef*\gobble@to@sentinel#1#2{% \defpass\reserved@a##1#1#2{\cptdoremainder{##1}}% } \newcommand*\cptthreexp{\expandafter\expandafter\expandafter} \newcommand*\cptsevenxp{% \expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\expandafter } \shelldef\cptlocalxp#1{\begingroup\cptthreexp\endgroup#1} \newcommand*\cptzapspaces[1]{% \def\cptzapspaces##1{\romannumeral\cpt@zapspaces.##1#1\zap@nil}% } \cptzapspaces{ } \long\def\cpt@zapspaces#1 #2\zap@nil{% \iflacus{#2}{% \expandafter\cptrmstop\@gobble#1% }{% \expandafter\cpt@zapspaces\expandafter.\@gobble#1#2\zap@nil }% } \newcommand*\cptsupergobble[1]{% \romannumeral-`\q\expandafter\@gobble\romannumeral-`\q \expandafter\cpt@supergobble \romannumeral\the\numexpr#1000{m\endcsname}% } \newcommand*\cpt@supergobble[1]{% \csname cpt@superg@bble#1\cpt@supergobble } \newcommand\cpt@superg@bblem[1]{\endcsname} \newcommand*\cptdotimes[1]{% \ifblankTF{#1}{% \ifboolTF{cpt@useempty}{\cpt@dotimes{m}}\@gobble }{% \expandafter\cpt@dotimes\expandafter {\romannumeral\number#1000}% }% } \newcommand*\cpt@dotimes[2]{% \ifnullTF{#1}{}{% #2\relax \expandafter\ifnullTF\expandafter{\@gobble#1}{}{% \expandafter\cpt@dotimes\expandafter{\@gobble#1}{#2}% }% }% } \newcommand*\cptexpandtimes[1]{% \expandafter\cpt@expandtimes\expandafter {\romannumeral\number#1000}% } \newcommand*\cpt@expandtimes[2]{% \ifnullTF{#1}{% \unexpanded{#2}% }{% \expandafter\ifnullTF\expandafter{\@gobble#1}{% \unexpanded\expandafter{#2}% }{% \expandafter\cptswapfirstbraced\expandafter{#2}% {\expandafter\cpt@expandtimes\expandafter{\@gobble#1}}% }% }% } \newcommand*\normal@reverse[1]{\cpt@normalreverse{}#1\@nnil} \long\def\cpt@normalreverse#1#2{% \ifxTF#2\@nnil{% \ifboolTF{@test}\@iden\unexpanded{#1}% }{% \cpt@normalreverse{#2#1}% }% } \newcommand*\robust@reverse[1]{\cpt@robustreverse{}.#1\@nnil} \long\def\cpt@robustreverse#1#2\@nnil{% \cpt@r@bustreverse{#1}% {\simpleexpandarg\ifbracedTF{\@gobble#2}}#2\@nnil } \long\def\cpt@r@bustreverse#1#2.#3{% \ifxTF#3\@nnil{% \ifboolTF{@test}\@iden\unexpanded{#1}% }{% #2{\cpt@robustreverse{{#3}#1}}{\cpt@robustreverse{#3#1}}.% }% } \newcommand*\ifstrcmpTF[2]{% \usename{@\ifnum\pdfstrcmp{\detokenize{#1}}% {\detokenize{#2}}=0first\else second\fi oftwo}% } \shelldef*\ifcommandsdefinable#1{% \@testopt{\cpt@ifcmdsdefinable#1}\relax } \def\cpt@ifcmdsdefinable#1[#2]{% \begingroup \edef\reserved@a{\cptcommanormalize{#1}}% \@tempswafalse \def\do##1,{% \ifnot@nil{##1}{% \if\expandafter\@car\string##1x\@nil\@backslashchar \@tempswafalse \if@@definable##1\@tempswatrue \else \cpt@notescapederr{##1}% \fi \usename{@\if@tempswa first\else second\fi oftwo}% \do{\gobble@to@sentinel\@nil,}% }% }% \expandafter\do\reserved@a,\@nil,% \ifcondTF\if@tempswa\fi{\endgroup#2}\endgroup } \ifcommandsdefinable{\cpttrimspace,\cpttrimspaces}\relax \long\def\cpttrimspaces#1{\cpt@trimspaces@a\relax{#1}} \long\def\cpt@trimspaces@strcmp#1#2{% \csname @\ifnum\pdfstrcmp{\detokenize{#1}}% {\detokenize{#2}}=0first\else second\fi oftwo\endcsname } \begingroup \catcode`\&=7\catcode`\$=7 \long\gdef\cpt@trimspaces@a#1#2{\cpt@trimspaces@b.#1$.#2& &} \long\gdef\cpt@trimspaces@b#1$#2 &{\cpt@trimspaces@c#1$#2&} \long\gdef\cpt@trimspaces@c#1$#2{% \cpt@trimspaces@d\cpt@trimspaces@strcmp{#2}{#1}{% \unexpanded\expandafter{\@gobble#1}% }{% \cpt@trimspaces@d\cpt@trimspaces@a{#2}{#2}% }% } \long\gdef\cpt@trimspaces@d#1#2{% \expandafter\cpt@trimspaces@e\expandafter#1\expandafter{% \unexpanded\expandafter {\romannumeral-`\q\expandafter\noexpand\@gobble#2}% }% } \long\gdef\cpt@trimspaces@e#1#2#3{% \expandafter#1\expandafter{\@gobble#3}{#2}% } \long\gdef\cpttrimspace#1{\cpt@trimspace@a.#1& &} \long\gdef\cpt@trimspace@a#1 &{\cpt@trimspace@b#1&} \long\gdef\cpt@trimspace@b#1{% \unexpanded\expandafter {\romannumeral-`\q\expandafter\noexpand\@gobble#1}% } \endgroup \shelldef\trim@@spaces#1#2{\edef#2{\cpttrimspaces{#1}}} \shelldef\trim@@space#1#2{\edef#2{\cpttrimspace{#1}}} \shelldef*\despacecontent#1{% \edef#1{\simpleexpandarg\cpttrimspaces{#1}}% } \shelldef*\cptdespacecsvlist{\cpt@teststopt\cpt@despacecsvlist,} \shelldef*\cpt@despacecsvlist[#1]#2{% \cpt@stchoose{cpt@st}{#2}\cpt@tempa\cpt@despacecsvlist \ifcsnullTF\cpt@tempa{}{% \def\cpt@rsvda{}% \UseEmptyEntry \def\csv@do##1{% \edef\cpt@tempa{\cpttrimspaces{##1}}% \cptaddtolist[#1]\cpt@rsvda\cpt@tempa }% \csv@@loop*[#1]\cpt@tempa \ifdefboolFT{cpt@st}{}{\let#2=\cpt@rsvda}% }% } \shelldef*\newvariables#1{\@testopt{\cpt@newvariables{#1}}{}} \if@@definable\newvariable{\let\newvariable\newvariables} \shelldef*\cpt@newvariables#1[#2]#3{% \@testopt{\cpt@newv@riables{#1}{#2}{#3}}{}% } \shelldef*\cpt@newv@riables#1#2#3[#4]{% \def\cpt@rsvda##1{% \iflacus{#4}{\def\cpt@tempc{##1}}{\def\cpt@tempc{#4}}% }% \edef\cpt@tempb{\ifstrcmpTF{#1}{if}{if}{}}% \docommalist{#3}{% \iflacus{##1}\gobble@to@relax\relax \ifnamedefTF{\cpt@tempb#2##1}{% \edef\reserved@a{\cpt@tempb#2##1}% \ifstrcmpTF{#1}{tog}{}{\cpt@notdefinable}% }{% \ifstrcmpTF{#1}{tog}{% \@tempswatrue \ifnamedefTF{cpt@tog@#2##1}{% \cpt@err{Toggle '#2##1' already defined}\@ehc }{% \lowercase{% \ifstrcmpTF{#4}{true}{% \let\cpt@togstate\@firstoftwo }{% \ifstrcmpTF{#4}{false}{% \let\cpt@togstate\@secondoftwo }{% \iflacus{#4}{% \let\cpt@togstate\@secondoftwo }{% \@latex@error{Invalid toggle value '#4'}\@ehc }% }% }% }% \expandafter\let\csname cpt@tog@#2##1\endcsname\cpt@togstate }% }{% \@tempswatrue \ifstrcmpTF{#1}{switch}{% \lowercase{% \ifstrcmpTF{#4}{true}{% \def\reserved@a{00}% }{% \ifstrcmpTF{#4}{false}{% \def\reserved@a{01}% }{% \iflacus{#4}{% \def\reserved@a{01}% }{% \@latex@error{Invalid switch value '#4'}\@ehc }% }% }% }% \expandafter\let\csname#2##1\endcsname\reserved@a }{% \@tempswafalse \csname new#1\expandafter\endcsname\csname \cpt@tempb#2##1\endcsname \ifstrcmpTF{#1}{if}{% \cpt@rsvda{false}% \csname#2##1\cpt@tempc\endcsname }{% \ifstrcmpTF{#1}{toks}{% \cpt@rsvda{}% \csname#2##1\endcsname\expandafter{\cpt@tempc}% }{% % It is dangerous to initialize boxes. % Horizontal and vertical boxes aren't compatible: \ifstrcmpTF{#1}{box}{}{% \ifstrcmpTF{#1}{count}{% \cpt@rsvda\z@pt \csname#2##1\endcsname\cpt@tempc\relax }{% \ifstrcmpTF{#1}{dimen}{% \cpt@rsvda\z@pt \csname#2##1\endcsname\cpt@tempc\relax }{% \ifstrcmpTF{#1}{skip}{% \cpt@rsvda{\z@pt plus \z@pt minus \z@pt}% \csname#2##1\endcsname\cpt@tempc\relax }{% \ifstrcmpTF{#1}{write}{}{% \cpt@newvarerr{#1}% }% }% }% }% }% }% }% }% }% }% \cpt@relax }% } \def\cpt@newvarerr#1{% \if@tempswa\else \begingroup \def\x##1{Maybe you meant '##1'.}% \cpt@err{Unknown variable type '#1'}{% \ifstrcmpTF{#1}{dim}{\x{dimen}}{% \ifstrcmpTF{#1}{token}{\x{toks}}{% \ifstrcmpTF{#1}{tok}{\x{toks}}{% \ifstrcmpTF{#1}{toggle}{\x{tog}}{% \ifstrcmpTF{#1}{sw}{\x{switch}}{% No variable of type '#1'. }% }% }% }% }% }% \endgroup \fi } \newvariables{if}[cpt@]{verbose,usepox,optfd,% igopt,inpox,olddx,in,check,choicefd,useempty,swa% }[false] \newvariables{tog}{biboolopts}[false] \newvariables{count}[cpt@]{optdepth,grouplevel,grouptype,cnta}[\z@pt] \newcommand*\UseEmptyEntry{\global\cpt@useemptytrue} \newcommand*\DiscardEmptyEntry{\global\cpt@useemptyfalse} \newcommand*\cptgetcatcode[1]{% \number \ifcat\noexpand#1\bgroup1\else \ifcat\noexpand#1\egroup2\else \ifcat\noexpand#1$3\else %$ \ifcat\noexpand#1&4\else \ifcat\noexpand#1##6\else \ifcat\noexpand#1^7\else \ifcat\noexpand#1_8\else \ifcat\noexpand#1\@sptoken10\else \ifcat\noexpand#1a11\else \ifcat\noexpand#1!12\else \ifcat\noexpand#1\noexpand~13\else -1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi } \newcommand*\cptcountspacesincs{% \begingroup \catcode\endlinechar=12 \cpt@countspacesincs } \def\cpt@countspacesincs#1{% \lccode`\ `\^^S\relax \catcode\endlinechar=9 \scantokens{\cpt@c@untspacesincs{#1}{ignoring}}% \catcode\endlinechar=10 \scantokens{\cpt@c@untspacesincs{#1}{counting}}% \endgroup } \def\cpt@c@untspacesincs#1#2{% \@tempcnta\z@pt \toks@{##1}% \lowercase{% \toks1\expandafter{\detokenize{ }}% \expandafter\def\expandafter\cpt@tempa\the \expandafter\toks@\the\toks1##2\@nil{% \ifblankTF{##2}{}{% \advance\@tempcnta\@ne \cpt@tempa##2\@nil }% }% \expandafter\cpt@tempa\detokenize{#1 }\@nil }% \typeout{^^J\unexpanded{#1}}% \typeout{Number of spaces, #2 end-of-line characters: \the\@tempcnta.}% } \newcommand\ifnullTF[1]{% \usename{@\ifnum\pdfstrcmp{}{\detokenize{#1}}% =\z@pt first\else second\fi oftwo}% } \newcommand\ifnullFT[1]{\ifnullTF{#1}\@secondoftwo\@firstoftwo} \newcommand\oifnullTF[1]{\expandafter\ifnullTF\expandafter{#1}} \newcommand\oifnullFT[1]{\expandafter\ifnullFT\expandafter{#1}} \newcommand\xifnullTF[1]{\cptexpandarg\ifnullTF{#1}} \newcommand\xifnullFT[1]{\cptexpandarg\ifnullFT{#1}} \newcommand\ifblankTF[1]{% \usename{@\ifnum\pdfstrcmp{}{\detokenize\expandafter {\@gobble#1.}}=\z@pt first\else second\fi oftwo}% } \newcommand\ifblankFT[1]{\ifblankTF{#1}\@secondoftwo\@firstoftwo} \newcommand\oifblankTF[1]{\expandafter\ifblankTF\expandafter{#1}} \newcommand\oifblankFT[1]{\expandafter\ifblankFT\expandafter{#1}} \newcommand\xifblankTF[1]{% \usename{@\ifnum\pdfstrcmp{}{\@gobble#1.}=\z@pt first\else second\fi oftwo}% } \newcommand\xifblankFT[1]{\xifblankTF{#1}\@secondoftwo\@firstoftwo} \newcommand*\ifdefTF[1]{% \ifblankTF{#1}\@secondoftwo{% \usename{@\ifx#1\cpt@undefined second\else \ifx#1\relax second\else first\fi\fi oftwo}% }% } \newcommand*\ifdefFT[1]{\ifdefTF{#1}\@secondoftwo\@firstoftwo} \newcommand*\oifdefTF[1]{\expandafter\ifdefTF\expandafter{#1}} \newcommand*\oifdefFT[1]{\expandafter\ifdefFT\expandafter{#1}} \newcommand*\xifdefTF[1]{\cptexpandarg\ifdefTF{#1}} \newcommand*\xifdefFT[1]{\cptexpandarg\ifdefFT{#1}} \newcommand*\ifcsndefTF[1]{% \ifblankTF{#1}\@gobble{% \ifcsname#1\endcsname \expandafter\@firstofone \else \cptthreexp\@secondoftwo\expandafter\@gobble \fi }{% \aftercsname\ifdefTF{#1}% }% } \newcommand*\ifcsndefFT[1]{\ifcsndefTF{#1}\@secondoftwo\@firstoftwo} \newcommand*\oifcsndefTF[1]{\expandafter\ifcsndefTF\expandafter{#1}} \newcommand*\oifcsndefFT[1]{\expandafter\ifcsndefFT\expandafter{#1}} \newcommand*\xifcsndefTF[1]{\cptexpandarg\ifcsndefTF{#1}} \newcommand*\xifcsndefFT[1]{\cptexpandarg\ifcsndefFT{#1}} \shelldef*\ifcsdefinable#1#2{% \ifblankTF{#1}{% \cpt@isblankerr\ifcsdefinable }{% \edef\reserved@a{\cptgobblescape#1}% \ifdefTF{#1}\cpt@notdefinable{% \ifcsndefTF{end\reserved@a}\cpt@notdefinable{#2}% }% }% } \ifcsdefinable\@ifcsdefinable{\let\@ifcsdefinable\ifcsdefinable} \shelldef\rc@ifcsdefinable#1#2{\let\ifcsdefinable\@ifcsdefinable#2} \shelldef*\ifcsndefinable#1{\cptlocalxp\aftercsname\ifcsdefinable{#1}} \shelldef*\ifdefinableTF#1{% \ifblankTF{#1}{% \cpt@isblankerr\ifdefinableTF \@secondoftwo }{% \ifdefTF{#1}\@secondoftwo{% \ifcsndefTF{end\cptgobblescape#1}\@secondoftwo\@firstoftwo }% }% } \shelldef\cpt@def@#1#2#3{% \ifcsdefinable#3{% \ifnullTF{#2}{}\protected \cptthreexp\l@ngrel@x\usename{#1def}#3% }% } \ifcsdefinable\robust@def\relax \shelldef\robust@def{\cpt@starorlong{\cpt@def@{}{p}}} \robust@def*\new@def{\cpt@starorlong{\cpt@def@{}{}}} \robust@def*\new@gdef{\cpt@starorlong{\cpt@def@{g}{}}} \robust@def*\robust@gdef{\cpt@starorlong{\cpt@def@{g}{p}}} \robust@def*\new@edef{\cpt@starorlong{\cpt@def@{e}{}}} \robust@def*\robust@edef{\cpt@starorlong{\cpt@def@{e}{p}}} \robust@def*\new@xdef{\cpt@starorlong{\cpt@def@{x}{}}} \robust@def*\robust@xdef{\cpt@starorlong{\cpt@def@{x}{p}}} \robust@def*\renew@def{\cpt@starorlong{\cpt@redef@{}}} \robust@def*\robust@redef{\cpt@starorlong{\cpt@redef@{p}}} \new@def*\cpt@redef@#1#2{% \ifdefFT#2{}{% \ifcpt@verbose \@latex@info{Command '\string#2' redefined}% \fi }% \ifstrcmpTF{#1}{p}\protected\relax\l@ngrel@x\def#2% } \robust@def*\provide@def{% \cpt@cmdsuffixcheck{% \cpt@testst{\cpt@testcl{\cpt@providedef\relax}}% }% } \robust@def*\providerobust@def{% \cpt@cmdsuffixcheck{% \cpt@testst{\cpt@testcl{\cpt@providedef\protected}}% }% } \new@def\cpt@providedef#1#2{% \ifescapedTF{#2}{}{\cpt@notescapederr{#2}}% \ifdefTF#2{% \ifcpt@verbose \cpt@info{Command '\string#2' already defined: \MsgBrk not redefined}% \fi \def\reserved@a{\undefcs\reserved@b}% }{% \def\reserved@a{% \ifcpt@cl\global\fi\let#2\reserved@b \undefcs\reserved@b }% }% \afterassignment\reserved@a \ifcpt@st\else\long\fi #1\def\reserved@b } \robust@def*\ltx@warn{\@latex@warning@no@line} \robust@def*\ltx@info{\@latex@info@no@line} \robust@def*\ltx@err{\@latex@error} \robust@def\cpt@testopt#1#2{\ifnextcharTF[{#1}{#1[{#2}]}} \robust@def*\cpt@ifbrack#1#2{\ifnextcharTF[{#1}{#2}} \new@def*\cpt@xtestopt#1#2#3{% \cpt@xifbrack#1\\[\\{#2#1}{#2[{#3}]{#1}}% } \new@def*\cpt@xifbrack#1[#2\\#3#{% \usename{@\ifblankTF{#1#2}{first}{second}oftwo}% } \robust@def\cpt@testpnopt#1#2{\ifnextcharTF({#1}{#1({#2})}} \robust@def\cpt@testltopt#1#2{\ifnextcharTF<{#1}{#1<{#2}>}} \robust@def\cpt@ifplus#1{\ifnextcharTF+{\@firstoftwo{#1}}} \robust@def\cpt@ifclam#1{\ifnextcharTF!{\@firstoftwo{#1}}} \robust@def\cpt@ifprime#1{\ifnextcharTF'{\@firstoftwo{#1}}} \robust@def\cpt@ifeql#1{\ifnextcharTF={\@firstoftwo{#1}}} \robust@def\cpt@testst#1{\cpt@ifstar{\cpt@sttrue#1}{\cpt@stfalse#1}} \robust@def\cpt@testpl#1{\cpt@ifplus{\cpt@pltrue#1}{\cpt@plfalse#1}} \robust@def\cpt@testpm#1{\cpt@ifprime{\cpt@pmtrue#1}{\cpt@pmfalse#1}} \robust@def\cpt@testcl#1{\cpt@ifclam{\cpt@cltrue#1}{\cpt@clfalse#1}} \robust@def\cpt@teststpl#1{\cpt@testst{\cpt@testpl{#1}}} \robust@def\cpt@teststpm#1{\cpt@testst{\cpt@testpm{#1}}} \robust@def\cpt@teststopt#1#2{\cpt@testst{\cpt@testopt{#1}{#2}}} \robust@def*\cptmaybedef{\cpt@teststpm\cpt@maybedef} \robust@def*\cpt@maybedef#1{% \ifboolTF{cpt@st}\@firstoftwo{% \ifboolTF{cpt@pm}\@firstoftwo\@secondoftwo }{% \@gobble }{% \new@def#1% }% } \robust@def*\newletcs#1{% \begingroup \def\cpt@tempa{\relax}% \cpt@ifeql{\cpt@newletcs{#1}}{\cpt@newletcs{#1}}% } \robust@def*\gnewletcs#1{% \begingroup \def\cpt@tempa{\global}% \cpt@ifeql{\cpt@newletcs{#1}}{\cpt@newletcs{#1}}% } \robust@def*\cpt@newletcs#1{% \ifcsdefinable{#1}{% \expandafter\endgroup\cpt@tempa\let#1= % }% } \robust@def*\gletcs{\global\let} \robust@def*\fulllet{\@testtrue\cpt@fulllet} \robust@def*\fullnewlet{\@testfalse\cpt@fulllet} \robust@def*\cpt@fulllet#1#2{% \trim@@space{#1}\cpt@tempa \trim@@space{#2}\cpt@tempb \cpt@fullleterr\cpt@tempa\cpt@tempb \csname\if@test let\else newletcs\fi \cptthreexp\endcsname\expandafter\cpt@tempa\cpt@tempb \oifdefFT\cpt@tempb{}{% \ifcsndefTF{\expandafter\string\cpt@tempb}{% \letcsntocsn{\expandafter\string\cpt@tempa} {\expandafter\string\cpt@tempb}% }{% \ifcsndefFT{\expandafter\cptgobblescape\cpt@tempb\@space}{}{% \letcsntocsn{\expandafter\cptgobblescape\cpt@tempa\@space} {\expandafter\cptgobblescape\cpt@tempb\@space}% \ifcsndefFT{\expandafter\string\cpt@tempb\@space}{}{% \letcsntocsn{\expandafter\string\cpt@tempa\@space} {\expandafter\string\cpt@tempb\@space}% }% }% }% }% } \new@def*\cpt@fullleterr#1#2{% \simpleexpandarg\ifsingletokenTF{#1}{% \simpleexpandarg\ifsingletokenTF{#2}{}{% \cpt@notonetokenerr{#2}% }% }{% \cpt@notonetokenerr{#1}% }% } \robust@def*\cptletcsset#1#2{% \docommalist{#1}{% \oifblankTF{\@gobble##1}{}{\fulllet##1#2}% }% } \begingroup \catcode`\&=7 \new@gdef*\ifcounterTF#1{% \ifstrcmpTF\count{#1}\@secondoftwo{% \expandafter\cpt@ifcounter@a\meaning#1:&% }% } \edef\cpt@ifcounter@a#1#2{% \gdef#1##1:##2&{#2##1\string\count&}% \gdef#2##1\string\count##2&{\noexpand\ifblankTF{##1}}% } \cpt@ifcounter@a\cpt@ifcounter@a\cpt@ifcounter@b \new@gdef*\ifdimenTF#1{% \ifstrcmpTF\dimen{#1}\@secondoftwo{% \expandafter\cpt@ifdimen@a\meaning#1:&% }% } \edef\cpt@ifdimen@a#1#2{% \gdef#1##1:##2&{#2##1\string\dimen&}% \gdef#2##1\string\dimen##2&{\noexpand\ifblankTF{##1}}% } \cpt@ifdimen@a\cpt@ifdimen@a\cpt@ifdimen@b \endgroup \robust@def*\pushnumber#1{% \ifsingletokenTF{#1}{% \ifdefTF{#1}{% \ifcounterTF#1{% \global\advance#1\@ne }{% \xdef#1{\the\numexpr#1+1}% }% }{% \chardef#1=\@ne }% }{% \cpt@notonetokenerr{#1}% }% } \robust@def*\popnumber#1{% \ifsingletokenTF{#1}{% \ifdefTF{#1}{% \ifnumcmpTF#1=\z@pt{% \cpt@err{Counter or number '\string#1' is already 0}\@ehc }{% \ifcounterTF#1{% \global\advance#1\m@one }{% \xdef#1{\the\numexpr#1-1}% }% }% }{% \cpt@err{Counter or number '\string#1' is undefined}\@ehc }% }{% \cpt@notonetokenerr{#1}% }% } \robust@def*\pushfunctions#1#2#3{% \pushnumber{#3}% \begingroup \edef\cpt@stack{\cptremovescape{#1}@stack}% \ifcsndefTF\cpt@stack{}{\csn@gdef\cpt@stack{}}% \toks@{}\toks1{}\escapechar92\relax \let\xp\expandcsonce \def\push@do##1{% \ifescapedTF{##1}{}{\cpt@notescapederr{##1}}% \edef\cpt@tempa{\noexpandcsn{\cptremovescape{##1}@\cptrm#3}}% \cptpassexpanded{% \toks@{\the\toks@\let\xp\cpt@tempa\noexpand##1}% \toks1{\the\toks1\let\noexpand##1\xp\cpt@tempa \undefcs\xp\cpt@tempa}% }% }% \cptpushparse{#2}% \csn@xdef\cpt@stack{\the\toks1\cpt@nil{\expandcsnonce\cpt@stack}}% \expandafter\endgroup\the\toks@ } \robust@def*\cptpushparse#1{% \edef\reserved@a{\cptcommanormalize{#1}}% \expandafter\cpt@pushparse\reserved@a,\@nil,% } \robust@def*\cpt@pushparse#1,{% \ifnot@nil{#1}{\push@do{#1}\relax\cpt@pushparse}% } \robust@def*\popfunctions#1#2{% \ifdefTF{#2}{% \ifnum#2=\z@pt \cpt@err{Number '\string#2' is currently '0'}\@ehc \fi }{% \cpt@err{Can't pop functions with unknown \MsgBrk number \string#2}\@ehc }% \edef\cpt@stack{\cptremovescape{#1}@stack}% \ifcsndefTF\cpt@stack{% \edef\reserved@a{\expandcsnonce\cpt@stack}% \def\reserved@b##1\cpt@nil{##1\csn@gdef\cpt@stack}% \expandafter\reserved@b\reserved@a }{% \cpt@err{Unknown stack for function \string#1}\@ehc \@gobble }% \popnumber{#2}% } \chardef\cpt@optionstacklimit=4 \robust@def*\cpt@pushstate#1#2#3{% \ifnum#3>\cpt@optionstacklimit\relax \let\x\cpt@optionstacklimit \@latex@error{Current option/key state is being pushed \MsgBrk beyond level '\x'. I suspect infinite \MsgBrk re-entrance. If this isn't the case, please \MsgBrk set package option 'option-stack-limit' or 'key-stack-limit' to the required value in \MsgBrk\noexpand\documentclass }\@ehc \fi \expandafter\pushfunctions\expandafter#1\expandafter{#2}{#3}% } \robust@def*\cpt@popstate#1#2{\popfunctions{#1}{#2}} \robust@def*\cpt@stchoose#1#2#3#4{% \ifboolTF{#1}{% \ifmacroTF{#2}{% \let#3=#2% }{% \cpt@err{Bad arguments to macro '\detokenize{#4}'. \MsgBrk Token '\detokenize{#2}' not a macro \MsgBrk but '\@backslashchar if#1' is true}\@ehc }% }{% \edef#3{\unexpanded{#2}}% }% } \robust@def*\cpt@delimitcs#1#2{% \begingroup \def\cpt@tempb##1{% \edef\cpt@tempa####1{% \def####1########1\detokenize{macro:}########2% ->########3\cpt@nil{% ########1\def\string\cpt@tempa########2% \ifblankTF{##1}{}{\string##1}{########3}% }% \edef####1{####1\meaning#1\cpt@nil}% }% \cpt@tempa\cpt@tempa }% \cpt@tempb{}% \cpteveryscan \scantokens\expandafter{\cpt@tempa}\relax \ifxTF#1\cpt@tempa{% \cpt@tempb{#2}% \scantokens\expandafter{\cpt@tempa}\relax }{% \cpt@err{Your command \noexpand#1 isn't scannable. \MsgBrk I needed to delimit its last parameter text}\@ehc }% \gletcs#1\cpt@tempa \endgroup } \robust@def*\dofunclist{% \pushnumber\dofunclistnr \begingroup \edef\sav@do{\cptmakecs{sav@do@\cptrm\dofunclistnr}}% \expandafter\let\sav@do\do \expandafter\cpt@delimitcs\sav@do\cpt@nil \toks@{\def\csv@do##1}% \toks1\expandafter{\expandafter\expandafter\sav@do \cptrm\ifbracedTF{##1}{0{##1}}{0 ##1}\cpt@nil}% \expandafter\expandafter\expandafter\endgroup\expandafter \the\expandafter\toks@\expandafter{\the\toks1}% \csv@@parse } \robust@def*\csv@@loop{% \let\cpt@nmlz\cptswfalse \let\cpt@inkv\cptswfalse \cpt@teststopt\cpt@csvkvparse,% } \robust@def*\csv@@parse{% \let\cpt@nmlz\cptswtrue \let\cpt@inkv\cptswfalse \cpt@teststopt\cpt@csvkvparse,% } \robust@def*\kv@@loop{% \let\cpt@nmlz\cptswfalse \let\cpt@inkv\cptswtrue \cpt@teststopt\cpt@csvkvparse,% } \robust@def*\kv@@parse{% \let\cpt@nmlz\cptswtrue \let\cpt@inkv\cptswtrue \cpt@teststopt\cpt@csvkvparse,% } \new@def*\cpt@csvnil{\cpt@csvnil} \newcommand*\cpt@csvkvparse[2][,]{% \cpt@stchoose{cpt@st}{#2}\cpt@csvarg\cpt@csvkvparse \pushfunctions\cpt@csvkvparse{\cpt@csvdo@a,\cpt@csvdo,% \sav@csv@do,\ifcpt@useempty,\ifloopbreak,% \cptdoremainder}\cpt@csvdepth \letcstocsn\sav@csv@do{\if\cpt@inkv kv\else csv\fi @do}% \ifdefTF\sav@csv@do{}{% \cpt@err{'\string\csv@do' or '\string\kv@do' undefined}\@ehc }% \def\cpt@csvdo@a{% \ifboolTF{loopbreak}{% \gobble@to@sentinel\cpt@csvnil#1% }{% \cpt@csvdo.% }% }% \def\cpt@csvdo##1#1{% \edef\cpt@csvarg{\expandcsonce{\@gobble##1}}% \ifxTF\cpt@csvarg\cpt@csvnil{}{% \ifxTF\cpt@csvarg\cpt@csvbreak{% \loopbreaktrue }{% \ifcsemptyTF\cpt@csvarg{% \ifdefboolFT{cpt@useempty}{}{\sav@csv@do{}\relax}% }{% \expandafter\sav@csv@do\expandafter{\cpt@csvarg}\relax }% }% \cpt@csvdo@a }% }% \ifdefswitchFT{cpt@nmlz}{}{% \ifcsemptyTF\cpt@csvarg{}{% \cpt@sttrue \usename{cpt@\ifdefswitchTF{cpt@inkv}{kv}{csv}normalize}% [#1]\cpt@csvarg }% }% \loopbreakfalse \expandafter\cpt@csvdo@a\cpt@csvarg#1\cpt@csvnil#1% \popfunctions\cpt@csvkvparse\cpt@csvdepth \ifnum\cpt@csvdepth=\z@pt \let\cptdoremainder\@gobble \undefcsset{\csv@do,\kv@do,\dofunclistnr}% \fi } \robust@def\indris@nil#1\fi#2\indris@do#3\indris@nil{\fi#1#2} \newvariables{if}{lastindris}[false] \robust@def*\indrisloop{\cpt@teststopt\cpt@indrisloop{,}} \robust@def*\cpt@indrisloop[#1]#2#3{% \pushfunctions\cpt@indrisloop {\indris@do,\indrisnr,\iflastindris,% \ifloopbreak,\user@do,\getnextindris}\indrisdepth \cpt@stchoose{cpt@st}{#2}\cpt@rsvda\indrisloop \cpt@sttrue\cpt@csvnormalize[#1]\cpt@rsvda \lastindrisfalse\loopbreakfalse \chardef\indrisnr\z@pt \ifsingletokenTF{#3}{% \ifmacroTF{#3}{}{\cpt@notcserr{#3}}% }{% \cpt@notonetokenerr{#3}% }% \let\user@do#3% \def\getnextindris##1#1##2\indris@nil{% \edef\nextindris{\unexpanded\expandafter{\@gobble##1}}% \letcsntocs{nextindris@\cptrm\indrisdepth}\nextindris }% \def\indris@do##1#1##2\indris@nil{% \edef\currindris{\unexpanded\expandafter{\@gobble##1}}% \letcsntocs{currindris@\cptrm\indrisdepth}\currindris \ifcat$\detokenize\expandafter{\@gobble##2.}$\indris@nil \lastindristrue\fi \ifboolTF{lastindris}{% \def\nextindris{}% \csn@def{nextindris@\cptrm\indrisdepth}{}% }{% \ifcsvbreakTF{##1}\loopbreak\relax \ifboolTF{loopbreak}{% \defpass\reserved@a####1\indris@nil{\cptdoremainder{####1}}% }{% \getnextindris.##2\indris@nil }% }% \pushnumber\indrisnr \expandafter\user@do\expandafter{\@gobble##1}% \indris@do.##2\indris@nil }% \expandafter\indris@do\expandafter.\cpt@rsvda#1\indris@nil \popfunctions\cpt@indrisloop\indrisdepth } \robust@def*\tsv@@loop{% \let\tsv@inparse\cptswfalse \cpt@testst\cpt@tsvparse@a } \robust@def*\tsv@@parse{% \let\tsv@inparse\cptswtrue \cpt@testst\cpt@tsvparse@a } \new@def*\cpt@tsvnil{\cpt@tsvnil} \robust@def\cpt@tsvparse@a#1{% \cpt@stchoose{cpt@st}{#1}\cpt@tsvarg\cpt@tsvparse@a \pushfunctions\tsv@@parse{\sav@tsv@do,\ifcpt@useempty, \ifloopbreak,\cptdoremainder,\tsv@inparse}\cpt@csvdepth \ifdefTF\tsv@do{}{% \cpt@err{'\string\tsv@do' is undefined}\@ehc }% \let\sav@tsv@do\tsv@do \loopbreakfalse \expandafter\cpt@tsvparse@b\cpt@tsvarg\cpt@tsvnil \popfunctions\tsv@@parse\cpt@csvdepth \ifnum\cpt@csvdepth=\z@pt \let\cptdoremainder\@gobble \undefcs\tsv@do \fi } \robust@def*\cpt@tsvparse@b{% \ifboolTF{loopbreak}{% \gobble@to@sentinel\cpt@tsvnil{}% }{% \begingroup \let\bgr@up\bgroup \let\bgroup\cpt@undefined \cpt@ifnextchar\bgr@up\cpt@tsvparse@c\cpt@tsvparse@c }% } \robust@def\cpt@tsvparse@c#1{% \ifxTF\@let@token\bgr@up{% \endgroup \edef\cpt@tsvarg{{\unexpanded{#1}}}% }{% \endgroup \edef\cpt@tsvarg{\usename{cpttrimspace\if\tsv@inparse s\fi}{#1}}% }% \ifxTF\cpt@tsvarg\cpt@tsvnil{}{% \ifxTF\cpt@tsvarg\cpt@tsvbreak{% \loopbreak }{% \ifxTF\@empty\cpt@tsvarg{% \ifcpt@useempty\sav@tsv@do{}\relax\fi }{% \expandafter\sav@tsv@do\expandafter{\cpt@tsvarg}\relax }% }% \cpt@tsvparse@b }% } % \tsv@@parse does preserve outer braces but sometimes this % isn't required, necessitating a call to a brace stripper. % \siso@@loop strips outer braces in its arguments and % doesn't trim leading and trailing spaces, but can % be nested to any level: \new@def*\cpt@sisonil{\cpt@sisonil} \robust@def*\siso@@loop#1{% \pushfunctions\siso@@loop{\sav@siso@do,\ifloopbreak}\cpt@sisodepth \ifdefTF\siso@do{}{\cpt@notdeferr\siso@do}% \let\sav@siso@do\siso@do \loopbreakfalse \cpt@sisoloop#1\cpt@sisonil \popfunctions\siso@@loop\cpt@sisodepth \ifnum\cpt@sisodepth=\z@pt\undefcs\siso@do\fi } \robust@def*\cpt@sisoloop#1{% \edef\siso@arg{\unexpanded{#1}}% \ifxTF\siso@arg\cpt@sisonil{}{% \ifboolTF{loopbreak}{% \gobble@to@sentinel\cpt@sisonil{}% }{% \sav@siso@do{#1}\relax\cpt@sisoloop }% }% } \robust@def*\cpt@oncurrlevel#1#2{% \ifdefTF\curr@level{% \ifnum\curr@level=\z@pt \cpt@err{'\string\curr@level' is zero}{% I can't do anything on zero current level.}% \fi }{% \cpt@err{'\string\curr@level' undefined}\@ehc }% \cptexpandsecond{#1} {\noexpandcsn{\cptgobblescape#2@\romannumeral\curr@level}}% } \new@def*\csliststack#1#2{% \ifdefFT{#2}{}{% \ifxTF#2\@empty{}{\expandcsonce{#2}#1}% }% } \new@def*\csnliststack#1#2{% \expandafter\ifdefFT\csname#2\endcsname{}{% \expandafter\ifxTF\csname#2\endcsname\@empty{}% {\expandafter\expandcsonce\csname#2\endcsname#1}% }% } \new@def\cptafterfi#1\fi{\fi#1} \new@def\cptafterelsefi#1\else#2\fi{\fi#1} \new@def\cptafterfifi#1\fi#2\fi{\fi\fi#1} \robust@def*\emptify#1{\let#1\@empty} \robust@def*\gemptify#1{\global\let#1\@empty} \robust@def*\genemptify{\cpt@teststcl\cpt@genemptify} \def\cpt@genemptify#1{% \ifcpt@cl\global\fi\ifcpt@st\else\long\fi\def#1{}% } \robust@def*\emptifycsn{\aftercsname\emptify} \robust@def*\gemptifycsn{\global\aftercsname\emptify} \robust@def*\emptifycsset{% \cpt@testst{\cpt@testcl\cpt@emptifycsset}% } \robust@def*\cpt@emptifycsset#1{% \docommalist{#1}{% \ifsingletoken@sp@TF{##1}{% \ifescapedTF{##1}{% \ifcpt@cl\global\fi\def##1{}% }{% \cpt@notescapederr{##1}% }% }{% \cpt@notonetokenerr{##1}% }% }% } \robust@def*\emptifycsnset{\cpt@testopt\cpt@emptifycsnset{}} \robust@def*\cpt@emptifycsnset[#1]#2{% \docommalist{#2}{\csn@def{#1##1}{}}% } \AtEndOfPackage{% \AfterStartOfDocument{% \def\do#1{% \ifcsnameTF{\cptgobblescape#1}{% \gdef#1{\@latex@error{'\string#1' is a preamble command}% {Move command '\string#1' to document preamble.}}% }{% \cpt@warn{Undefined command '\unexpanded{#1}': \MsgBrk appeared in \string\cptonlypreamble}% }% }% \cpt@preamblecmdhook \gundefcs\cpt@preamblecmdhook \gletcs\do\noexpand }% } \new@def*\cpt@preamblecmdhook{} \robust@def*\cptonlypreamble#1{% \begingroup \def\csv@do##1{% \ifescapedFT{##1}{% \cpt@notescapederr{##1}% }{% \ifsingletokenTF{##1}{% \xifinsetTF{\detokenize{\do##1}}% {\cptoxdetok\cpt@preamblecmdhook}{% \cpt@warn{Command '\unexpanded{##1}' multiply \MsgBrk submitted to \string\cptonlypreamble: ignored}% }{% \xdef\cpt@preamblecmdhook{\csliststack{}% \cpt@preamblecmdhook\unexpanded{\do##1}% }% }% }{% \cpt@notonetokenerr{##1}% }% }% }% \csv@@parse[,]{#1}% \endgroup } \new@def*\cpt@newlinespaces{^^J\@spaces\@spaces} \robust@def*\cptelementcount{\cpt@teststopt\cpt@elemcount,} \robust@def*\cpt@elemcount[#1]#2{% \begingroup \def\cpt@elemnr{0}% \edef\reserved@a{\ifcpt@st*\fi}% \def\csv@do##1{% \edef\cpt@elemnr{\the\numexpr\cpt@elemnr+1}% }% \expandafter\csv@@loop\reserved@a[#1]{#2}% \postgroupdef\cpt@elemnr\endgroup } \robust@def*\ifelemcountTF{% \cpt@teststopt\cpt@ifelemcount@a,% } \robust@def*\cpt@ifelemcount@a[#1]{% \cpt@testpnopt{\cpt@ifelemcount@b{#1}}=% } \robust@def*\cpt@ifelemcount@b#1(#2){% \cpt@testopt{\cpt@ifelemcount@c{#1}{#2}}1% } \robust@def*\cpt@ifelemcount@c#1#2[#3]#4{% \begingroup \@tempcnta\z@pt \edef\reserved@a{\ifcpt@st*\fi}% \def\csv@do##1{% \advance\@tempcnta\@ne }% \expandafter\csv@@loop\reserved@a[#1]{#4}% \aftercsname\endgroup{@\ifnum\@tempcnta#2#3 % first\else second\fi oftwo}% } \robust@def*\cptfindduplicates{\cpt@teststopt\cpt@findduplicates,} \robust@def*\cpt@findduplicates[#1]#2{% \begingroup \edef\reserved@a{\ifcpt@st*\fi}% \edef\parser{\detokenize{#1}}% \def\cpt@currstack{}\gdef\duplicates{}% \def\csv@do##1{% \xifinsetTF{\detokenize{#1##1#1}} {\parser\cptoxdetok\cpt@currstack\parser}{% \xdef\duplicates{\csliststack#1\duplicates\unexpanded{##1}}% }{% \edef\cpt@currstack{\csliststack#1\cpt@currstack\unexpanded{##1}}% }% }% \expandafter\csv@@parse\reserved@a[#1]{#2}% \ifcsemptyTF\duplicates {\endgroup\@firstoftwo}{\endgroup\@secondoftwo}% } \new@def*\ifcsnullTF#1{% \ifblankTF{#1}\@secondoftwo{% \expandafter\ifblankTF\expandafter{\@gobble#1}{% \ifxTF#1\@empty }{% \@secondoftwo }% }% } \new@def*\ifcsnullFT#1{\ifcsnullTF{#1}\@secondoftwo\@firstoftwo} \new@def*\oifcsnullTF#1{\expandafter\ifcsnullTF\expandafter{#1}} \new@def*\oifcsnullFT#1{\expandafter\ifcsnullFT\expandafter{#1}} \new@def*\ifcsnnullTF#1{% \ifblankTF{#1}{% \@secondoftwo }{% \ifcsndefTF{#1}{% \expandafter\ifx\csname#1\endcsname\@empty \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi }{% \@secondoftwo }% }% } \new@def*\ifcsnnullFT#1{% \ifcsnnullTF{#1}\@secondoftwo\@firstoftwo } \new@def*\ifdefnotnullTF#1{% \ifdefTF{#1}{% \ifcsnullTF{#1}\@secondoftwo\@firstoftwo }\@secondoftwo } \new@def*\ifcsndefnotnullTF#1{% \ifcsndefTF{#1}{% \ifcsnnullTF{#1}\@secondoftwo\@firstoftwo }\@secondoftwo } %% For private use only: \new@def*\simpleexpandarg#1#2{\expandafter#1\expandafter{#2}} \newletcs\s@expandarg=\simpleexpandarg %%-- \new@def*\expandcsonce#1{\unexpanded\expandafter{#1}} \new@def*\expandcsnonce#1{\aftercsname\expandcsonce{#1}} \new@def*\expandcstwice#1{\unexpanded\cptthreexp{#1}} \new@def*\expandcsntwice#1{\aftercsname\expandcstwice{#1}} \new@def*\noexpandcsn#1{\expandcsonce{\csname#1\endcsname}} \newletcs\cptmakecs=\noexpandcsn \new@def*\cptoxdetok#1{\detokenize\expandafter{#1}} \new@def*\cpttxdetok#1{\detokenize\cptthreexp{#1}} \new@def*\cptsxdetok#1{\detokenize\cptsevenxp{#1}} \robust@def\cptpassexpanded#1{% \begingroup\protected@edef\x{\endgroup#1}\x } \newletcs\cptexpanded=\cptpassexpanded \robust@def\cptpassunexpanded#1{\begingroup\long\def\x{\endgroup#1}\x} \robust@def*\cptexpandarg#1#2{\cptpassexpanded{\unexpanded{#1}{#2}}} \robust@def*\cptexpandargonce#1#2{% \cptpassexpanded{\unexpanded{#1}{\expandcsonce{#2}}}% } \robust@def*\cptexpandsecond#1#2{\cptpassexpanded{\unexpanded{#1}#2}} \robust@def*\cptexpandsecondonce#1#2{% \cptpassexpanded{\unexpanded{#1}\expandcsonce{#2}}% } \robust@def*\cptexpandsecondarg#1#2#3{% \cptpassexpanded{\unexpanded{#1#2}{#3}}% } \robust@def*\cptexpandsecondargonce#1#2#3{% \cptpassexpanded{\unexpanded{#1#2}{\expandcsonce{#3}}}% } \robust@def*\cptexpandtwoargs#1#2#3{% \cptpassexpanded{\unexpanded{#1}{#2}{#3}}% } \robust@def*\cptexpandtwoargsonce#1#2#3{% \cptpassexpanded {\unexpanded{#1}{\expandcsonce{#2}}{\expandcsonce{#3}}}% } \robust@def*\StyleFileRCSInfo$#1 #2 #3 #4 #5 #6 #7 #8 ${% \def\cpt@filedate{#4}% \def\cpt@fileversion{v#3}% \def\cpt@filetime{#5}% \def\cpt@fileauthor{#6\@space#7}% } \new@def*\cpt@filedesc{} \defpass\reserved@a#1{% \robust@def*\StyleFilePurpose##1{% \gdef\cpt@filedesc{##1#1(\cpt@fileauthor)}% }% }{ } \new@def*\StyleFileInfo{% \cpt@filedate\@space\cpt@fileversion\@space\cpt@filedesc } \robust@def*\SetStyleFileMessages{% \begingroup \catcode`\ =9\catcode`\^^I=9\relax \edef\cpt@tempa{\expandafter\@carcube\@currname\@nil @}% \def\cpt@tempb{\@testopt{\expandafter\endgroup \cpt@SetStyleFileMessages}}% \expandafter\cpt@tempb\expandafter{\cpt@tempa}% } \robust@def*\cpt@SetStyleFileMessages[#1]#2#3#4{% \begingroup \def\cpt@tempa##1{\noexpandcsn{##1}}% \protected\def\cpt@tempb{\global\protected\@namedef}% \edef\cpt@tempc{\ifx\@currext\@pkgextension Package\else Class\fi}% \@tempswafalse \def\do##1,{% \ifnot@nil{##1}{% \if@tempswa\else \ifcsname#1##1\endcsname \edef\reserved@a{#1##1}\@tempswatrue \fi \fi \do }% }% \do#2,#3,#4,\@nil,% \if@tempswa \cpt@notdefinable \else \cptpassexpanded{% \cpt@tempb{#1#2}####1{\cpt@tempa{\cpt@tempc Info}% {\@currname}{####1\noexpand\@gobble}}% \cpt@tempb{#1#3}####1{\cpt@tempa{\cpt@tempc WarningNoLine}% {\@currname}{####1}}% \cpt@tempb{#1#4}####1####2{\cpt@tempa{\cpt@tempc Error}% {\@currname}{####1}{####2}}% }% \fi \endgroup \interactionmode\thr@@ } \SetStyleFileMessages[cpt@]{info}{warn}{err} \robust@def*\cptbegingroup{% \begingroup \cpt@grouplevel\currentgrouplevel \cpt@grouptype\currentgrouptype } \robust@def*\cptendgroup{% \ifnum\cpt@grouptype=\currentgrouptype \ifnum\cpt@grouplevel=\currentgrouplevel\else \cpt@err{There is a group level mismatch}\@ehc \aftergroup\showgroups \fi \else \cpt@err{There is a group type mismatch}\@ehc \aftergroup\showgroups \fi \endgroup } \new@def*\ifdefboolTF#1{% \ifblankTF{#1}{% \cpt@err{Empty boolean}\@ehc }{% \ifcsndefTF{if#1}{% \ifboolTF{#1}% }{% \cpt@err{Boolean '\@backslashchar#1' undefined}\@ehc }% }% } \new@def*\ifdefboolFT#1{\ifdefboolTF{#1}\@secondoftwo\@firstoftwo} \new@def*\ifboolTF#1{% \usename{@\usename{if#1}first\else second\fi oftwo}% } \new@def*\ifboolFT#1{\ifboolTF{#1}\@secondoftwo\@firstoftwo} \new@def*\ifbooleanTF#1#{% \ifsingletokenTF{#1}{% \ifescapedTF{#1}{% \ifdefboolTF{\cptremovescape#1}\@firstoftwo\@secondoftwo }{% \cpt@notescapederr }% }{% \cpt@notonetokenerr{#1}% }% } \new@def\cptiterate#1\repeat{\cpt@iterate\@gobble{#1}} \newletcs\cptloop=\cptiterate \new@def\cpt@iterate\@gobble#1{% #1\relax\expandafter\cpt@iterate\fi\@gobble{#1}% } \new@def\cptwhilecond#1\fi#2{% #1#2\relax\cptswap{\cpt@whilecond{#1#2\relax}\fi}\fi } \new@def\cpt@whilecond#1\fi{% #1\expandafter\cpt@whilecond\else\@gobbletwo\fi{#1}\fi } \new@def*\cpt@numlt#1<{#1<\numexpr} \new@def*\cpt@numgt#1>{#1>\numexpr} \new@def*\cpt@numeq#1={#1=\numexpr} \new@def*\cpt@dimlt#1<{#1<\dimexpr} \new@def*\cpt@dimgt#1>{#1>\dimexpr} \new@def*\cpt@dimeq#1={#1=\dimexpr} \new@def*\cptwhilenum#1\do#2{% \ifnum\numexpr\cpt@numlt\cpt@numgt\cpt@numeq#1% \remove@to@nnil<=>\@nnil\relax#2\relax \cptswap{\cpt@whilenum{#1}{\relax#2\relax}}\fi } \new@def*\cpt@whilenum#1#2{% \ifnum\numexpr\cpt@numlt\cpt@numgt\cpt@numeq#1% \remove@to@nnil<=>\@nnil#2% \expandafter\cpt@whilenum\else \expandafter\@gobbletwo\fi{#1}{#2}% } \new@def*\cptwhiledim#1\do#2{% \ifdim\dimexpr\cpt@dimlt\cpt@dimgt\cpt@dimeq#1% \remove@to@nnil<=>\@nnil\relax#2\relax \cptswap{\cpt@whiledim{#1}{\relax#2\relax}}\fi } \new@def*\cpt@whiledim#1#2{% \ifdim\dimexpr\cpt@dimlt\cpt@dimgt\cpt@dimeq#1% \remove@to@nnil<=>\@nnil#2% \expandafter\cpt@whiledim\else \expandafter\@gobbletwo\fi{#1}{#2}% } \new@def*\ifnumcmpTF#1#{% \usename{@\ifnum\numexpr\cpt@numlt\cpt@numgt\cpt@numeq#1% \remove@to@nnil<=>\@nnil first\else second\fi oftwo}% } \new@def*\ifnumcmpFT#1#{\usename{@\ifnumcmpTF#1{second}{first}oftwo}} \new@def*\ifnumtestTF#1#2#3{% \usename{@\ifnum\numexpr#1#2\numexpr#3 first\else second\fi oftwo}% } \new@def*\ifdimcmpTF#1#{% \usename{@\ifdim\dimexpr\cpt@dimlt\cpt@dimgt\cpt@dimeq#1% \remove@to@nnil<=>\@nnil first\else second\fi oftwo}% } \new@def*\ifdimcmpFT#1#{\usename{@\ifdimcmpTF#1{second}{first}oftwo}} \robust@def*\cpt@defcheck#1#2\cpt@nil{% \new@def*#1##1\cpt@nil{% \begingroup \def\cpt@tempa####1#2####2\cpt@nil{\endgroup \@nameuse{@\ifblankTF{####2}{second}{first}oftwo}% }% \cpt@tempa##1#2\cpt@nil }% } \cpt@defcheck\cpt@checkeq=\cpt@nil \robust@def*\cpt@defsplit@at#1#2\cpt@nil{% \new@def*#1##1\cpt@nil{% \begingroup \def\cpt@tempa####1#2####2\cpt@nil{\endgroup \def\lpt{####1}\def\rpt{####2}% }% \ifinsetTF{#2}{##1}{% \cpt@tempa##1#2\cpt@nil }{% \def\lpt{##1}\def\rpt{}% }% }% } \cpt@defsplit@at\cpt@split@ateq=\cpt@nil \robust@def\DefSuffixChecker#1#2#3{% \def#1##1##2##3{% \begingroup \toks@{}% \def\cpt@tempa{% \ifsingletokenTF{##2}{% \ifsingletokenTF{##3}{% \toks@{##1##2##3}% }{% \toks@{##1##2{##3}}% }% }{% \ifsingletokenTF{##3}{% \toks@{##1{##2}##3}% }{% \toks@{##1{##2}{##3}}% }% }% }% \defpass\cpt@tempb{% \ifstrcmpTF{##2}{#2}{% \cpt@tempa }{% \ifstrcmpTF{##2}{#3}{% \ifstrcmpTF{##3}{#2}{% \toks@{##1##3##2}% }{% \cpt@tempa }% }{% \cpt@tempa }% }% }% \expandafter\endgroup\the\toks@ }% } \new@def*\ifnumoddTF#1#{% \usename{@\ifodd#1\@empty first\else second\fi oftwo}% } \new@def*\ifnumoddFT#1#{% \usename{@\ifnumoddTF#1{second}{first}oftwo}% } \newletcs\ifnumevenTF\ifnumoddFT \robust@def*\cptnumexpr{\cpt@testcl{\cpt@numexpr{num}}} \robust@def*\cptdimexpr{\cpt@testcl{\cpt@numexpr{dim}}} \robust@def*\cptglueexpr{\cpt@testcl{\cpt@numexpr{glue}}} \robust@def*\cptmuexpr{\cpt@testcl{\cpt@numexpr{mu}}} \new@def*\cpt@numexpr#1#2#3{% \ifsingletokenTF{#2}{}{\cpt@notonetokenerr{#2}}% \ifescapedTF{#2}{}{\cpt@notescapederr{#2}}% \ifdefTF{#2}{% \ifcpt@cl\global\fi#2=\usename{#1expr}#3\relax\relax }{% \def\reserved@a##1#1##2##3\@nil{% \usename{new##2}#2\relax }% \reserved@a num{count}dim{dimen}glue{skip}mu{muskip}\@nil \ifcpt@cl\global\fi#2=\usename{#1expr}#3\relax\relax }% } \robust@def*\cptnumdef{\cpt@testcl{\cpt@numdef{num}}} \robust@def*\cptdimdef{\cpt@testcl{\cpt@numdef{dim}}} \robust@def*\cptgluedef{\cpt@testcl{\cpt@numdef{glue}}} \robust@def*\cptmudef{\cpt@testcl{\cpt@numdef{mu}}} \new@def*\cpt@numdef#1#2#3{% \ifsingletokenTF{#2}{}{\cpt@notonetokenerr{#2}}% \ifescapedTF{#2}{}{\cpt@notescapederr{#2}}% \ifcpt@cl\global\fi\edef#2{\the\usename{#1expr}#3}% } \robust@def*\cptnumadd{\cpt@testcl{\cpt@numadd{num}}} \robust@def*\cptdimadd{\cpt@testcl{\cpt@numadd{dim}}} \robust@def*\cptglueadd{\cpt@testcl{\cpt@numadd{glue}}} \robust@def*\cptmuadd{\cpt@testcl{\cpt@numadd{mu}}} \new@def*\cpt@numadd#1#2#3{% \ifsingletokenTF{#2}{}{\cpt@notonetokenerr{#2}}% \ifescapedTF{#2}{}{\cpt@notescapederr{#2}}% \ifdefTF{#2}{% \ifcpt@cl\global\fi\edef#2{\the\usename{#1expr}#2+#3}% }{% \ifcpt@cl\global\fi\edef#2{\the\usename{#1expr}#3}% }% } \robust@def*\csnnumdef{\cpt@testcl{\aftercsname{\cpt@numdef{num}}}} \robust@def*\csndimdef{\cpt@testcl{\aftercsname{\cpt@numdef{dim}}}} \robust@def*\csnnumadd{\cpt@testcl{\aftercsname{\cpt@numadd{num}}}} \robust@def*\csndimadd{\cpt@testcl{\aftercsname{\cpt@numadd{dim}}}} \new@edef*\cpt@leftbracechar{% \expandafter\@car\string{\@nil\iffalse}\fi } \new@edef*\cpt@rightbracechar{% \iffalse{\fi\expandafter\@car\string}\@nil } \new@def\cptstrcmp#1#2{% \usename{@\ifnum\pdfstrcmp{#1}{#2}=0 first\else second\fi oftwo}% } \new@def\ifstrcmpFT#1#2{\ifstrcmpTF{#1}{#2}\@secondoftwo\@firstoftwo} \new@def\oifstrcmpTF#1#2{% \cptstrcmp{\expandcsonce{#1}}{\expandcsonce{#2}}% } \robust@def\oifstrcmp@sp@TF#1#2{% \ifsingletokenTF{#1}{% \ifexpandableTF{#1}{% \ifsingletokenTF{#2}{% \ifexpandableTF{#2}{% \oifstrcmpTF{#1}{#2}% }{% \cpt@notexpandableerr{#2}% \@secondoftwo }% }{% \cpt@notonetokenerr{#2}% \@secondoftwo }% }{% \cpt@notexpandableerr{#1}% \@secondoftwo }% }{% \cpt@notonetokenerr{#1}% \@secondoftwo }% } \robust@def\oifstrcmpFT#1#2{% \oifstrcmpTF{#1}{#2}\@secondoftwo\@firstoftwo } \new@def\xifstrcmpTF#1#2{\cptstrcmp{#1}{#2}} \new@def\xifstrcmpFT#1#2{\cptstrcmp{#1}{#2}\@secondoftwo\@firstoftwo} \new@def\ifstreqTF#1#2{% \expandafter\cptswapfirstbraced\expandafter {\romannumeral-`\q\cpttrimspaces{#1}} {\expandafter\ifstrcmpTF\expandafter {\romannumeral-`\q\cpttrimspaces{#2}}} } \robust@def\ifstreqFT#1#2{\ifstreqTF{#1}{#2}\@secondoftwo\@firstoftwo} \robust@def\oifstreqTF#1#2{\cptexpandtwoargsonce\ifstreqTF{#1}{#2}} \robust@def\oifstreqFT#1#2{\cptexpandtwoargsonce\ifstreqFT{#1}{#2}} \robust@def\xifstreqTF#1#2{\cptexpandtwoargs\ifstreqTF{#1}{#2}} \robust@def\xifstreqFT#1#2{\cptexpandtwoargs\ifstreqFT{#1}{#2}} \newcommand\ifbracedTF[3]{% \romannumeral \ifcase \iffalse{{{\fi\expandafter\expandafter\expandafter \@gobble\expandafter\expandafter\expandafter {\expandafter\expandafter\expandafter{\expandafter \iffalse\expandafter}\expandafter}\expandafter\fi \string#1}\m@ne}\@ne}\z@ \expandafter\@secondoftwo \or \expandafter\@secondoftwo \else \expandafter\@firstoftwo \fi {0 #2}{0 #3}% } \new@def*\ifbracedFT#1{\ifbracedTF{#1}\@secondoftwo\@firstoftwo} % Ulrich Diez 06/02/2011: \new@def*\ud@ifbracedTF#1#2#3{% \romannumeral \ifblankTF{#1}{% 0 #3% }{% \ifnullTF{#1}{% 0 #3% }{% \expandafter\@secondoftwo\expandafter {\expandafter{\string#1.}\expandafter\@firstoftwo \expandafter{\iffalse}\fi0 #2}{0 #3}% }% }% } %%-- \new@def*\ifleftbracedTF#1{% \ifblankTF{#1}{% \@secondoftwo }{% \@nameuse{@\if\expandafter\cpt@car\detokenize{#1}\car@nil \expandafter\cpt@car\string{\car@nil\ifnum0=`}\fi first\else second\fi oftwo}% }% } \new@def*\ifdefeqTF#1#2{% \ifdefTF{#1}{% \ifdefTF{#2}{% \usename{@\ifx#1#2first\else second\fi of oftwo}% }\@secondoftwo }\@secondoftwo } \new@def\ifdefeqFT#1#2{\ifdefeqTF{#1}{#2}\@secondoftwo\@firstoftwo} \new@def\ifcateqTF#1#{\usename{@\ifcat#1first\else second\fi oftwo}} \new@def\ifcharcmpTF#1#2{% \ifsingletokenTF{#1}{% \ifsingletokenTF{#2}{% \usename{@\if\detokenize\expandafter{\romannumeral\expandafter \cptswap\expandafter{\romannumeral-`\q#2}{-`\q#1}}% first\else second\fi oftwo}% }{% \cpt@notonetokenerr{#2}\@secondoftwo }% }{% \cpt@notonetokenerr{#1}\@secondoftwo }% } \new@def\ifexpandableTF#1#2#3{% \romannumeral\ifleftbracedTF{#1}\@secondoftwo{% \ifblankTF{#1}\@secondoftwo{\expandafter\ifx\noexpand#1#1% \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}}% {0 #2}{0 #3}% } \newcommand*\ifleadspaceTF[1]{% \long\def\ifleadspaceTF##1##2##3{% \romannumeral\@nameuse{@\ifnullTF{##1}{second}% {\cpt@ifleadspace.##1#1\@nnil}oftwo}{0#1##2}{0#1##3}% }% } \ifleadspaceTF{ } \long\def\cpt@ifleadspace#1 {% \expandafter\ifnullTF\expandafter{\@gobble#1}{first}{second}% \remove@to@nnil } \newcommand\iftrailspaceTF[1]{% \long\def\iftrailspaceTF##1{% \romannumeral-`\q \csname @\expandafter\@firstofone\expandafter{% \romannumeral\expandafter \cpt@iftrailspace\expandafter{\remove@to@space.##1#1}% }% }% } \iftrailspaceTF{ } \newcommand\cpt@iftrailspace[1]{% \ifnullTF{#1}{% \expandafter\@secondoftwo\@firstoftwo }{% \ifleadspaceTF{#1}{% \expandafter\ifnullTF\expandafter{\@gobblespace#1}{% \expandafter\@firstoftwo\@firstoftwo }{% \@secondoftwo }% }{% \@secondoftwo }% }{% {0 first}{0 second}oftwo\endcsname }{% \expandafter\cpt@iftrailspace\expandafter{\remove@to@space.#1}% }% } \new@def\ifsingletokenTF#1#2#3{% \romannumeral\ifblankTF{#1}\@secondoftwo{% \ifbracedTF{#1}\@secondoftwo{% \ifleadspaceTF{#1}{% \expandafter\ifblankTF\expandafter{\@gobblespace#1}% }{% \expandafter\ifblankTF\expandafter{\@gobble#1}% }% \@firstoftwo\@secondoftwo }% }{0 #2}{0 #3}% } \robust@def*\ifsingletokenFT#1{% \ifsingletokenTF{#1}\@secondoftwo\@firstoftwo } \new@def\ifsingletoken@sp@TF#1#2#3{% \romannumeral\ifblankTF{#1}{% \@secondoftwo }{% \ifbracedTF{#1}{% \@secondoftwo }{% \expandafter\ifblankTF\expandafter{\@gobble#1}% \@firstoftwo\@secondoftwo }% }{0 #2}{0 #3}% } \robust@def*\ifsingledigitTF#1{% \begingroup \def\cpt@tempa##1#1##2##3\@@nil{% \endgroup \csname @\ifx##20first\else second\fi oftwo\endcsname }% \cpt@tempa00 01 02 03 04 05 06 07 08 09 0#1\relax\@@nil } \new@def*\cpt@parserlist{,;:/|*><=-+"'} \robust@def*\cpt@checklistparser#1#2{% \ifmacroTF{#1}{% \ifcpt@verbose \cpt@info{Parser '\detokenize{#1}' is a macro}\@ehc \fi }{% \ifsingletokenTF{#1}{% \xifinsetTF{\detokenize{#1}}\cpt@parserlist{% #2% Don't put \relax here! }{% \cpt@listparsererr{#1}% }% }{% \cpt@listparsererr{#1}% }% }% } \robust@def*\cpt@ch@cklistparser#1{% \ifblankTF{#1}{% \cpt@listparsererr{#1}% }{% \expandafter\ifsecondisnilTF\string#1\cpt@nnil\cpt@nil{% \xifinsetTF{\detokenize{#1}}\cpt@parserlist{}{% \cpt@listparsererr{#1}% }% }{% \cpt@listparsererr{#1}% }% }% } \robust@def*\cpt@listparsererr#1{% \cpt@err{Invalid list parser '\detokenize{#1}'}\@ehc } \robust@def*\postgroupdef#1\endgroup{% \cptpassexpanded{\endgroup\cpt@csexit{#1}}% } \robust@def*\cptpassacross#1#2{% \cptpassexpanded{\unexpanded{#2}\cpt@csexit#1}% } \new@def*\cpt@csexit#1{\edef\noexpand#1{\ox@unexpanded{#1}}} \new@def*\ox@unexpanded#1{\noexpand\unexpanded{\expandcsonce{#1}}} \robust@def*\cptaftergroup#1{% \advance\@tempcnta\@ne \csn@xdef{cpt@aftergroup@\romannumeral\@tempcnta}{% \gundefcsn{cpt@aftergroup@\romannumeral\@tempcnta}% \unexpanded\ifblankTF{#1}{}\expandafter{#1}% }% \aftercsname\aftergroup{cpt@aftergroup@\romannumeral\@tempcnta}% } \robust@def\cptafterassignment#1{% \begingroup \advance\@tempcnta\@ne \csn@xdef{cpt@afterassignment@\romannumeral\@tempcnta}{% \gundefcsn{cpt@afterassignment@\romannumeral\@tempcnta}% \unexpanded\ifblankTF{#1}{}\expandafter{#1}% }% \aftercsname{\endgroup\afterassignment} {cpt@afterassignment@\romannumeral\@tempcnta}% } \robust@def*\cptexpandmacro#1#2{% \ifsingletokenTF{#1}{% \ifmacroTF{#1}{% \ifexpandableTF{#1}{% \simpleexpandarg\cptexpandmacro{#1}#2% }{% \edef#2{\unexpanded{#1}}% }% }{% \edef#2{\unexpanded{#1}}% }% }{% \edef#2{\unexpanded{#1}}% }% } \new@def*\cptexpandcs#1{% \ifsingletokenTF{#1}{% \ifmacroTF{#1}{% \ifexpandableTF{#1}{% \simpleexpandarg\cptexpandcs{#1}% }{% \noexpand#1% }% }{% \noexpand#1% }% }{% \unexpanded{#1}% }% } \begingroup \catcode`\&=7 \new@gdef*\cptfullexpand#1{% \romannumeral\cpt@fullexpand{#1}{}% } \new@gdef*\cpt@fullexpand#1{% \expandafter\cpt@f@llexp@nd\romannumeral\cpt@f@llexpand#1&% } \new@gdef*\cpt@f@llexpand#1{% \ifmacroTF{#1}{% \ifexpandableTF{#1}{% \expandafter\cpt@f@llexpand\expandafter{#1}% }{% 0 #1% }% }{% 0 #1% }% } \new@gdef*\cpt@f@llexp@nd#1#2{% \ifblankTF{#2}{0 #3#1}{\cpt@fullexpand{#2}{#3#1}}% } \endgroup \new@def*\IfStrEqCase#1{\cpt@xtestopt{#1}\cpt@ifstreqcase{}} \new@def\cpt@ifstreqcase[#1]#2#3{% \expandafter\cptswapfirstbraced\expandafter{#2}% {\cpt@ifstreqc@se#3\cpt@mil\cpt@mil\cpt@nil}{#1}% } \new@def\cpt@ifstreqc@se#1#2#3\cpt@nil#4#5{% \ifblankTF{#3}{#5}{% \ifstrcmpTF{#1}{#4}{#2}{% \cpt@ifstreqc@se#3\cpt@nil{#4}{#5}% }% }% } \def\cptcheckchoice#1#2#3{% \expandafter\cptswapfirstbraced\expandafter {\romannumeral-`\q\cpttrimspace{#1}} {\cpt@checkchoice#2,\cpt@mil\cpt@mil,\cpt@nil}{#3}% } \new@def\cpt@checkchoice#1#2,#3\cpt@nil#4#5{% \ifblankTF{#3}{\unexpanded{#5}}{% \xifstrcmpTF{\cpttrimspace{#1}}{\unexpanded{#4}}{% \unexpanded{#2}% }{% \cpt@checkchoice#3\cpt@nil{#4}{#5}% }% }% } \new@def*\IfStrPresentCase#1{\cpt@xtestopt{#1}\cpt@ifstrincase{}} \new@def\cpt@ifstrincase[#1]#2#3{% \expandafter\cptswapfirstbraced\expandafter{#2}% {\cpt@ifstrinc@se#3\cpt@mil\cpt@mil\cpt@nil}{#1}% } \new@def\cpt@ifstrinc@se#1#2#3\cpt@nil#4#5{% \ifblankTF{#3}{#5\relax}{% \ifinsetTF{#1}{#4}{#2\relax}{% \cpt@ifstrinc@se#3\cpt@nil{#4}{#5}% }% }% } \robust@def\cpt@in#1#2{% \long\def\in@@##1#1{}% \ifcat$\detokenize\expandafter{\in@@#2{}{}#1}$% \cpt@infalse\else\cpt@intrue\fi } \robust@def\ifinsetTF#1#2{% \cpt@in{#1}{#2}% \usename{@\ifcpt@in first\else second\fi oftwo}% } \robust@def\ifinsetFT#1#2{\ifinsetTF{#1}{#2}\@secondoftwo\@firstoftwo} \robust@def\oifinsetTF#1#2{\cptexpandtwoargsonce\ifinsetTF{#1}{#2}} \robust@def\oifinsetFT#1#2{\oifinsetTF{#1}{#2}\@secondoftwo\@firstoftwo} \robust@def\xifinsetTF#1#2{\cptexpandtwoargs\ifinsetTF{#1}{#2}} \robust@def\xifinsetFT#1#2{\xifinsetTF{#1}{#2}\@secondoftwo\@firstoftwo} \robust@def\oifinset@sp@TF#1#2#3{% \begingroup \edef\x{\detokenize{#1}}% \edef\x{{\x\cptoxdetok{#2}\x}{\x\cptoxdetok{#3}\x}}% \expandafter\endgroup\expandafter\ifinsetTF\x } \robust@def\oifinset@sp@FT#1#2#3{% \oifinset@sp@TF{#1}{#2}{#3}\@secondoftwo\@firstoftwo } \robust@def*\cptaddtolist{\cpt@teststopt{\cpt@addtolist\expandcsonce{e}},} \robust@def*\cptgaddtolist{\cpt@teststopt{\cpt@addtolist\expandcsonce{x}},} \robust@def*\cptxaddtolist{\cpt@teststopt{\cpt@addtolist\@firstofone{e}},} \robust@def*\cptgxaddtolist{\cpt@teststopt{\cpt@addtolist\@firstofone{x}},} \robust@def\cpt@addtolist#1#2[#3]#4#5{% \ifcpt@check\cpt@checklistparser{#3}\relax\fi \begingroup \toks@{\endgroup \ifdefTF#4{% \ifboolTF{cpt@st}{% \usename{protected@#2def}#4{\csliststack#3#4#1{#5}}% }{% \usename{#2def}#4{\csliststack#3#4#1{#5}}% }% }{% \ifboolTF{cpt@st}{% \usename{protected@#2def}#4{#1{#5}}% }{% \usename{#2def}#4{#1{#5}}% }% }% }% \ifblankTF{#5}{% \ifcpt@useempty\the\toks@\else\endgroup\fi }{% \the\toks@ }% } \robust@def*\cptfilterremovecsv{% \begingroup \let\cpt@inkv\cptswfalse \let\temp@parse\csv@@parse \cpt@testopt\cpt@filterremoveelements{,}% } \robust@def*\cptfilterremovekv{% \begingroup \let\cpt@inkv\cptswtrue \let\temp@parse\kv@@parse \cpt@testopt\cpt@filterremoveelements{,}% } \robust@def*\cpt@filterremoveelements[#1]#2#3#4{% \edef\temp@do {\cptmakecs{\ifxTF\temp@parse\csv@@parse{csv}{kv}@do}}% \cptdeclarefilter{#4}% \ifdefTF{#2}{}{\def#2{}}% \edef\cpt@delete{\unexpanded{#3}}% \ifcsnullTF\cpt@delete{}{% \cpt@sttrue \usename{cpt@\if\cpt@inkv k\else cs\fi vnormalize}[#1]\cpt@delete }% \edef\cpt@tempd##1{% {\detokenize{#1}\noexpand\cptoxdetok{##1}\detokenize{#1}}% {\detokenize{#1}\cptoxdetok\cpt@delete\detokenize{#1}}% }% \def\cpt@tempc{}% \expandafter\def\temp@do##1{% \edef\cpt@tempa{\unexpanded{##1}}% \cpt@usefilter\cpt@tempa\cpt@tempb \expandafter\xifinsetTF\cpt@tempd\cpt@tempb{}{% \cptaddtolist[#1]\cpt@tempc{##1}% }% }% \ifcsnullTF#2{}{% \ifcsnullTF\cpt@delete{}{% \temp@parse*[#1]#2% }% }% \let#2\cpt@tempc \postgroupdef#2\endgroup } \robust@def*\cptdeclarefilter#1{% \edef\cpt@usefilter##1##2{% \ifblankTF{#1}{\let##2##1}{% \ifxTF{#1}\relax{\let##2##1}{% \ifstrcmpTF{#1}\nofilter{\let##2##1}{% \unexpanded{#1}{##1}{##2}% }% }% }% }% } \newletcs\everymergeitem=\@iden \robust@def*\cptfiltermergecsv{% \begingroup \let\temp@parse\csv@@parse \cpt@testopt\cpt@filtermergelists{,}% } \robust@def*\cptfiltermergekv{% \begingroup \let\temp@parse\kv@@parse \cpt@testopt\cpt@filtermergelists{,}% } \robust@def*\cpt@filtermergelists[#1]#2#3#4{% \edef\temp@do {\cptmakecs{\ifxTF\temp@parse\csv@@parse{csv}{kv}@do}}% \cptdeclarefilter{#4}% \ifdefTF{#2}{}{\def#2{}}% \ifblankTF{#3}{% \def\cpt@update{}% }{% \edef\cpt@update{\unexpanded{#3}}% }% \def\cpt@add##1{% \edef#2{\csliststack#1#2\everymergeitem{\expandcsonce{##1}}}% }% \expandafter\def\temp@do##1{% \cpt@choicefdfalse \edef\cpt@merge@a{\unexpanded{##1}}% \cpt@usefilter\cpt@merge@a\cpt@merge@b \expandafter\def\temp@do####1{% \edef\cpt@merge@c{\unexpanded{####1}}% \cpt@usefilter\cpt@merge@c\cpt@merge@d \cptscantokens\cpt@merge@b \cptscantokens\cpt@merge@d \ifx\cpt@merge@b\cpt@merge@d \cpt@choicefdtrue\cpt@add\cpt@merge@a \else \cpt@add\cpt@merge@c \fi }% \cptexpandargonce{\def#2{}\temp@parse[#1]}#2% \ifboolTF{cpt@choicefd}{}{\cpt@add\cpt@merge@a}% }% \ifcsnullTF#2{% \edef#2{\expandcsonce\cpt@update}% }{% \ifcsnullTF\cpt@update{}{% \temp@parse*[#1]\cpt@update }% }% \postgroupdef#2\endgroup \let\everymergeitem\@firstofone } \newvariables{switch}[cpt@]{fromrepl,fromrem}[false] \robust@def*\cptremoveoneelement{\cpt@teststopt\cpt@removeoneelement,} \robust@def\cpt@removeoneelement[#1]#2#3{% \begingroup \let\ifremovest\ifcpt@st \edef\pser{\detokenize{#1}}% \def\cpt@remove@a##1{% \def\cpt@remove@b####1#1##1#1####2\remove@nil{% \edef#2{\unexpanded{####1#1####2}}% \cpt@trimparsers[#1]#2% }% \xifinsetTF{\detokenize{#1##1#1}}{\pser\cptoxdetok{#2}\pser}{% \expandafter\cpt@remove@b\expandafter#1#2#1\remove@nil \ifboolTF{removest}{% \expandafter\cpt@remove@a\expandafter{\cpt@remove@c}% }{}% }{}% }% \ifdefswitchTF{cpt@fromrem}{% \edef\cpt@remove@c{\unexpanded{#3}}% }{% \cpt@sttrue\cpt@csvnormalize[#1]#2% \edef\cpt@remove@c{\cpttrimspaces{#3}}% }% \let\cpt@remove@d#2% \expandafter\cpt@remove@a\expandafter{\cpt@remove@c}% \ifdefswitchTF{cpt@fromrem}{}{% \ifx\cpt@remove@d#2\ifcpt@verbose \cpt@warn{The list in \noexpand#2 not updated: \MsgBrk perhaps something was wrong}% \fi\fi }% \postgroupdef#2\endgroup } \robust@def*\cptremoveelements{\cpt@teststopt\cpt@removeelements,} \robust@def\cpt@removeelements[#1]#2#3{% \begingroup \edef\cpt@resa{\ifcpt@st*\fi}% \let\cpt@fromrem\cptswtrue \cpt@sttrue\cpt@csvnormalize[#1]#2% \long\def\csv@do##1{% \expandafter\cptremoveoneelement\cpt@resa[#1]#2{##1}% }% \csv@@parse[#1]{#3}% \postgroupdef#2\endgroup } \robust@def*\cptreplaceoneelement{\cpt@teststopt\cpt@replaceoneelement,} \robust@def\cpt@replaceoneelement[#1]#2#3#4{% \begingroup \let\ifreplst\ifcpt@st \edef\pser{\detokenize{#1}}% \def\cpt@replace@a##1{% \def\cpt@replace@b####1#1##1#1####2\rep@nil{% \edef#2{\unexpanded{####1#1#4#1####2}}% \cpt@trimparsers[#1]#2% }% \xifinsetTF{\detokenize{#1##1#1}}{\pser\cptoxdetok#2\pser}{% \expandafter\cpt@replace@b\expandafter#1#2#1\rep@nil \ifboolTF{replst}{% \expandafter\cpt@replace@a\expandafter{\cpt@replace@c}% }{}% }{}% }% \ifdefswitchTF{cpt@fromrepl}{% \edef\cpt@replace@c{\unexpanded{#3}}% }{% \cpt@sttrue\cpt@csvnormalize[#1]#2% \edef\cpt@replace@c{\cpttrimspaces{#3}}% }% \let\cpt@replace@d#2% \expandafter\cpt@replace@a\expandafter{\cpt@replace@c}% \ifdefswitchTF{cpt@fromrepl}{}{% \ifx\cpt@replace@d#2\ifcpt@verbose \cpt@warn{The list in \noexpand#2 not updated: \MsgBrk something was wrong}% \fi\fi }% \postgroupdef#2\endgroup } \robust@def*\cptreplaceelements{\cpt@teststopt\cpt@replaceelements,} \robust@def\cpt@replaceelements[#1]#2#3#4{% \begingroup \edef\cpt@replace@a{\unexpanded{#3}}% \edef\cpt@replace@b{\unexpanded{#4}}% \edef\cpt@replace@c{\ifcpt@st*\fi}% \def\do##1,{% \ifnot@nil{##1}{\cpt@sttrue\cpt@csvnormalize[#1]##1\do}% }% \do#2,\cpt@replace@a,\cpt@replace@b,\@nil,% \def\cpt@replace@d##1#1##2\noboundary##3#1##4\noboundary{% \expandafter\cptreplaceoneelement\cpt@replace@c[#1]#2{##1}{##3}% \ifblankTF{##2}{}{% \ifblankTF{##4}{}{% \cpt@replace@d##2\noboundary##4\noboundary }% }% }% \let\cpt@fromrepl\cptswtrue \cptexpandsecond\cpt@replace@d{% \expandcsonce\cpt@replace@a#1\noboundary \expandcsonce\cpt@replace@b#1\noboundary }% \postgroupdef#2\endgroup } \robust@def*\preservebracedefQ#1#2{% \def\preserve@prefix{#1}% \def\preserve@delimiter{#2}% } \preservebracedefQ\long\@nil \robust@def*\preservebracedef#1{% \cpt@preservebracedef \cpt@pr@servebracedef#1.% } \robust@def*\PreserveBraceDef#1#2{% \cpt@preservebracedef \long\edef\preserve@after{\unexpanded{#1}}% \afterassignment\preserve@after \cpt@pr@servebracedef#2.% } \robust@def*\cpt@preservebracedef{% \begingroup \def\x{\endgroup\preserve@prefix \def\cpt@pr@servebracedef####1####2}% \expandafter\x\preserve@delimiter{% \preserve@prefix\edef##1{% \unexpanded\expandafter{\remove@to@dot##2}% }% }% } \robust@def*\csnnewif#1{% \ifstrcmpTF{#1}{x}{% \cpt@err{Redefining '\cptmakecs{ifx}'?}\@ehc }{% \usename{newif\cptthreexp}\usename{if#1}% }% } \robust@def*\csn@def{\aftercsname\def} \robust@def*\csn@gdef{\aftercsname\gdef} \robust@def*\csn@edef{\aftercsname\edef} \robust@def*\csn@xdef{\aftercsname\xdef} \robust@def*\csndef{\cpt@starorlong{\cpt@csndef{}{}{}}} \robust@def*\csnpdef{\cpt@starorlong{\cpt@csndef{}{p}{}}} \robust@def*\csngdef{\cpt@starorlong{\cpt@csndef{}{}{g}}} \robust@def*\csnpgdef{\cpt@starorlong{\cpt@csndef{}{p}{g}}} \robust@def*\csnedef{\cpt@starorlong{\cpt@csndef{}{}{e}}} \robust@def*\csnpedef{\cpt@starorlong{\cpt@csndef{}{p}{e}}} \robust@def*\csnxdef{\cpt@starorlong{\cpt@csndef{}{}{x}}} \robust@def*\csnpxdef{\cpt@starorlong{\cpt@csndef{}{p}{x}}} \robust@def*\newcsndef{\cpt@starorlong{\cpt@csndef{n}{}{}}} \robust@def*\newcsnpdef{\cpt@starorlong{\cpt@csndef{n}{p}{}}} \robust@def*\newcsngdef{\cpt@starorlong{\cpt@csndef{n}{}{g}}} \robust@def*\newcsnpgdef{\cpt@starorlong{\cpt@csndef{n}{p}{g}}} \robust@def*\newcsnedef{\cpt@starorlong{\cpt@csndef{n}{}{e}}} \robust@def*\newcsnpedef{\cpt@starorlong{\cpt@csndef{n}{p}{e}}} \robust@def*\newcsnxdef{\cpt@starorlong{\cpt@csndef{n}{}{x}}} \robust@def*\newcsnpxdef{\cpt@starorlong{\cpt@csndef{n}{p}{x}}} \new@def*\cpt@csndef#1#2#3#4{% \if#1n\relax \ifcsndefTF{#4}{% \def\reserved@a{#4}\cpt@notdefinable }{}% \fi \if#2p\relax\let\reserved@a\protected\else \let\reserved@a\relax\fi \reserved@a\l@ngrel@x\aftercsname\aftercsname{#3def}{#4}% } \robust@def*\letcsntocs#1{\cptthreexp\let\usename{#1}} \robust@def*\gletcsntocs#1{\global\cptthreexp\let\usename{#1}} \robust@def*\letcstocsn#1#2{% \begingroup\expandafter\endgroup\expandafter \let\expandafter#1\csname#2\endcsname } \robust@def*\gletcstocsn#1#2{% \begingroup\expandafter\endgroup\expandafter\global \expandafter\let\expandafter#1\csname#2\endcsname } \robust@def*\letcsntocsn#1#2{% \begingroup\expandafter\endgroup \expandafter\let\csname#1\expandafter \endcsname\csname#2\endcsname } \robust@def*\gletcsntocsn#1#2{% \begingroup\expandafter\endgroup\expandafter \global\expandafter\let\csname#1\expandafter \endcsname\csname#2\endcsname } \robust@def*\globalize#1{\gletcs#1#1} \robust@def*\globalizecsn#1{% \begingroup\expandafter\endgroup\expandafter \global\expandafter\let\csname#1\expandafter\endcsname \csname#1\endcsname } \robust@def*\undefcs#1{\let#1\cpt@undefined} \robust@def*\gundefcs{\global\undefcs} \robust@def*\undefcsn#1{\aftercsname\undefcs{#1}} \robust@def*\gundefcsn{\global\undefcsn} \robust@def*\undefcsset{\cpt@testst{\cpt@testcl\cpt@undefcsset}} \robust@def*\cpt@undefcsset#1{% \cpt@stchoose{cpt@st}{#1}\cpt@rsvda\undefcsset \edef\cpt@rsvda {\expandafter\cptcommanormalize\expandafter{\cpt@rsvda}}% \def\do##1,{% \ifnot@nil{##1}{% \ifsingletoken@sp@TF{##1}{% \ifescapedTF{##1}{% \ifcpt@cl\global\fi\undefcs##1% }{% \cpt@notescapederr{##1}% }% }{% \cpt@notonetokenerr{##1}% }% \do }% }% \expandafter\do\cpt@rsvda,\@nil,% } \robust@def*\cpttrimleadparsers#1#2{% \ifblankTF{#1}{% \cpt@err{Empty parser in \string\cpttrimleadparsers}\@ehc }{}% \begingroup \ifcat$\detokenize\expandafter\expandafter\expandafter {\expandafter\@gobble#2.}$\cpt@defrelax\fi \def\reserved@e##1#1{% \edef\reserved@a{\unexpanded\expandafter{\@gobble##1}}% \ifx\reserved@a\@empty \def\next{\reserved@e.}% \else \def\@next####1#1\noboundary {\edef#2{\unexpanded\expandafter{\@gobble####1}}}% \edef\next{\unexpanded{\@next##1#1}}% \fi \next }% \expandafter\reserved@e\expandafter.#2#1\noboundary \postgroupdef#2\endgroup\cpt@relax } \robust@def\cpttrimtrailparsers#1#2{% \begingroup \def\cpt@trima{% \xifinsetTF{\detokenize{#1}\noboundary} {\cptoxdetok{#2}\noboundary}{% \def\reserved@a####1#1\noboundary{% \edef#2{\expandcsonce{\@gobble####1}}% \cpt@trima }% \expandafter\reserved@a\expandafter.#2\noboundary }{}% }% \cpt@trima \postgroupdef#2\endgroup } \robust@def*\cpttrimparsers{\cpt@testopt\cpt@trimparsers{,}} \robust@def*\cpt@trimparsers[#1]#2{% \ifsingletokenTF{#1}{% \cpttrimleadparsers{#1}#2% \cpttrimtrailparsers{#1}#2% }{% \cpt@notonetokenerr{#1}% }% } \robust@def\cpt@stripsuffix#1#2{% \ifblankTF{#2}{% \cpt@err{Blank test token for \string\cpt@stripsuffix}\@ehc }{% \edef\reserved@a{% \ifblankTF{#1}{}{\ifstrcmpTF{#1}{#2}{}{\unexpanded{#1}}}% }% }% } \robust@def*\stripouterbraces{\cpt@testopt\cpt@stripouterbraces\@ne} \robust@def\cpt@stripouterbraces[#1]{% \begingroup \def\after@def##1##2##3{\postgroupdef##3\endgroup}% \@tempcnta\z@pt \catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \cpt@str@pouterbraces{#1}% } \robust@def\cpt@str@pouterbraces#1#2#3{% \advance\@tempcnta\@ne \edef#3{\unexpanded{#2}}% \cpt@str@pouterbr@ces#2\strip@nil#3#1% } \robust@def\cpt@str@pouterbr@ces#1\strip@nil#2#3{% \defifxTF{#1}#2{% \after@def }{% \ifnum\@tempcnta>#3\relax \expandafter\after@def \else \expandafter\cpt@str@pouterbraces \fi }% {#3}{#1}{#2}% } \robust@def\stripallouterbraces#1#2{% \edef#2{\unexpanded\cptthreexp{\cpt@stripallouterbraces{#1}}}% } \robust@def\stripallouterbracesincs#1{% \expandafter\stripallouterbraces\expandafter{#1}#1% } \robust@def\cpt@stripallouterbraces#1{% \romannumeral\ifbracedTF{#1}{% \expandafter\ifnullTF\expandafter{\@gobble#1}{% \expandafter\@gobble\cpt@stripallouterbraces#1% }{0 #1}% }{0 #1}% } \robust@def\cpt@starafter#1#2{% \begingroup \def\cpt@tempa{#1}% \def\cpt@tempb##1{#1{#2}}% \def\cpt@tempc{\futurelet\next\cpt@staract}% \cpt@tempc } \new@def*\cpt@staract{% \ifxTF\@sptoken\next{% \afterassignment\cpt@tempc\let\next= % }{% \cptexpandsecond\endgroup{% \ifxTF*\next{\expandcsonce\cpt@tempb}% {\expandcsonce\cpt@tempa}% }% }% } \robust@def*\cptbracearg{\cpt@testopt\cpt@bracearg\@ne} \robust@def\cpt@bracearg[#1]#2#3{% \begingroup \@tempcnta\z@pt \loop \edef#3{\unexpanded{{#2}}}% \advance\@tempcnta\@ne \ifnum\@tempcnta<#1\relax \repeat \postgroupdef#3\endgroup } \edef\ifmacroTF#1{% \noexpand\ifblankTF{#1}{% \noexpand\@secondoftwo }{% \noexpand\ifleftbracedTF{#1}{% \noexpand\@secondoftwo }{% \unexpanded{\expandafter\cpt@ifmacro\meaning}% #1\detokenize{macro}:\cpt@nil }% }% } \new@def*\ifmacroFT#1{\ifmacroTF{#1}\@secondoftwo\@firstoftwo} \new@def*\oifmacroTF#1{\simpleexpandarg\ifmacroTF{#1}} \new@def*\ifcsnmacroTF{\aftercsname\ifmacroTF} \edef\cpt@ifmacro{% \def\noexpand\cpt@ifmacro##1\detokenize{macro}:##2\cpt@nil } \cpt@ifmacro{\usename{@\ifblankTF{#2}{second}{first}oftwo}} \robust@def*\csnmeaning#1{\aftercsname\meaning{#1}} \robust@def*\ifescapedTF#1{% \begingroup \escapechar92\relax \edef\x{\expandafter\cpt@car\string#1x\car@nil}% \aftercsname\endgroup {@\ifx\x\@backslashchar first\else second\fi oftwo}% } \robust@def*\ifescapedFT#1{\ifescapedTF{#1}\@secondoftwo\@firstoftwo} \ifcsdefinable\maxrobustalias{\chardef\maxrobustalias20} \newcommand*\cptrobustify[1]{% \def\csv@do##1{% \ifescapedTF{##1}{% \ifdefTF{##1}{% \pushnumber\robustaliascount \ifnum\robustaliascount<\maxrobustalias\relax \aftercsname\newletcs{rsv@\cptremovescape##1}##1% \protected\edef##1{\cptmakecs{rsv@\cptremovescape##1}}% \else \cpt@err{Maximum number '\number\maxrobustalias' of command aliases exceeded:\MsgBrk You can set \noexpand\maxrobustalias higher}\@ehc \fi }{% \cpt@notdeferr{##1}% }% }{% \cpt@notescapederr{##1}% }% }% \csv@@parse[,]{#1}% } \robust@def*\leftaddtocs{% \let\cpt@def\edef\let\swap\cptswap\cpt@addtocs } \robust@def*\gleftaddtocs{% \let\cpt@def\xdef\let\swap\cptswap\cpt@addtocs } \robust@def*\rightaddtocs{% \let\cpt@def\edef\let\swap\cptalloftwo\cpt@addtocs } \robust@def*\grightaddtocs{% \let\cpt@def\xdef\let\swap\cptalloftwo\cpt@addtocs } \robust@def*\rightaddtocsn{\aftercsname\rightaddtocs} \robust@def*\grightaddtocsn{\aftercsname\grightaddtocs} \robust@def*\leftaddtocsn{\aftercsname\leftaddtocs} \robust@def*\gleftaddtocsn{\aftercsname\gleftaddtocs} \robust@def\cpt@addtocs#1#2{% \ifsingletokenTF{#1}{% \ifescapedTF{#1}{% \ifdefTF#1{% \cpt@getmacroprefix{#1}% \macroprefix\cpt@def #1{\swap{\expandcsonce{#1}}{\unexpanded{#2}}}% }{% \cpt@def#1{\unexpanded{#2}}% }% }{% \cpt@notescapederr{#1}% }% }{% \cpt@notonetokenerr{#1}% }% \undefcs\cpt@def\undefcs\swap } \robust@def*\cpteveryscan{% \everyeof{\noexpand}% \endlinechar\m@one \makeatletter \catcode`\ =10 \catcode`\\\z@pt \catcode`\{\@ne \catcode`\}\tw@ } % #1 must be a non-parametered macro: \robust@def*\cptscantokens#1{% \begingroup \edef#1{\long\def\string#1{\cptoxdetok{#1}}}% \cpteveryscan \scantokens\expandafter{#1}\relax \postgroupdef#1\endgroup } \robust@def*\cpt@lowercasecs#1{% \ifmacroTF{#1}{% \cptexpandarg\lowercase{\def\noexpand#1{#1}}% }{% \cpt@notcserr{#1}% }% } \robust@def*\providecount#1{% \ifescapedTF{#1}{% \ifdefTF{#1}{% \ifcounterTF{#1}{}{% \cpt@warn{Command '\noexpand#1' is already \MsgBrk defined but not a counter}% }% }{% \newcount#1% }% }{% \cpt@notescapederr{#1}% }% } \robust@def*\providedimen#1{% \ifescapedTF{#1}{% \ifdefTF{#1}{% \ifdimenTF{#1}{}{% \cpt@warn{Command '\noexpand#1' is already \MsgBrk defined but not a dimension}% }% }{% \newdimen#1% }% }{% \cpt@notescapederr{#1}% }% } \robust@def*\newtog#1{\cpt@testopt{\cpt@newtog{#1}}{false}} \new@def*\cpt@newtog#1[#2]{% \ifinsetTF{,}{#1}{% \cpt@err{Command \noexpand\newtog doesn't accept list} {Please submit only one toggle to \noexpand\newtog.}% }{}% \ifcsndefTF{cpt@tog@#1}{% \cpt@err{Toggle '#1' already defined}% {Please provide a new toggle.}% }{}% \cpt@gettogstate{#2}% \letcsntocs{cpt@tog@#1}\cpt@togstate } \robust@def*\providetog#1{% \ifcsndefTF{cpt@tog@#1}{}{% \letcsntocs{cpt@tog@#1}\@secondoftwo }% } \robust@def*\cpt@gettogstate#1{% \lowercase{% \xifstrcmpTF{#1}{true}{% \let\cpt@togstate\@firstoftwo }{% \xifstrcmpTF{#1}{false}{% \let\cpt@togstate\@secondoftwo }{% \cpt@err{Invalid toggle value '#1'}% {Valid toggle values are 'true' and 'false'.}% }% }% }% } \robust@def*\cpt@notogerr#1{% \cpt@err{Toggle switch '#1' is undefined}\@ehc } \robust@def*\settogtrue#1{% \ifcsndefTF{cpt@tog@#1}{% \letcsntocs{cpt@tog@#1}\@firstoftwo }{% \cpt@notogerr{#1}% }% } \newletcs\togtrue=\settogtrue \robust@def*\settogfalse#1{% \ifcsndefTF{cpt@tog@#1}{% \letcsntocs{cpt@tog@#1}\@secondoftwo }{% \cpt@notogerr{#1}% }% } \newletcs\togfalse=\settogfalse \robust@def*\settog#1#2{% \ifcsndefTF{cpt@tog@#1}{% \cpt@gettogstate{#2}% \letcsntocs{cpt@tog@#1}\cpt@togstate }{% \cpt@notogerr{#1}% }% } \robust@def*\undeftog#1{% \ifcsndefTF{cpt@tog@#1}{% \letcsntocs{cpt@tog@#1}\cpt@undefined }{% \cpt@info{Null instruction to undefine unknown toggle '#1'}% }% } \new@def*\iftogTF#1{% \ifcsndefTF{cpt@tog@#1}{% \usename{cpt@tog@#1}% }{% \cpt@notogerr{#1}\@gobbletwo }% } \new@def*\iftogFT#1{\iftogTF{#1}\@secondoftwo\@firstoftwo} \new@def*\cptswtrue{00} \new@def*\cptswfalse{01} \def\reserved@a#1{% \new@def*\negatesw##1{% 0\ifcase##11#1\or\expandafter1\else\expandafter0\fi }% \new@def*\bothswtrue##1##2{% 0\ifcase##1##2#1\expandafter0\else\expandafter1\fi }% \new@def*\oneswtrue##1##2{% 0\ifnum##1##2<101#1\expandafter0\else\expandafter1\fi }% } \reserved@a{ } \robust@def*\newswitch#1{\cpt@testopt{\cpt@newswitch#1}{false}} \robust@def*\cpt@newswitch#1[#2]{% \ifinsetTF{,}{#1}{% \cpt@err{Command \noexpand\newswitch doesn't accept list} {Please submit only one switch to \string\newswitch.}% }{}% \xifinsetTF{,#1,}{,if,x,switch,tog,togg,bool,test,}{% \cpt@err{Invalid switch name '#1'}\@ehc }{}% \ifcsndefinable{#1}\relax \cpt@getswitchstate{#2}% \letcsntocsn{#1}{cptsw\cpt@switchstate}% } \robust@def*\cpt@getswitchstate#1{% \lowercase{\edef\cpt@tempa{\cpttrimspaces{#1}}}% \xifinsetTF{,\cpt@tempa,}{,true,false,}{% \let\cpt@switchstate\cpt@tempa }{% \cpt@err{Invalid switch value '#1'} {Valid switch values are 'true' and 'false'.}% }% } \robust@def*\cpt@noswitcherr#1{% \cpt@err{Switch '\string#1' is undefined}\@ehc } \robust@def*\setswitch#1#2{% \ifcsndefTF{#1}{% \cpt@getswitchstate{#2}% \letcsntocsn{#1}{cptsw\cpt@switchstate}% }{% \cpt@noswitcherr{#1}% }% } \robust@def*\setswitchtrue#1{% \ifcsndefTF{#1}{% \letcsntocs{#1}\cptswtrue }{% \cpt@noswitcherr{#1}% }% } \newletcs\switchtrue\setswitchtrue \robust@def*\setswitchfalse#1{% \ifcsndefTF{#1}{% \letcsntocs{#1}\cptswfalse }{% \cpt@noswitcherr{#1}% }% } \newletcs\switchfalse\setswitchfalse \new@def*\ifdefswitchTF#1{% \ifcsndefFT{#1}{% \cpt@err{Switch '#1' is not defined}\@ehc \@gobbletwo }{% \ifcondTF\if\usename{#1}\fi }% } \new@def*\ifdefswitchFT#1{\ifdefswitchTF{#1}\@secondoftwo\@firstoftwo} \new@def*\ifswitchTF#1{\ifcondTF\if\usename{#1}\fi} \new@def*\ifswitchFT#1{\ifswitchTF{#1}\@secondoftwo\@firstoftwo} \new@def*\thebool@normal#1{\ifdefboolTF{#1}{true}{false}} \new@def*\thebool@reverse#1{\ifdefboolTF{#1}{false}{true}} \newvariables{count}[cpt@]{exprcnt}[0] \robust@def*\ifexprTF#1{% \begingroup \let\cpt@expr@neg\cptswfalse \cpt@exprcnt\z@pt \cpt@expr@beg \cpt@expr@bgroup#1(\expr@nil \cpt@expr@end \cpt@expr@eval } \def\cpt@expr@beg{% \begingroup \let\cpt@expr@neg\cptswfalse \cpt@exprcnt\z@pt } \def\cpt@expr@end{% \cpt@expr@eval\cpt@expr@true\cpt@expr@false } \def\cpt@expr@eval{% \aftercsname\endgroup {@\ifnum\cpt@exprcnt<\z@pt second\else first\fi oftwo}% } \def\cpt@expr@true{% \advance\cpt@exprcnt\if\cpt@expr@neg\m@one\else\z@pt\fi \let\cpt@expr@neg\cptswfalse } \def\cpt@expr@false{% \advance\cpt@exprcnt\if\cpt@expr@neg\z@pt\else\m@one\fi \let\cpt@expr@neg\cptswfalse } \long\def\cpt@expr@bgroup#1(#2\expr@nil{% \cpt@expr@egroup#1)\expr@nil \ifblankTF{#2}{}{% \cpt@expr@beg \cpt@expr@bgroup#2\expr@nil }% } \long\def\cpt@expr@egroup#1)#2\expr@nil{% \cpt@expr@and#1and\expr@nil \ifblankTF{#2}{}{% \cpt@expr@end \cpt@expr@egroup#2\expr@nil }% } \long\def\cpt@expr@and#1and#2\expr@nil{% \cpt@expr@or#1or\expr@nil \ifblankTF{#2}{}{% \cpt@exprcnt\ifnum\cpt@exprcnt<\z@pt\m@one\else\z@pt\fi \cpt@expr@and#2\expr@nil }% } \long\def\cpt@expr@or#1or#2\expr@nil{% \cpt@expr@not#1not\expr@nil \ifblankTF{#2}{}{% \cpt@exprcnt\ifnum\cpt@exprcnt<\z@pt\z@pt\else\@ne\fi \cpt@expr@or#2\expr@nil }% } \long\def\cpt@expr@not#1not#2\expr@nil{% \cpt@expr@tog#1tog\expr@nil \ifblankTF{#2}{}{% \let\cpt@expr@neg\cptswtrue \cpt@expr@not#2\expr@nil }% } \long\def\cpt@expr@tog#1tog#2\expr@nil{% \cpt@expr@bool#1bool\expr@nil \ifblankTF{#2}{}{\cpt@expr@tog@a#2\expr@nil}% } \long\def\cpt@expr@tog@a#1#2\expr@nil{% \edef\reserved@a{\cpttrimspaces{#1}}% \ifcsndefTF{cpt@tog@\reserved@a}{% \usename{cpt@tog@\reserved@a}\cpt@expr@true\cpt@expr@false }{% \cpt@err{Invalid test expression: \MsgBrk toggle '\reserved@a' is undefined}\@ehc \cpt@expr@false }% \cpt@expr@tog#2\expr@nil } \long\def\cpt@expr@bool#1bool#2\expr@nil{% \cpt@expr@switch#1switch\expr@nil \ifblankTF{#2}{}{\cpt@expr@bool@a#2\expr@nil}% } \long\def\cpt@expr@bool@a#1#2\expr@nil{% \edef\reserved@a{\cpttrimspaces{#1}}% \ifcsndefTF{if\reserved@a}{% \ifboolTF\reserved@a\cpt@expr@true\cpt@expr@false }{% \cpt@err{Invalid test expression: \MsgBrk boolean '\reserved@a' is undefined}\@ehc \cpt@expr@false }% \cpt@expr@bool#2\expr@nil } \long\def\cpt@expr@switch#1switch#2\expr@nil{% \cpt@expr@test#1test\expr@nil \ifblankTF{#2}{}{\cpt@expr@switch@a#2\expr@nil}% } \long\def\cpt@expr@switch@a#1#2\expr@nil{% \edef\reserved@a{\cpttrimspaces{#1}}% \ifcsndefTF\reserved@a{% \ifswitchTF\reserved@a\cpt@expr@true\cpt@expr@false }{% \cpt@err{Invalid test expression: \MsgBrk switch '\reserved@a' is undefined}\@ehc \cpt@expr@false }% \cpt@expr@switch#2\expr@nil } \long\def\cpt@expr@test#1test#2\expr@nil{% \ifblankTF{#1}{}{% \cpt@err{Invalid piece in test expression: \MsgBrk'\detokenize{#1}'}\@ehc }% \ifblankTF{#2}{}{% \cpt@expr@test@a#2\expr@nil }% } \long\def\cpt@expr@test@a#1#2\expr@nil{% \ignorespaces#1\cpt@expr@true\cpt@expr@false \cpt@expr@test#2\expr@nil } \new@def*\cpt@beforeprocessoptions{} \new@def*\cpt@afterprocessoptions{} \robust@def*\BeforeProcessOptions{% \grightaddtocs\cpt@beforeprocessoptions } \robust@def*\AfterProcessOptions{% \grightaddtocs\cpt@afterprocessoptions } \robust@def*\BeforeStartOfDocument{% \grightaddtocs\cpt@beforestartdoc } \new@def*\cpt@beforestartdoc{} \gleftaddtocs\document{% \endgroup \let\BeforeStartOfDocument\@firstofone \cpt@beforestartdoc \let\BeforeStartOfDocument\@notprerr \gundefcs\cpt@beforestartdoc \def\cpt@docstarted{}% \begingroup } \robust@def*\AfterStartOfDocument{% \grightaddtocs\cpt@afterstartdoc } \new@def*\cpt@afterstartdoc{} \grightaddtocs\document{% \let\AfterStartOfDocument\@firstofone \cpt@afterstartdoc \let\AfterStartOfDocument\@notprerr \gundefcs\cpt@afterstartdoc \ignorespaces } \gleftaddtocs\@popfilename{% \ifcsnameFT{\@currname.\@currext-cpt@hook}{}{% \usename{\@currname.\@currext-cpt@hook}% \gundefcsn{\@currname.\@currext-cpt@hook}% }% } \robust@def*\ifpackagewithoptionsTF{\cpt@ifoptions\@pkgextension} \robust@def*\ifclasswithoptionsTF{\cpt@ifoptions\@clsextension} \robust@def*\cpt@ifoptions#1#2{% \cptexpandarg\cpt@ifopti@ns{\cpt@optionlist{#2.#1}}% } \robust@def*\cpt@ifopti@ns#1#2{% \begingroup \edef\temp@optlist{\unexpanded{#1}}% \cpt@sttrue\cpt@kvnormalize[,]\temp@optlist \cpt@choicefdtrue \def\kv@do##1{% \oifinset@sp@TF,{##1}\temp@optlist {}{\cpt@choicefdfalse\loopbreak}% }% \kv@@parse{#2}% \ifboolTF{cpt@choicefd} {\endgroup\@firstoftwo}{\endgroup\@secondoftwo}% } \robust@def*\ifpackageloadedlaterTF{\cpt@ifpkgloadedlater\@pkgextension} \robust@def*\ifclassloadedlaterTF{\cpt@ifpkgloadedlater\@clsextension} \robust@def*\cpt@ifpkgloadedlater#1#2#3#4{% \usename{@if#1loaded}{#2}{}{% \AfterStartOfDocument{% \usename{@if#1loaded}{#2}{% \cpt@info{\@cls@pkg\@space '#2' was loaded afterwards}% #3\relax }{% \cpt@info{\@cls@pkg\@space '#2' wasn't loaded afterwards}% #4\relax }% }% }% } \robust@def*\cptloadpackages{% \begingroup \endlinechar=-1 \cpt@testopt{\expandafter\endgroup\cpt@loadpackages}{|;}% } \robust@def\cpt@loadpackages[#1]#2{% \begingroup \toks@{}% \def\cpt@tempa##1##2\cpt@nil{% \ifblankTF{##2}{% \cpt@err{No outer parser or something wrong \MsgBrk while in \string\cptloadpackages}\@ehc \@gobble }{% \ifinsetFT{,}{##1##2}{}{% \cpt@err{Parser can't be comma (,) in \string\cptloadpackages}\@ehc \expandafter\@gobble }% }% \def\cpt@lo@dpackages####1##1####2##1####3##1####4\cpt@nil{% \ifblankTF{####1}{% \cpt@err{No package name while in \string\cptloadpackages}\@ehc \@gobble }{}% \ifblankTF{####2}{% \def\cpt@rsvda{}% }{% \stripallouterbraces{####2}\cpt@rsvda }% \@ifpackageloaded{####1}{% \edef\cpt@rsvdb{\detokenize\expandafter {\romannumeral-`\q\cpt@optionlist{####1.\@pkgextension}}}% \@tempswafalse \ifcsnullTF\cpt@rsvda{% \ifcsnullTF\cpt@rsvdb{}\@tempswatrue }{% \ifcsnullTF\cpt@rsvdb{% \@tempswatrue }{% \def\kv@do########1{% \xifinsetTF{,\detokenize{########1},}{,\cpt@rsvdb,}{}{% \@tempswatrue\loopbreak }% }% \kv@@parse*[,]\cpt@rsvda }% }% \if@tempswa \cpt@err{Option clash for package ####1.\@pkgextension}\@ehc \expandafter\@gobble \fi }{% \cptexpanded{% \toks@{\the\toks@ \ifxTF\documentclass\@twoclasseserror {\noexpand\usepackage}{\noexpand\RequirePackage}% [\expandcsonce\cpt@rsvda]{####1}[####3]% }% }% }% }% \def\csv@do####1{% \cpt@lo@dpackages####1##1##1##1##1\cpt@nil }% \cpt@useemptyfalse \csv@@parse[##2]{#2}% }% \cpt@tempa#1\cpt@nil \expandafter\endgroup\the\toks@ } \robust@def*\AfterEndOfStyleFile{% \begingroup \def\cpt@tempa{\endgroup \expandafter\grightaddtocs \csname\@currname.\@currext-cpt@hook\endcsname }% \ifcsnullTF\@currname{% \endgroup\@gobble }{% \cpt@tempa }% } \robust@def*\ifinstylefileTF{% \ifcsemptyTF\@currname\@secondoftwo\@firstoftwo } \robust@def*\cpt@pushhash{% \begingroup \@makeother{\#}% \endlinechar\m@one \cpt@push@hash } \robust@def\cpt@push@hash#1#2{% \xifinsetTF\cpt@hashchar{\detokenize{#1}}{% \edef\x##1{##1\detokenize{#1}\cpt@hashchar\cpt@nil}% \edef\y##1{\def##1####1\cpt@hashchar####2\cpt@nil}% \y\y{% \ifblankTF{##2}{% \toks@\expandafter{\the\toks@##1}% }{% \cptpassexpanded {\toks@{\the\toks@##1\cpt@hashchar\cpt@hashchar}}% \y##2\cpt@nil }% }% \x{\toks@{}\y}% }{% \toks@\expandafter{\detokenize{#1}}% }% \edef#2{\the\toks@}% \postgroupdef#2\endgroup } \robust@def*\cpt@pophash{% \begingroup \@makeother{\#}% \endlinechar\m@one \cpt@pop@hash } \robust@def\cpt@pop@hash#1#2{% \xifinsetTF{\detokenize{##}}{\detokenize{#1}}{% \edef\x##1{##1\detokenize{#1##}\cpt@nil}% \edef\y##1{\def##1####1\detokenize{##}####2\cpt@nil}% \y\y{% \ifblankTF{##2}{% \toks@\expandafter{\the\toks@##1}% }{% \cptpassexpanded{\toks@{\the\toks@##1\cpt@hashchar}}% \y##2\cpt@nil }% }% \x{\toks@{}\y}% }{% \toks@\expandafter{\detokenize{#1}}% }% \edef#2{\the\toks@}% \postgroupdef#2\endgroup } \robust@def*\csv@@normalize{\cpt@teststopt\cpt@csvnormalize,} \robust@def\cpt@csvnormalize[#1]#2{% \let\cpt@inkv\cptswfalse \cpt@normalizelist{#1}{#2}% } \robust@def*\kv@@normalize{\cpt@teststopt\cpt@kvnormalize,} \robust@def\cpt@kvnormalize[#1]#2{% \let\cpt@inkv\cptswtrue \cpt@normalizelist{#1}{#2}% } \ifcsdefinable\normalized@list\relax \robust@def\cpt@normalizelist#1#2{% \begingroup \let\ifnmlzst\ifcpt@st \cpt@stchoose{cpt@st}{#2}\reserved@e\cpt@normalizelist \ifx\reserved@e\@empty \def\normalized@list{}\cpt@defrelax \fi \cpt@ch@cklistparser{#1}% \expandafter\setup@parser@nmlz\string#1% \toks@\expandafter{\expandafter#1\reserved@e#1}% \nmlz@activeparser \expandafter\nmlz@spaceletter\string#1% \expandafter\nmlz@letterspace\string#1% \expandafter\nmlz@doubleletter\string#1% \ifdefswitchFT{cpt@inkv}{}{% \nmlz@activeequal \nmlz@spaceletter=% \nmlz@letterspace=% \nmlz@doubleletter=% \cpt@commaequalerr }% \edef\normalized@list{\the\toks@}% \cpttrimleadparsers#1\normalized@list \cptexpandsecond\endgroup{% \ifboolTF{nmlzst}{% \edef\noexpand#2{\ox@unexpanded\normalized@list}% \undefcs\noexpand\normalized@list }{% \cpt@csexit\normalized@list }% }% \cpt@relax } \def\setup@parser@nmlz#1{% \begingroup \uccode`\~=`#1% \uppercase{\endgroup \def\nmlz@activeparser{% \def\cpt@tempa####1~####2\nmlz@nil{% \ifblankTF{####2}{% \toks@{####1}% }{% \cpt@tempa####1#1####2\nmlz@nil }% }% \toks@\expandafter{\expandafter}\expandafter \cpt@tempa\the\toks@~\nmlz@nil }% }% } \begingroup \catcode`\==12 \uccode`\~=`\=% \uppercase{\endgroup \def\nmlz@activeequal{% \def\cpt@tempa##1~##2\nmlz@nil{% \ifblankTF{##2}{% \toks@{##1}% }{% \cpt@tempa##1=##2\nmlz@nil }% }% \toks@\expandafter{\expandafter}\expandafter \cpt@tempa\the\toks@~\nmlz@nil }% } \def\nmlz@doubleletter#1{% \def\cpt@tempa##1#1#1##2\nmlz@nil{% \ifblankTF{##2}{% \toks@{##1}% }{% \cpt@tempa##1#1##2\nmlz@nil }% }% \expandafter\cpt@tempa\the\toks@#1#1\nmlz@nil } \defpass\cpt@tempa#1{% \def\nmlz@spaceletter##1{% \def\cpt@tempa####1#1##1####2\nmlz@nil{% \ifblankTF{####2}{% \toks@{####1}% }{% \cpt@tempa####1##1####2\nmlz@nil }% }% \expandafter\cpt@tempa\the\toks@#1##1\nmlz@nil }% \def\nmlz@letterspace##1{% \def\cpt@tempa####1##1#1####2\nmlz@nil{% \ifblankTF{####2}{% \toks@{####1}% }{% \cpt@tempa####1##1####2\nmlz@nil }% }% \expandafter\cpt@tempa\the\toks@##1#1\nmlz@nil }% }{ } \robust@def*\cpt@commaequalerr{% \def\cpt@tempa##1,=##2\nmlz@nil{% \ifblankTF{##2}{}{% \cpt@err{There is 'comma' next to 'equal' (,=) in \MsgBrk your key-value list}\@ehc }% }% \expandafter\cpt@tempa\the\toks@,=\nmlz@nil } \let\cpt@documentclass\cpt@undefined \robust@def*\cpt@getdocumentclass{% \def\csv@do##1{% \filename@parse{##1}% \ifx\filename@ext\@clsextension \ifcsndefFT{opt@\filename@area\filename@base.% \filename@ext}{}{% \xdef\cpt@documentclass{% \filename@area\filename@base.\filename@ext }% }% \fi \ifx\cpt@documentclass\cpt@undefined\else\loopbreak\fi }% \csv@@parse*\@filelist \ifdefTF\cpt@documentclass{}{% \ifcpt@verbose \@latex@info@no@line{'catoptions' package loaded before \string\documentclass: \MsgBrk no problem}% \fi }% } \cptpassunexpanded{% \ifxTF\@filelist\relax{}{% \ifxTF\@filelist\@gobble{}{% \ifxTF\@filelist\@empty\relax\cpt@getdocumentclass }% }% \ifxTF\cpt@documentclass\cpt@undefined{% \let\cpt@classoptionslist\@empty }{% \ifxTF\@classoptionslist\relax{}{% \ifxTF\@classoptionslist\@empty{}{% \cpt@sttrue\cpt@kvnormalize[,]\@classoptionslist }% }% \let\cpt@classoptionslist\@classoptionslist \def\@fileswith@ptions##1[##2]##3{% \edef\cpt@tempa{\cptcommanormalize{##3}}% \cpt@choicefdfalse \def\do####1,{% \ifnot@nil{####1}{% \xifinsetFT{,####1,}{,\cpt@tempa,} {}\cpt@choicefdtrue \do }% }% \do xkeyval,kvoptions,ltxkeys,\@nil,% \ifcpt@choicefd \let\@classoptionslist\cpt@classoptionslist \fi \cpt@ifbrack{\@fileswith@pti@ns##1[##2]##3}% {\@fileswith@pti@ns##1[##2]##3[]}% }% \def\csv@do##1{% \ifinsetTF{=}{##1}{}{% \cptgaddtolist\@classoptionslist{##1}% }% }% \expandafter\def\expandafter\@classoptionslist\expandafter {\expandafter}\expandafter\csv@@loop\expandafter {\@classoptionslist}% }% } \robust@def*\cpt@testfam#1{% \ifnextcharTF<{#1}{#1<\@currname.\@currext>}% } \robust@def*\RecoverAtRequirePackage#1{% \ifblankFT{#1}{}{% \cpt@isblankerr\RecoverAtRequirePackage }% \begingroup \docommalist{#1}{% \ifescapedTF{##1}{% \ifdefTF{##1}{}{% \cpt@notdeferr{##1}% \@gobble }% }{% \cpt@notescapederr{##1}% \@gobble }% \ifcsndefinable{cpt@atpush@\cptremovescape##1}{% \gletcsntocs{cpt@atpush@\cptremovescape##1}##1% }% \edef\cpt@tempa{% \gletcs\unexpanded{##1}=\noexpandcsn{cpt@atpush@\cptremovescape##1}% }% \xifinsetTF{\cptoxdetok\cpt@tempa}{\cptoxdetok\@pushfilename}{}{% \xdef\@pushfilename{% \expandcsonce\cpt@tempa\expandcsonce\@pushfilename }% }% }% \endgroup } \robust@def*\cpt@badoptionerr#1{% \expandafter\ifescapedTF\expandafter{#1}{% \cpt@isescapederr{#1}% }{% \expandafter\ifmacroFT\expandafter{#1}{}{% \cpt@err{Macro as option name '\expandcsonce{#1}'}\@ehc }% }% } \robust@def*\XDeclareOption{% \let\@fileswith@pti@ns\@badrequireerror \cpt@ifstar {\cpt@testfam\cpt@define@default@ds}% {\cpt@testfam\cpt@declareoption}% } \robust@def*\cpt@declareoption<#1>#2{% \trim@@space{#1}\cpt@currfam \trim@@space{#2}\cpt@curropt \cpt@badoptionerr\cpt@curropt \cptexpandarg\cpt@testopt {\cpt@d@clareoption{\cpt@currfam}{\cpt@curropt}}{}% } \robust@def\cpt@d@clareoption#1#2[#3]#4{% \cpt@d@cl@reoption{#1}{#2}{#3}% \ifboolTF{cpt@olddx}{% \xifstrcmpTF{\@currname.\@currext}{xcolor.sty}{% \csn@xdef{#1@ds@#2}{% \unexpanded{\edef\XC@@opt{\XC@@opt#2,}#4}% }% }{% \csn@xdef{#1@ds@#2}{\unexpanded{#4}}% }% }{% \begingroup \long\def\cpt@tempa##1{\endgroup \csn@gdef{#1@ds@#2}####1{##1}% }% \cpt@tempa{#4}% }% \cpt@olddxfalse } \robust@def*\XDeclareOptions{% \let\@fileswith@pti@ns\@badrequireerror \cpt@ifstar{% \cpt@err{Command \noexpand\XDeclareOptions has no star form}\@ehc }{% \cpt@testfam\cpt@declareoptions }% } \robust@def*\cpt@declareoptions<#1>#2{% \cpt@testopt{\cpt@d@clareoptions{#1}{#2}}{}% } \robust@def\cpt@d@clareoptions#1#2[#3]#4{% \trim@@space{#1}\cpt@currfam \def\csv@do##1{% \cpt@badoptionerr{##1}% \s@expandarg\cpt@d@clareoption\cpt@currfam{##1}[#3]{#4}% }% \csv@@parse[,]{#2}% } \robust@def*\XInvalidOptionHandler{% \cpt@testfam\cpt@invalidoptionhandler } \robust@def*\cpt@invalidoptionhandler<#1>#2{% \def\cpt@currfams{#1}% \def\csv@do##1{% \ifcsndefTF{##1@invalidoptionerr}{% \cpt@err{Invalid option handler already defined \MsgBrk for family '##1'}{% Second invalid option handler for family '##1'? }% }{% \csn@gdef{##1@invalidoptionerr}####1{#2####1}% }% }% \csv@@parse*[,]\cpt@currfams } \robust@def*\XDeclareInvalidOptions{% \let\@fileswith@pti@ns\@badrequireerror \cpt@ifstar{% \cpt@err{Invalid star suffix for command \MsgBrk\string\XDeclareInvalidOption}\@ehc }{% \cpt@testfam\cpt@declarenulloptions }% } \newletcs\XDeclareInvalidOption\XDeclareInvalidOptions \robust@def*\cpt@declarenulloptions<#1>#2{% \def\cpt@currfams{#1}% \def\cpt@curropts{#2}% \def\csv@do##1{\cpt@d@clarenulloptions{##1}}% \csv@@parse*[,]\cpt@currfams \cpt@olddxfalse } \robust@def*\cpt@d@clarenulloptions#1{% \def\csv@do##1{% \ifcsndefTF{#1@ds@##1}{% \cpt@err{Option '##1' of family '#1' \MsgBrk is already defined}\@ehc }{% \cpt@badoptionerr{##1}% \cpt@d@cl@reoption{#1}{##1}{}% \ifcsndefTF{#1@invalidoptionerr}{% \gletcsntocsn{#1@ds@##1}{#1@invalidoptionerr}% }{% \begingroup \def\cpt@temp@err{% \cpt@err{Option '##1' of family '#1' \MsgBrk is invalid or null}{% Invalid option '##1' of family '#1'.}% }% \ifboolTF{cpt@olddx}{% \csn@xdef{#1@ds@##1}{\cpt@temp@err}% }{% \csn@xdef{#1@ds@##1}####1{\cpt@temp@err}% }% \endgroup }% }% }% \csv@@parse*[,]\cpt@curropts } \robust@def*\XDeclareCommandOption{% \let\@fileswith@pti@ns\@badrequireerror \let\cmdoption\cptswtrue \cpt@testfam\cpt@declarecmdoption } \robust@def*\XDeclareCommandOptions{% \let\@fileswith@pti@ns\@badrequireerror \let\cmdoption\cptswtrue \cpt@testfam\cpt@declarecmdoptions } \robust@def*\XDeclareBooleanOption{% \let\@fileswith@pti@ns\@badrequireerror \let\cmdoption\cptswfalse \cpt@testfam\cpt@declarecmdoption } \robust@def*\XDeclareBooleanOptions{% \let\@fileswith@pti@ns\@badrequireerror \let\cmdoption\cptswfalse \cpt@testfam\cpt@declarecmdoptions } \robust@def*\cptcheckbool#1#2#3{% \lowercase{% \edef\cpt@resa{\s@expandarg\cpttrimspaces{\cptrm-`\q#1}}% }% \xifinsetTF{,\cpt@resa,}{,true,false,}{% #3\relax }{% \@latex@error{Invalid value '#1' for '#2'}\@ehc }% } \robust@def*\cpt@declarecmdoption<#1>#2{% \trim@@space{#1}\cpt@currfam \trim@@space{#2}\cpt@curropt \cpt@badoptionerr\cpt@curropt \cptexpandarg\cpt@testopt {\cpt@d@clarecmdoption{\cpt@currfam}{\cpt@curropt}}{}% } \robust@def\cpt@d@clarecmdoption#1#2[#3]{% \cptexpandarg{\cpt@testpnopt{\cpt@d@cl@recmdoption {#1}{#2}{#3}}}{\if\cmdoption cmd\fi\@currname @}% } \robust@def\cpt@d@cl@recmdoption#1#2#3(#4)#5{% \cpt@d@cl@reoption{#1}{#2}{#3}% \if\cmdoption \def\cpt@rsvda{\csn@def{#4#2}{####1}}% \else \csnnewif{#4#2}% \def\cpt@rsvda{% \cptcheckbool{####1}{option #2}{\usename{#4#2\cpt@resa}}% }% \fi \long\def\cpt@rsvdb##1{% \csn@gdef{#1@ds@#2}####1{##1\relax}% }% \expandafter\cpt@rsvdb\expandafter{\cpt@rsvda#5}% } \robust@def*\cpt@declarecmdoptions<#1>#2{% \cpt@testopt{\cpt@d@clarecmdoptions{#1}{#2}}{}% } \robust@def\cpt@d@clarecmdoptions#1#2[#3]{% \cptexpandarg{\cpt@testpnopt{\cpt@d@cl@recmdoptions {#1}{#2}{#3}}}{\if\cmdoption cmd\fi\@currname @}% } \robust@def\cpt@d@cl@recmdoptions#1#2#3(#4)#5{% \trim@@spaces{#1}\cpt@currfam \begingroup \toks@{{#3}(#4){#5}}\toks1{}% \def\csv@do##1{% \cpt@badoptionerr{##1}% \cptexpanded{% \toks1{\the\toks1\relax \cpt@d@cl@recmdoption{\cpt@currfam}{##1}\the\toks@ }% }% }% \csv@@parse[,]{#2}% \expandafter\endgroup\the\toks1 } \robust@def*\XDeclareBiBooleanOptions{% \let\@fileswith@pti@ns\@badrequireerror \let\cmdoption\cptswfalse \cpt@testfam\cpt@declarebibooloptions } \robust@def*\cpt@declarebibooloptions<#1>#2{% \begingroup \@tempcnta\z@pt \def\csv@do##1{% \advance\@tempcnta\@ne }% \csv@@loop[,]{#2}% \ifnum\@tempcnta>\tw@ \cpt@err{Biboolean options '#2' more than 2}\@ehc \aftergroup\@gobble \else \ifnum\@tempcnta<\tw@ \cpt@err{Biboolean options '#2' less than 2}\@ehc \aftergroup\@gobble \fi \fi \endgroup \cpt@testopt{\cpt@d@clarebibooloptions{#1}{#2}}{}% } \robust@def\cpt@d@clarebibooloptions#1#2[#3]{% \cptexpandarg{\cpt@testpnopt{\cpt@d@cl@rebibooloptions {#1}{#2}{#3}}}{\@currname @}% } \robust@def\cpt@d@cl@rebibooloptions#1#2#3(#4)#5#6{% \edef\cpt@currfam{\cpttrimspaces{#1}}% \def\cpt@curropts{#2}% \cpt@sttrue\cpt@csvnormalize[,]\cpt@curropts \def\cpt@tempa##1,##2\cpt@nil##3{% \cpt@newv@riables{tog}{##3@}{##1,##2}[false]% \def\cpt@tempa####1####2{% \cpt@d@cl@rebib@oloptions{##1}{##2}{#3}{#4}{##3}{####1}% \cpt@d@cl@rebib@oloptions{##2}{##1}{#3}{#4}{##3}{####2}% }% }% \cptexpandsecond\cpt@tempa{\cpt@curropts\cpt@nil{\cpt@currfam}}% \cpt@tempa{#5}{#6}% } \robust@def\cpt@d@cl@rebib@oloptions#1#2#3#4#5#6{% \cpt@d@cl@recmdoption{#5}{#1}{#3}(#4){% #6\relax % If called by sister, don't call back: \iftogTF{#5@#1}{}{% \settogtrue{#5@#2}% \settogtrue{biboolopts}% \cptexpandarg{\XExecuteOptions<#5>}{#2=\thebool@reverse{#4#1}}% \settogfalse{biboolopts}% \settogfalse{#5@#2}% }% }% } \robust@def*\XDeclareSwitchOption{% \let\@fileswith@pti@ns\@badrequireerror \cpt@testfam\cpt@declareswoption } \robust@def*\XDeclareSwitchOptions{% \let\@fileswith@pti@ns\@badrequireerror \cpt@testfam\cpt@declareswoptions } \robust@def*\cpt@declareswoption<#1>#2{% \trim@@space{#1}\cpt@currfam \trim@@space{#2}\cpt@curropt \cpt@badoptionerr\cpt@curropt \cptexpandarg\cpt@testopt {\cpt@d@clareswoption{\cpt@currfam}{\cpt@curropt}}{}% } \robust@def*\cpt@d@clareswoption#1#2[#3]{% \cptexpandarg{\cpt@testpnopt{\cpt@d@cl@reswoption {#1}{#2}{#3}}}{\@currname @}% } \robust@def*\cpt@d@cl@reswoption#1#2#3(#4)#5{% \cpt@d@cl@reoption{#1}{#2}{#3}% \def\cpt@rsvda{% \cptcheckbool{####1}{#2}{% \letcsntocsn{#4#2}{cptsw\cpt@resa}% }% }% \long\def\cpt@rsvdb##1{% \csn@gdef{#1@ds@#2}####1{##1\relax}% }% \expandafter\cpt@rsvdb\expandafter{\cpt@rsvda#5}% } \robust@def*\cpt@declareswoptions<#1>#2{% \cpt@testopt{\cpt@d@clareswoptions{#1}{#2}}{}% } \robust@def\cpt@d@clareswoptions#1#2[#3]{% \cptexpandarg{\cpt@testpnopt{\cpt@d@cl@reswoptions {#1}{#2}{#3}}}{\@currname @}% } \robust@def\cpt@d@cl@reswoptions#1#2#3(#4)#5{% \trim@@spaces{#1}\cpt@currfam \begingroup \toks@{{#3}(#4){#5}}\toks1{}% \def\csv@do##1{% \cpt@badoptionerr{##1}% \cptexpanded{% \toks1{\the\toks1\relax \cpt@d@cl@reswoption{\cpt@currfam}{##1}\the\toks@ }% }% }% \csv@@parse[,]{#2}% \expandafter\endgroup\the\toks1 } \robust@def\cpt@d@cl@reoption#1#2#3{% \ifcsndefTF{#1@declaredoptions}{% \xifinsetTF{,\cptoxdetok{#2},}{,\cpt@getdeclaredoptions{#1},}{% \cpt@warn{Option '#2' multiply defined\MsgBrk in family '#1'\MsgBrk (in \@cls@pkg\@space'\@currname')% }% }{% \aftercsname{\cptaddtolist*}{#1@declaredoptions}{#2}% }% }{% \csn@xdef{#1@declaredoptions}{\expandcsonce{#2}}% }% \csn@xdef{#1@ds@#2@default}{% \noexpandcsn{#1@ds@#2}{\unexpanded{#3}}% }% } \robust@def*\XDisableOptions{% \cpt@testst{% \let\ifcpt@swa\ifcpt@st \cpt@testfam\cpt@disableoption }% } \robust@def*\cpt@disableoption<#1>#2{% \def\cpt@currfams{#1}% \def\cpt@curropts{#2}% \def\csv@do##1{% \cpt@dis@bleoption{##1}% }% \csv@@parse*[,]\cpt@currfams } \robust@def*\cpt@dis@bleoption#1{% \def\csv@do##1{% \ifcsndefFT{#1@ds@##1}{% \cpt@info{Option '##1' of family '#1'\MsgBrk is undeclared: not disabled} }{% \cptpassexpanded{% \ifcpt@swa\noexpand\AtBeginDocument{\fi \cptfiltermergekv[,]% \noexpandcsn{#1@disabledoptions}{##1}% \noexpand\nofilter \noexpand\undefcsn{#1@ds@##1@default}% \csn@gdef{#1@ds@##1}{% \noexpand\@latex@error{% Key '##1' of families '#1' is disabled }{% Key '##1' of family '#1'\MsgBrk has been disabled. You can't set or reset\MsgBrk it at this late stage. Perhaps you should\MsgBrk have set it earlier in \string\documentclass\MsgBrk or \string\usepackage }% }% \ifcpt@swa}\fi }% }% }% \csv@@parse*[,]\cpt@curropts } \robust@def*\XLogDisabledOptions{% \ifnextcharTF<\cpt@disabledoptionlist \cpt@dis@bledoptionlist } \robust@def*\cpt@disabledoptionlist<#1>{% \cpt@dis@bledoptionlist{#1}% } \robust@def*\cpt@dis@bledoptionlist#1{% \def\cpt@disable@a##1{% \ifcsndefTF{##1@disabledoptions}{% \cpt@info{Disabled options of family '##1': ^^J\expandcsnonce{##1@disabledoptions}}% }{% \cpt@info{No disabled options in family '##1' \MsgBrk at this point\ifcsnullTF\@currname{} {:\@space You can try the command \MsgBrk\noexpand\XLogDisabledOptions again, after \MsgBrk begin document}}% }% }% \def\cpt@disable@b##1##2{% \cpt@err{Command \noexpand\XLogDisabledOptions issued \MsgBrk in document but family name contains \MsgBrk ##1 extension \string##2, \MsgBrk a preamble command}\@ehc }% \def\csv@do##1{% \ifcsnullFT\@currname{% \cpt@disable@a{##1}% }{% \ifinsetTF\@pkgextension{##1}{% \cpt@disable@b{package}\@pkgextension }{% \ifinsetTF\@clsextension{##1}{% \cpt@disable@b{class}\@clsextension }{% \cpt@disable@a{##1}% }% }% }% }% \ifblankTF{#1}{}{\csv@@parse{#1}}% \undefcs\cpt@disable@a\undefcs\cpt@disable@b } \robust@def*\ifoptdisabledTF{% \cpt@swatrue\cpt@testfam\cpt@ifoptdisabled } \robust@def*\ifoptdisabledFT{% \cpt@swafalse\cpt@testfam\cpt@ifoptdisabled } \robust@def*\cpt@ifoptdisabled<#1>#2{% \def\cpt@currfams{#1}% \cpt@choicefdfalse \def\csv@do##1{% \cpt@ifoptdis@bled{##1}{#2}% }% \csv@@parse*[,]\cpt@currfams \ifboolTF{cpt@swa}\ifboolTF\ifdefboolFT{cpt@choicefd}% } \robust@def*\cpt@ifoptdis@bled#1#2{% \ifcsndefFT{#1@disabledoptions}{}{% \xifinsetFT{,#2,}{,\expandcsnonce{#1@disabledoptions},}{}{% \loopbreak\cpt@choicefdtrue }% }% } \robust@def*\ifoptdefTF{% \cpt@swatrue\cpt@testfam\cpt@ifoptdef } \robust@def*\ifoptdefFT{% \cpt@swafalse\cpt@testfam\cpt@ifoptdef } \robust@def*\cpt@ifoptdef<#1>#2{% \def\cpt@currfams{#1}% \cpt@choicefdfalse \def\csv@do##1{% \cpt@ifoptd@f{##1}{#2}% }% \csv@@parse*[,]\cpt@currfams \ifboolTF{cpt@swa}\ifboolTF\ifdefboolFT{cpt@choicefd}% } \robust@def*\cpt@ifoptd@f#1#2{% \ifcsndefFT{#1@ds@#2}{}{% \cpt@choicefdtrue\loopbreak }% } \new@def*\cpt@getdeclaredoptions#1{% \ifcsndefFT{#1@declaredoptions}{}{% \ifcsnnullTF{#1@declaredoptions}{}{% \detokenize\cptsevenxp{\usename{#1@declaredoptions}}% }% }% } \robust@def*\XUnknownOptionHandler{% \cpt@testfam\cpt@unknownoptionhandler } \robust@def*\cpt@unknownoptionhandler<#1>{% \cpt@testopt{\cpt@unkn@wnoptionhandler#1}{}% } \robust@def*\cpt@unkn@wnoptionhandler#1[#2]#3{% \def\cpt@currfams{#1}% \edef\reserved@e##1{% \csn@def{##1@default@ds}####1####2####3{\unexpanded{#3}}% }% \def\csv@do##1{% \ifcsndefFT{##1@default@ds}{}{% \ifcpt@verbose \cpt@warn{Unknown option handler for family \MsgBrk '##1' replaced}% \fi }% \reserved@e{##1}% \csn@def{##1@default@na}{#2}% }% \csv@@parse*[,]\cpt@currfams } \robust@def*\cpt@define@default@ds<#1>#2{% \csn@def{#1@default@ds}##1##2##3{#2}% \protected\def\cpt@define@default@ds<##1>##2{% \cpt@err{'\string\XDeclareOption*' multiply defined in \MsgBrk\@cls@pkg\space'\@currname'}{Multiple star variant of \noexpand\XDeclareOption in \@cls@pkg\@space'\@currname'.}% }% } \RecoverAtRequirePackage\cpt@define@default@ds \new@def*\cpt@optionlist#1{% \ifcsndefFT{opt@#1}{}{\unexpanded\cptsevenxp{\usename{opt@#1}}}% } \newletcs\cpt@processedoptions\@empty \robust@def*\XProcessOptions{% \cpt@beforeprocessoptions \let\cpt@beforeprocessoptions\relax \cpt@inpoxtrue \let\@fileswith@pti@ns\@badrequireerror \edef\cpt@testname{\@currname.\@currext}% \ifx\cpt@testname\cpt@documentclass \let\@unusedoptionlist\cpt@classoptionslist \fi \edef\cpt@classoptions{% \ifx\cpt@testname\cpt@documentclass\else \expandcsonce\cpt@classoptionslist\fi }% \edef\@curroptions{\cpt@optionlist{\@currname.\@currext}}% \ifcsnullTF\@curroptions{} {\cpt@sttrue\cpt@kvnormalize[,]\@curroptions}% \cpt@testst{\cpt@testfam\cpt@processoptions}% } \robust@def*\cpt@processoptions<#1>{% \ifboolTF{cpt@st}{% \cpt@testopt{\cpt@xprocessoptions#1}{}% }{% \cpt@testopt{\cpt@yprocessoptions#1}{}% }% } \robust@def*\cpt@yprocessoptions#1[#2]{% \iflacus{#2}{% \def\cpt@currna{}% }{% \edef\cpt@currna{\cptcommanormalize{#2}}% }% \docommalist{#1}{% \cpt@ypr@cessoptions{##1}% }% \cpt@pr@cessoptions \cpt@pr@cessopti@ns } \robust@def*\cpt@ypr@cessoptions#1{% \def\cpt@currfam{#1}% \def\kv@do##1{% \edef\CurrentOption{\unexpanded{##1}}% \ifcsnullTF\CurrentOption{}{% \cpt@findoption@a \ifdefboolFT{cpt@optfd}{}{% \ifcsndefFT{#1@ds@\cpt@curropt}{}{% \ifcsnullTF\cpt@currna{% \cpt@igoptfalse }{% \oifinset@sp@TF,\cpt@curropt\cpt@currna{% \cpt@igopttrue }{% \cpt@igoptfalse }% }% \cpt@useoption }% }% }% }% \ifxTF\cpt@classoptions\@empty{}{% \ifcsndefFT{#1@declaredoptions}{}{% \ifcsnnullTF{#1@declaredoptions}{}{% \aftercsname{\kv@@parse*}{#1@declaredoptions}% }% }% }% } \robust@def*\cpt@xprocessoptions#1[#2]{% \iflacus{#2}{% \def\cpt@currna{}% }{% \edef\cpt@currna{\cptcommanormalize{#2}}% }% \docommalist{#1}{% \cpt@xpr@cessoptions{##1}% }% \cpt@pr@cessoptions \cpt@pr@cessopti@ns } \robust@def*\cpt@xpr@cessoptions#1{% \def\cpt@currfam{#1}% \edef\DeclaredOptions{\cpt@getdeclaredoptions\cpt@currfam}% \def\kv@do##1{% \edef\CurrentOption{\unexpanded{##1}}% \ifcsnullTF\CurrentOption{}{% \cpt@findoption@b \oifinset@sp@FT,\cpt@curropt\DeclaredOptions{}{% \ifcsndefFT{#1@ds@\cpt@curropt}{}{% \ifcsnullTF\cpt@currna{% \cpt@igoptfalse }{% \oifinset@sp@TF,\cpt@curropt\cpt@currna{% \cpt@igopttrue }{% \cpt@igoptfalse }% }% \cpt@useoption }% }% }% }% \ifcsnullTF\cpt@classoptions{} {\kv@@parse*[,]\cpt@classoptions}% } \robust@def*\cpt@pr@cessoptions{% \def\kv@do##1{% \edef\CurrentOption{\unexpanded{##1}}% \ifcsnullTF\CurrentOption{}{% \cpt@findoption@b \def\csv@do####1{% \def\cpt@currfam{####1}% \ifcsndefTF{\cpt@currfam @ds@\cpt@curropt}{% \ifcsnullTF\cpt@currna{% \cpt@igoptfalse }{% \oifinset@sp@TF,\cpt@curropt\cpt@currna{% \cpt@igopttrue }{% \cpt@igoptfalse }% }% \cpt@useoption }{% \oifinset@sp@TF,\cpt@curropt\XExternalOptions{% \ifindefaultdsTF{\PassOptionsToClass}{% \cpt@use@default@ds }{% \ifindefaultdsFT{\PassOptionsToPackage}{}{% \cpt@use@default@ds }% }% }{% \cpt@addto@undef@opts \cpt@use@default@ds }% }% }% \csv@@loop*[,]\cpt@currfams }% }% \ifcsnullTF\@curroptions{}{\kv@@parse*[,]\@curroptions}% } \robust@def*\cpt@pr@cessopti@ns{% \let\CurrentOption\@empty \undefcs\cpt@classoptions \let\@fileswith@pti@ns\@@fileswith@pti@ns \cpt@olddxfalse \AtEndOfPackage{\let\@unprocessedoptions\relax}% \cpt@afterprocessoptions \let\cpt@afterprocessoptions\relax } \robust@def*\ifindefaultdsTF{% \begingroup \def\reserved@e{\@firstoftwo\@secondoftwo}% \cpt@ifin@default@ds } \robust@def*\ifindefaultdsFT{% \begingroup \def\reserved@e{\@secondoftwo\@firstoftwo}% \cpt@ifin@default@ds } \robust@def*\cpt@ifin@default@ds#1{% \let\xp\expandcsonce \edef\cpt@ds@a{% {\xp\cpt@currfam}{\xp\cpt@curropt}{\xp\cpt@currval}% }% \edef\cpt@ds@b{\cptmakecs{\cpt@currfam @default@ds}}% \edef\cpt@ds@c{% \unexpanded\cptsevenxp{\expandafter\cpt@ds@b\cpt@ds@a}% }% \cptexpanded{% \endgroup \cpt@csexit\cpt@ds@a\cpt@csexit\cpt@ds@b\cpt@csexit\cpt@ds@c \ifinsetTF{\detokenize{#1}}{\cptoxdetok\cpt@ds@c}% \xp\reserved@e }% } \robust@def*\cpt@use@default@ds{% \begingroup \let\xp\expandcsonce \ifcsndefTF{\cpt@currfam @default@na}{}{% \csn@def{\cpt@currfam @default@na}{}% }% \toks@{\default@ds}% \ifcsndefFT{\cpt@currfam @default@ds}{}{% \edef\cpt@tempa{\expandcsnonce{\cpt@currfam @default@na}}% \oifinset@sp@TF,\cpt@curropt\cpt@tempa{}{% \ifindefaultdsFT{define/.code=}{% \toks@\expandafter{\cpt@ds@c}% }{% \ifindefaultdsFT{/.end}{% \cpt@err{I can't find '/.end' in^^J'\cptoxdetok\cpt@ds@c}\@ehc }{% \cptexpandmacro\cpt@currval\curr@val \despacecontent\curr@val \def\cpt@tempb{\XDeclareBooleanOption}% \let\cmd\@empty \oifstrcmpTF{true}\curr@val{}{% \oifstrcmpTF{false}\curr@val{}{% \def\cpt@tempb{\XDeclareCommandOption}% \def\cmd{cmd}% }% }% \def\cpt@tempa##1define/.code=##2/.end##3\cpt@nil{% \cptexpanded{\toks@{% \unexpanded{##1##3}% \cpt@tempb<\cpt@currfam>{\cpt@curropt}[\xp\curr@val]% (\cmd\@currname @){\unexpanded{##2}}% \XExecuteOptions<\cpt@currfam>{\cpt@curropt=\xp\curr@val}% }}% }% \expandafter\cpt@tempa\cpt@ds@c\cpt@nil }% }% }% }% \expandafter\endgroup\the\toks@ } \robust@def*\XExecuteOptions{% \cpt@inpoxfalse \cpt@testfam\cpt@executeoptions } \robust@def*\cpt@executeoptions<#1>#2{% \cpt@testopt{\cpt@ex@cuteoptions{#1}{#2}}{}% } \robust@def*\cpt@ex@cuteoptions#1#2[#3]{% \def\cpt@currna{#3}% \ifcsnullTF\cpt@currna{}{% \cpt@sttrue\cpt@csvnormalize[,]\cpt@currna }% \edef\cpt@curroptvals{\unexpanded{#2}}% \ifcsnullTF\cpt@curroptvals{}{% \cpt@sttrue\cpt@kvnormalize[,]\cpt@curroptvals }% \def\csv@do##1{% \cpt@ex@cuteopti@ns{##1}% }% \csv@@parse[,]{#1}% \cpt@olddxfalse \undefcs\ExecutedOptions \undefcs\cpt@execwarnlist } \robust@def*\cpt@ex@cuteopti@ns#1{% \def\cpt@currfam{#1}% \ifnum\cpt@optdepth=\z@pt \csn@def{\cpt@currfam @executedoptions}{}% \csn@def{\cpt@currfam @exec@warnlist}{}% \fi \edef\DeclaredOptions{\cpt@getdeclaredoptions\cpt@currfam}% \def\kv@do##1{% \edef\CurrentOption{\unexpanded{##1}}% \ifcsnullTF\CurrentOption{}{% \cpt@findoption@b \edef\ExecutedOptions{% \expandcsnonce{\cpt@currfam @executedoptions}% }% \edef\cpt@execwarnlist{% \expandcsnonce{\cpt@currfam @exec@warnlist}% }% \oifinset@sp@TF,\cpt@curropt\cpt@currna{}{% \cpt@igoptfalse \oifinset@sp@TF,\cpt@curropt\DeclaredOptions{% \oifinset@sp@TF,\cpt@curropt\ExecutedOptions{% \oifinset@sp@TF,\cpt@curropt\cpt@execwarnlist{}{% \iftogTF{biboolopts}{}{% \ifcpt@verbose \cpt@info{Option '\cpt@curropt' of family '\cpt@currfam'\MsgBrk multiply submitted to \string\XExecuteOptions:\MsgBrk re-executed}% \fi }% \aftercsname{\cptgaddtolist*} {\cpt@currfam @exec@warnlist}\cpt@curropt }% }{% \aftercsname{\cptgaddtolist*} {\cpt@currfam @executedoptions}\cpt@curropt }% \cpt@useoption }{% \cpt@addto@undecl@opts }% }% }% }% \kv@@loop*[,]\cpt@curroptvals } \robust@def*\XExecuteAliasOption#1{% \cpt@testopt{\cpt@executealiasoption#1}{}% } \robust@def*\cpt@executealiasoption#1[#2]{% \edef\reserved@a{\ifblankTF{#2} {\expandcsonce\cpt@currval}{\unexpanded{#2}}}% \cpt@inpoxfalse \cptexpandsecond\cpt@executeoptions {<\cpt@currfam>{#1=\expandcsonce\reserved@a}}\relax } \robust@def\cpt@findoption@a{% \cpt@optfdfalse \def\kv@do##1{% \ifblankTF{##1}{}{% \xifinsetTF{=}{\detokenize{##1}}{% \cpt@splitoption##1=\opt@split@nil }{% \edef\cpt@curropt{\unexpanded{##1}}% \let\cpt@currval\@empty }% \ifx\cpt@curropt\CurrentOption \cpt@optfdtrue\loopbreak \edef\OptionFound{\unexpanded{##1}}% \else \let\cpt@curropt\@empty \let\OptionFound\@empty \fi }% }% \kv@@loop*[,]\cpt@classoptions } \robust@def\cpt@findoption@b{% \let\OptionFound\CurrentOption \xifinsetTF{=}{\cptoxdetok\CurrentOption}{% \expandafter\cpt@splitoption\CurrentOption=\opt@split@nil \let\CurrentOption\cpt@curropt }{% \let\cpt@curropt\CurrentOption \let\cpt@currval\@empty }% } \robust@def\cpt@splitoption#1=#2\opt@split@nil{% \def\cpt@curropt{#1}% \ifinsetTF{=\opt@split@nil}{#2\opt@split@nil}{% \begingroup \defpass\cpt@tempa##1=##2\opt@split@nil{\endgroup \edef\cpt@currval{\unexpanded\expandafter{\@gobble##1}}% }% .#2\opt@split@nil }{% \edef\cpt@currval{\unexpanded{#2}}% }% } \robust@def*\cpt@useoption{% \ifdefboolFT{cpt@inpox}{}{% \oifinset@sp@TF,\OptionFound\cpt@processedoptions{}{% \cptgaddtolist*\cpt@processedoptions\OptionFound }% \oifinset@sp@TF,\CurrentOption\cpt@processedoptions{}{% \cptgaddtolist*\cpt@processedoptions\CurrentOption }% \ifcsnullTF\OptionFound{}{\cpt@removecurroption\OptionFound}% \ifxTF\OptionFound\CurrentOption{}{% \cpt@removecurroption\CurrentOption }% }% \ifboolTF{cpt@igopt}{}{% \ifcsndefFT{\cpt@currfam @ds@\cpt@curropt}{}{% \ifboolTF{cpt@olddx}{% \usename{\cpt@currfam @ds@\cpt@curropt}% }{% \ifcsnullTF\cpt@currval{% \cptthreexp\cpt@usedefault \csname\cpt@currfam @ds@\cpt@curropt @default\endcsname\cpt@nil }{% \cpt@useoption@a }% }% }% }% } \robust@def*\cpt@useoption@a{% \cpt@pushstate\XExecuteOptions\cpt@optionstate\cpt@optdepth \cptexpandargonce{\usename{\cpt@currfam @ds@\cpt@curropt}}% \cpt@currval\relax \cpt@popstate\XExecuteOptions\cpt@optdepth } % Only 'article', 'report', 'memoir' options have been added % to \XExternalOptions. Other external options (eg, those of % script and KOMA-Script classes) haven't been added. \newcommand*\XExternalOptions{% 10pt,11pt,12pt,14pt,17pt,20pt,25pt,30pt,36pt,48pt,60pt,% a0paper,a1paper,a2paper,a3paper,a4paper,a6paper,% b0paper,b1paper,b2paper,b3paper,b4paper,b5paper,b6paper,% letterpaper,legalpaper,executivepaper,landscape,oneside,% twoside,draft,final,titlepage,notitlepage,onecolumn,% twocolumn,leqno,fleqn,openbib,openright,openleft,openany,% article,ms,showtrims,oldfontcommands,extrafontsizes,noetex% } \robust@def*\AddToExternalOptions#1{% \cptfiltermergecsv[,]\XExternalOptions{#1}\nofilter } \robust@def*\RemoveFromExternalOptions#1{% \cptfilterremovecsv[,]\XExternalOptions{#1}\nofilter } \robust@def*\cpt@addto@undecl@opts{% \edef\everymergeitem##1{\@space##1}% \cptexpandarg{\cptfiltermergekv[;]\cpt@undeclaredopts}% {\cpt@currfam,\cpt@curropt,\cpt@currval}\nofilter } \robust@def*\cpt@addto@undef@opts{% \edef\everymergeitem##1{\@space##1}% \oifinset@sp@TF,\cpt@curropt\XExternalOptions{}{% \cptexpandarg{\cptfiltermergekv[;]\cpt@undefinedopts}% {\cpt@currfam,\cpt@curropt,\cpt@currval}\nofilter }% } \AfterStartOfDocument{\AtEndDocument{% \ifdefFT\cpt@undeclaredopts{}{% \ifcsnullTF\cpt@undeclaredopts{}{% \despacecontent\cpt@undeclaredopts \cpt@warn{% Undeclared options found in \string\XExecuteOptions \MsgBrk (family,option,value): ^^J\expandcsonce\cpt@undeclaredopts }% }% }% \ifdefFT\cpt@undefinedopts{}{% \ifcsnullTF\cpt@undefinedopts{}{% \despacecontent\cpt@undefinedopts \cpt@warn{% Undefined options (family,option,value): \MsgBrk\expandcsonce\cpt@undefinedopts \MsgBrk Default action already taken in each case }% }% }% }} \robust@def*\cpt@usedefault#1#2\cpt@nil{% \ifmacroTF{#1}{% \edef\cpt@tempa{\cptremovescape#1}% }{% \cpt@notcserr{#1}% }% \edef\cpt@tempb{\cpt@currfam @ds@\cpt@curropt}% \@onelevel@sanitize\cpt@tempb \ifxTF\cpt@tempa\cpt@tempb{% \begingroup \csn@def{\cpt@currfam @ds@\cpt@curropt}##1{% \toks@{\def\cpt@currval{##1}}% }% \usename{\cpt@currfam @ds@\cpt@curropt @default}% \expandafter\endgroup\the\toks@ \cpt@useoption@a }{% \cpt@warn{Non-standard default function for option '\expandcsonce\cpt@curropt':\MsgBrk Executed anyway}% \cpt@pushstate\XExecuteOptions\cpt@optionstate\cpt@optdepth \usename{\cpt@currfam @ds@\cpt@curropt @default}\relax \cpt@popstate\XExecuteOptions\cpt@optdepth }% } \robust@def*\cpt@optionstate{% \cpt@currfams,\cpt@curroptvals,\cpt@currfam,\cpt@currna,% \cpt@curropt,\cpt@currval,\CurrentOption,\OptionFound,% \ifcpt@inpox,\ifcpt@optfd,\ifcpt@igopt,\DeclaredOptions,% \ExecutedOptions } \robust@def*\cpt@removecurroption#1{% \cptexpandargonce{\cptfilterremovekv[,]% \@unusedoptionlist}{#1}\nofilter } \robust@def*\cpt@cleanup#1{% \ifmacroTF{#1}{}{\cpt@notcserr{#1}}% \BeforeStartOfDocument{% \ifdefFT#1{}{% \ifcsnullTF#1{}{% \ifcsnullTF\@unusedoptionlist{}{% \def\csv@do##1{% \xifinsetTF{,\detokenize{##1},}% {,\cptoxdetok\@unusedoptionlist,}{% \cpt@removecurroption{##1}% }% }% \csv@@parse*[,]#1% }% }% }% \globalize\@unusedoptionlist \def#1{}% }% } \BeforeStartOfDocument{% \cpt@cleanup\cpt@processedoptions } \robust@redef*\@fileswith@pti@ns#1[#2]#3[#4]{% \begingroup \edef\fileopts{\unexpanded{#2}}% \ifcsnullTF\fileopts{}{\cpt@sttrue\cpt@kvnormalize[,]\fileopts}% \def\fileswithopts##1##2{% \noexpand\@onefilewithoptions{##1}% [\expandcsonce\fileopts]\unexpanded{[#4]##2}% }% \def\file@withopts##1{\cptpassexpanded{\toks@{##1}}}% \toks@{}% \ifxTF#1\@clsextension{% \ifx\@classoptionslist\relax \xdef\@classoptionslist{\expandcsonce\fileopts}% \file@withopts{\fileswithopts{#3}{#1\@documentclasshook}}% \else \file@withopts{\fileswithopts{#3}{#1}}% \fi }{% \edef\cpt@tempa{\cptzapspaces{#3}}% \DiscardEmptyEntry \def\csv@do##1{% \file@withopts{\the\toks@\fileswithopts{##1}\@pkgextension}% }% \csv@@loop*\cpt@tempa }% \expandafter\endgroup\the\toks@ } \robust@redef*\@onefilewithoptions#1[#2][#3]#4{% \@pushfilename \xdef\@currname{#1}% \global\let\@currext#4% \letcsntocs{\@currname.\@currext-h@@k}\@empty \let\CurrentOption\@empty \@reset@ptions \makeatletter \defpass\reserved@a{% \@ifl@aded\@currext{#1}{% \cpt@ifoptions\@currext{#1}{#2}{}{% \edef\reserved@a{\cpt@optionlist{#1.\@currext}}% \@onelevel@sanitize\reserved@a \ltx@err{Option clash for \@cls@pkg\space #1}{% The package #1 has already been loaded with options:\MsgBrk \space\space[\reserved@a].\MsgBrk There has now been an attempt to load it with options \MsgBrk\space\space[\unexpanded{#2}].\MsgBrk Adding the global options:\MsgBrk \space\space'\reserved@a,\unexpanded{#2}'\MsgBrk to your \noexpand\documentclass declaration may fix this. }% }% }{% \@pass@ptions\@currext{#2}{#1}% \gletcsntocs{ver@\@currname.\@currext}\@empty \InputIfFileExists{\@currname.\@currext}{}{% \@missingfileerror\@currname\@currext }% \let\@unprocessedoptions\@@unprocessedoptions \usename{\@currname.\@currext-h@@k}% \undefcsn{\@currname.\@currext-h@@k}% \@unprocessedoptions }% \def\cpt@tempa####1 v####2 ####3\@nil####4{% \edef####4{'####1\ifblankTF{####2}{}{ v####2}'}% }% \cpt@tempa#3 v \@nil\cpt@tempb \cptthreexp\cpt@tempa\csname ver@#1.\@currext \expandafter\endcsname\@space v \@nil\cpt@tempc \@ifl@ter\@currext{#1}{#3}{}{% \cptexpandarg\AtEndDocument{% \ltx@warn{% You requested,\on@line, version\MsgBrk \cpt@tempb\@space of \@cls@pkg\@space #1,\MsgBrk but only version \cpt@tempc\MsgBrk is available }% }% }% \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi \@popfilename \@reset@ptions }% } \robust@def*\cpt@removevalues#1{% \docommalist{#1}{\cpt@rem@vevalues{##1}}% } \robust@def*\cpt@rem@vevalues#1{% \ifxTF#1\@empty\gobble@to@relax\relax \xifinsetTF{=}{\cptoxdetok{#1}}{}\gobble@to@relax \begingroup \def\cpt@resa{}% \def\cpt@resb##1=##2\cpt@nil{% \edef\cpt@resa{\csliststack,\cpt@resa\unexpanded{##1}}% }% \docommalist*{#1}{\cpt@resb##1=\cpt@nil}% \let#1\cpt@resa \postgroupdef#1\endgroup \cpt@relax } \robust@redef*\ExecuteOptions#1{% \pushfunctions\ExecuteOptions\CurrentOption\cpt@optdepth \edef\CurrentOption{\unexpanded{#1}}% \cpt@sttrue\cpt@kvnormalize[,]\CurrentOption \cpt@removevalues\CurrentOption \docommalist*\CurrentOption{% \def\CurrentOption{##1}% \csname ds@##1\endcsname }% \popfunctions\ExecuteOptions\cpt@optdepth } \robust@redef\@pass@ptions#1#2#3{% \begingroup \ifsingletokenTF{#2}{% \ifmacroTF{#2}{% \let\@expand\expandcsonce }{% \let\@expand\unexpanded }% }{% \let\@expand\unexpanded }% \ifcsndefTF{opt@#3.#1}{% \ifblankTF{#2}{}{% \cptexpandarg{\cptexpandsecond{\cptfiltermergekv[,]}% {\cptmakecs{opt@#3.#1}}}{\@expand{#2}}{}% }% }{% \csn@edef{opt@#3.#1}{\@expand{#2}}% }% \globalizecsn{opt@#3.#1}% \endgroup } \robust@redef*\OptionNotUsed{% \ifxTF\@currext\@clsextension{% \cptexpandargonce{\cptfiltermergekv[,]% \@unusedoptionlist}\CurrentOption\nofilter }{}% } \robust@redef*\@use@ption{% \oifinset@sp@FT,\CurrentOption\@unusedoptionlist{}{% \cptexpandargonce{\cptfilterremovekv[,]% \@unusedoptionlist}\CurrentOption\nofilter }% \csname ds@\CurrentOption\endcsname } \let\@@fileswith@pti@ns\@fileswith@pti@ns \robust@redef*\ProcessOptions{% \pushfunctions\ProcessOptions\CurrentOption\cpt@optdepth \cpt@sttrue\cpt@csvnormalize[,]\@declaredoptions \cpt@sttrue\cpt@kvnormalize[,]\@classoptionslist \edef\@curroptions{\cpt@optionlist{\@currname.\@currext}}% \cpt@sttrue\cpt@kvnormalize[,]\@curroptions \cpt@removevalues{\@classoptionslist,\@curroptions}% \let\ds@\@empty \cpt@ifstar\@xprocess@ptions\@process@ptions } \robust@redef*\@process@ptions{% \edef\@curr@ptions{% \ifx\@currext\@clsextension\else\expandcsonce \@classoptionslist,\fi\expandcsonce\@curroptions }% \docommalist*\@declaredoptions{% \def\CurrentOption{##1}% \oifinset@sp@TF,\CurrentOption\@curr@ptions{% \@use@ption \letcsntocs{ds@##1}\@empty }{}% }% \@process@pti@ns } \robust@redef*\@xprocess@ptions{% \ifxTF\@currext\@clsextension{}{% \docommalist*\@classoptionslist{% \def\CurrentOption{##1}% \oifinset@sp@TF,\CurrentOption\@declaredoptions{% \@use@ption \letcsntocs{ds@##1}\@empty }{}% }% }% \@process@pti@ns } \robust@redef*\@process@pti@ns{% \docommalist*\@curroptions{% \def\CurrentOption{##1}% \ifcsndefTF{ds@##1}\@use@ption{\@use@ption\default@ds}% }% \docommalist*\@declaredoptions{\letcsntocs{ds@##1}\relax}% \popfunctions\ProcessOptions\cpt@optdepth \let\@fileswith@pti@ns\@@fileswith@pti@ns \AtEndOfPackage{\let\@unprocessedoptions\relax}% } \cptpassunexpanded{% \begingroup \def\cpt@tempa{\endgroup \gnewletcs\cpt@kernelDeclareOption\DeclareOption \gnewletcs\cpt@kernelProcessOptions\ProcessOptions \gnewletcs\cpt@kernelExecuteOptions\ExecuteOptions \gdef\DeclareOption{\cpt@olddxtrue\XDeclareOption}% \gdef\ProcessOptions{\cpt@olddxtrue\XProcessOptions}% \gdef\ExecuteOptions{\cpt@olddxtrue\XExecuteOptions}% \AtEndOfPackage{% \ifcpt@usepox\else \def\documentclass{% \let\documentclass\@twoclasseserror \if@compatibility\else \def\usepackage{% \gletcs\DeclareOption\cpt@kernelDeclareOption \gletcs\ProcessOptions\cpt@kernelProcessOptions \gletcs\ExecuteOptions\cpt@kernelExecuteOptions \cpt@olddxfalse \RequirePackage }% \fi \@fileswithoptions\@clsextension }% \fi }% }% \ifdefTF\cpt@documentclass\endgroup\cpt@tempa } \cptonlypreamble{% \cptonlypreamble,\cptloadpackages,\ifpackagewithoptionsTF, \ifclasswithoptionsTF,\cpt@ifoptions, \cptpushcatcodes,\cptpopcatcodes,\UseNormalCatcodes, \UseNorm@lCatcodes,\StyleFilePurpose,\StyleFileInfo, \AfterEndOfStyleFile,\StyleFileRCSInfo,\SetStyleFileMessages, \XDeclareOption,\XDeclareOptions,\XDeclareCommandOption, \XDeclareCommandOptions,\XDeclareBooleanOption, \XDeclareBooleanOptions,\XDeclareBiBooleanOptions, \XDeclareSwitchOption,\XDeclareSwitchOptions, \XProcessOptions,\XExecuteOptions,\XExecuteAliasOption, \cpt@processedoptions,\cpt@optionlist,\cpt@findoption@a, \cpt@findoption@b,\cpt@processoptions,\cpt@xprocessoptions, \cpt@yprocessoptions,\cpt@pr@cessoptions,\BeforeStartOfDocument, \AfterStartOfDocument,\XInvalidOptionHandler,\XDeclareInvalidOption, \XDeclareInvalidOptions,\XUnknownOptionHandler,\XExternalOptions } \XDeclareBiBooleanOptions{verbose,silent}[true](cpt@){}{} \XDeclareBiBooleanOptions{draft,final}[true](cpt@){}{} \XDeclareCommandOptions{% option-stack-limit,optionstacklimit,key-stack-limit, keystacklimit,key-depth-limit,keydepthlimit }[4](cpt@){% \xdef\cpt@optionstacklimit{\number#1}% } \XDeclareBooleanOption{usepox}[true](cpt@){% \ifcpt@usepox \AtEndOfPackage{% \gdef\DeclareOption{\cpt@olddxtrue\XDeclareOption}% \gdef\ProcessOptions{\cpt@olddxtrue\XProcessOptions}% \gdef\ExecuteOptions{\cpt@olddxtrue\XExecuteOptions}% }% \fi } \XDisableOptions*{draft,final} \XDeclareOption*{\cpt@warn{Unknown option '\CurrentOption' ignored}} \XExecuteOptions{% verbose=false,usepox=true,optionstacklimit=4 }\relax \XProcessOptions*\relax \cptpopcatcodes \cptrestorecatcodes \declarefutureletset[fl@]{lbracket,star,rquote} \endinput %% End of file catoptions.sty %%