summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/catoptions/README7
-rw-r--r--Master/texmf-dist/doc/latex/catoptions/catoptions-guide.pdfbin448712 -> 450616 bytes
-rw-r--r--Master/texmf-dist/doc/latex/catoptions/catoptions-guide.tex19
-rw-r--r--Master/texmf-dist/tex/latex/catoptions/catoptions-guide.cfg5
-rw-r--r--Master/texmf-dist/tex/latex/catoptions/catoptions.sty132
5 files changed, 65 insertions, 98 deletions
diff --git a/Master/texmf-dist/doc/latex/catoptions/README b/Master/texmf-dist/doc/latex/catoptions/README
index 9ba095695ed..424170cc7d4 100644
--- a/Master/texmf-dist/doc/latex/catoptions/README
+++ b/Master/texmf-dist/doc/latex/catoptions/README
@@ -1,5 +1,9 @@
This is the README file for the 'catoptions' package.
+VERSION
+
+Version 0.2.7b, 2011/12/17
+
SUMMARY
The 'catoptions' package changes package loading internals so
@@ -34,8 +38,5 @@ RELATED PACKAGES
The catcode section of the 'catoptions' package is based on the
'pcatcode' package by Michael J. Downes and David M. Jones.
-VERSION
-
-Version 0.2.7a, 2011/12/07
diff --git a/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.pdf b/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.pdf
index 5410aba8d66..be8a7cfe432 100644
--- a/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.pdf
+++ b/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.tex b/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.tex
index 71593145d43..553438cd5b1 100644
--- a/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.tex
+++ b/Master/texmf-dist/doc/latex/catoptions/catoptions-guide.tex
@@ -26,7 +26,7 @@
This manual doesn't, as yet, explain all the currently available features and commands of
the \pkg'{catoptions}. This manual continues to evolve.
}
-\version{0.2.7a}
+\version{0.2.7b}
\titleurl{http://mirror.ctan.org/macros/latex/contrib/catoptions/}
\author{Ahmed Musa \Email{amusa22@gmail.com}\\Preston, Lancashire, UK}
@@ -61,7 +61,7 @@
\docsection(sec:packageloading){Loading the package}
-\newfootnote{1}{%
+\ltsnewfootnote{1}{%
The user interfaces of \ffx'{\XDeclareOption, \XExecuteOptions, \XProcessOptions} are similar to those of \hhx'{\DeclareOption, \ExecuteOptions, \ProcessOptions} but they aren't the same. See \sref{sec:options-parse}.
}
The \pkg'{catoptions} can be loaded in class and style files and in documents (before or after \hx{\documentclass}) with the options described in \sref{sec:pkg-options}. If the package is loaded before \hx{\documentclass}, it will, by default, use the options parser of the package in place of \latex's options parsing scheme (namely, the more robust commands \ffx'{\XDeclareOption, \XExecuteOptions, \XProcessOptions} in place of \latex's native commands \hhx'{\DeclareOption, \ExecuteOptions, \ProcessOptions})\usefootnote{1}. In that case, the legacy commands \hhx'{\DeclareOption, \ExecuteOptions, \ProcessOptions} are aliased to \ffx'{\XDeclareOption, \XExecuteOptions, \XProcessOptions}, respectively. The latter set of commands do immediately recognize that they have to deal with option functions that are based on the kernel's syntax and semantics. This allows expandable options and option values (together with options with spaces in their names) to be passed via \hx{\documentclass}---if \pkg{catoptions} is loaded before \hx{\documentclass}. This also implies that existing packages can use the options parsing scheme of \pkg'{catoptions} without modifying the packages.
@@ -318,7 +318,7 @@ The \unstform of the macro \fx{\XDeclareOption} declares an option that can be u
\XDeclareOption{leftmargin}[.5\hsize]{\setlength\leftmargin{#1}}|xwmlabel(mac:leftmargin)
\finish{example}
-\newfootnote{2}{%
+\ltsnewfootnote{2}{%
The commands \ffx'{\XDeclareBooleanOption, \XDeclareBooleanOptions, \XDeclareBiBooleanOptions} allow the user to define new boolean options without the need to first initialize the booleans with \hx{\newif} or \fx{\cptnewbool} as seen here.
}
@@ -419,7 +419,7 @@ In the parlance of the \pkg'{catoptions,ltxtools}, a switch can assume only one
\finish{newmacro}
\fxim*{\ifswitchTF,\ifswitchFT}
-\newfootnote{4}{%
+\ltsnewfootnote{4}{%
Because of the need to do, \eg, \fx{\let\swa\cpttrue} and \hx{\if}\unskip\fx{\swa} for any given switch \fx{\swa}, switches, unlike toggles, don't have their own separate namespace and it is all too easy to redefine an existing switch.
}
Note that here \ang{switch} has no escape character, unless it evaluates to a switch name. So, after defining \fx{\def\swa{00}} we could then do \fx{\ifswitchTF{swa}{true}{false}}. It is somewhat risky to introduce new switches with \hx{\def} or \hx{\let}\usefootnote{4}. It is advisable to always use \fx{\newswitch} instead. It has the syntax
@@ -460,7 +460,7 @@ The command \fx{\XDeclareSwitchOptions} is similar to \fx{\XDeclareSwitchOption}
\finish{newmacro}
\fxim*{\XUnknownOptionHandler}
-\newfootnote{3}{%
+\ltsnewfootnote{3}{%
Declaring a default handler for each unknown option is, of course, inefficient.
We have, therefore, provided provisions for declaring such handers for only families of options.
}
@@ -681,6 +681,7 @@ The commands \ffx'{\BeforeProcessOptions,\AfterProcessOptions} can be used to pr
\loadsub{subpkg1,subpkg2,subpkg3}
\finish{example}
+%\enlargethispage{2\baselineskip}
\bigskip
\docsubsection(sec:ifoptiondef){Testing if an option is defined}
@@ -989,6 +990,7 @@ The following provides a simple application of \fx{\indrisloop}, which I posted
\end{|R(document)}
\finish{example}
+%\bigskip
\docsection(sec:tsvparse)<Iterating tokenwise>{Parsing \headquoted{tsv} lists}
\start+{newmacro}[\tsv@@parse,\tsv@@loop]
@@ -1023,14 +1025,17 @@ In the commands \ffx'{\tsv@loop,\tsv@@parse}, it is always possible to break out
\tsv@@loop{ a {b} {c} }
\finish{example}
-
+
\docsection(sec:version-hist){Version history}
The following change history highlights significant changes that affect user utilities and interfaces; mutations of technical nature are not documented in this section. The numbers on the right-hand side of the following lists are section numbers; the \stsign means the subject features in the package but is not reflected anywhere in this user guide.
\begin{versionhist}
+ \begin{version}{0.2.7b}{2011/12/17}
+ \item Renamed the user commands \ffx'{\dofunclist, \stripallouterbraces, \stripouterbraces} to \ffx'{\cptdofunclist, \cptstripallouterbraces, \cptstripNouterbraces}, respectively.\vsecref*
+ \end{version}
\begin{version}{0.2.7a}{2011/12/07}
- \item Renamed the user commands \ffx'{\newvariables,\docommalist, \iflacus...\then} to \ffx'{\cptnewvariables,\cptdocommalist, \iflacus...\dolacus}, respectively.\vsecref*
+ \item Renamed the user commands \ffx'{\newvariables,\docommalist, \iflacus...\then} to \ffx'{\cptnewvariables,\cptdocommalist, \iflacus...\dolacus}, respectively, to reduce the chances of name clashes with other packages or user code. The old names haven't actually been removed yet, but will disappear in the future.\vsecref*
\end{version}
\begin{version}{0.2.7}{2011/10/10}
\item Introduced the commands \ffx'{\BeforeProcessOptions,\AfterProcessOptions} \vsecref{sec:before-proc-options}
diff --git a/Master/texmf-dist/tex/latex/catoptions/catoptions-guide.cfg b/Master/texmf-dist/tex/latex/catoptions/catoptions-guide.cfg
index ab07f1f6b87..538fac72380 100644
--- a/Master/texmf-dist/tex/latex/catoptions/catoptions-guide.cfg
+++ b/Master/texmf-dist/tex/latex/catoptions/catoptions-guide.cfg
@@ -1,7 +1,8 @@
\ProvidesFile{catoptions-guide.cfg}%
- [2011/12/07 v0.2.7a Configuration file for catoptions-guide.tex (AM)]
+ [2011/12/17 v0.2.7b Configuration file for catoptions-guide.tex (AM)]
+
\cptloadpackages{%
- n-xwatermark|printwatermark;
+ xwatermark|printwatermark;
array;
colortbl;
ltablex;
diff --git a/Master/texmf-dist/tex/latex/catoptions/catoptions.sty b/Master/texmf-dist/tex/latex/catoptions/catoptions.sty
index 86d5a87a1dd..1678941a59a 100644
--- a/Master/texmf-dist/tex/latex/catoptions/catoptions.sty
+++ b/Master/texmf-dist/tex/latex/catoptions/catoptions.sty
@@ -1,5 +1,5 @@
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
-% This is 'catoptions' package, version 0.2.7a, 2011/12/07. %
+% This is 'catoptions' package, version 0.2.7b, 2011/12/17. %
% %
% The catoptions package changes LaTeX package loading internals %
% so that all subsequently loaded packages can rely on having %
@@ -86,8 +86,14 @@
\catcode126=13
\AtEndOfPackage{%
\newletcsset{%
+ \dofunclist=\cptdofunclist,
\docommalist=\cptdocommalist,
\newvariables=\cptnewvariables,
+ \stripallouterbraces=\cptstripallouterbraces,
+ \stripouterbraces=\cptstripNouterbraces,
+ \gobble@to@relax=\cptgobbletorelax,
+ \cpt@gobbletorelax=\cptgobbletorelax,
+ \cpt@gobbletorelax@fi@endgroup=\cptbgobbletorelax
}%
}
\edef\cpt@hashchar{\string#}
@@ -101,7 +107,7 @@
\chardef\active=13
\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesPackage{catoptions}
- [2011/12/07 v0.2.7a Securing catcodes and parsing options (AM)]
+ [2011/12/17 v0.2.7b Securing catcodes and parsing options (AM)]
\ifcase%
\ifx\eTeXversion\cpt@undefined\z@pt\else
\ifnum\eTeXversion<\tw@\z@pt\else\@ne\fi\fi
@@ -110,7 +116,7 @@
\expandafter\endinput
\fi
% \ifcsdefinable, \cpt@starorlong, \cptcommanormalize, etc,
-% change later:
+% change later on:
\@ifdefinable\ifcsdefinable{\let\ifcsdefinable\@ifdefinable}
\@ifdefinable\ifdefinablelet\relax
\protected\def\ifdefinablelet#1{\ifcsdefinable#1\relax\let#1}
@@ -177,6 +183,9 @@
{\expandafter\newcount\csname#1##1\endcsname}%
}%
}
+\newcommand*\cptnewcounters[2][]{%
+ \cptfor#2\dofor{\newcounter{#1##1}}%
+}
\newcommand*\cptnewdimens[2][]{%
\cptfor#2\dofor{%
\expandafter\ifcsdefinable\csname#1##1\endcsname
@@ -829,7 +838,6 @@
{\detokenize{macro parameter character}}
{\meaning\@let@token}%
}
-
\begingroup
\uccode`\~=`\,%
\uppercase{\endgroup
@@ -960,9 +968,6 @@
\cpt@tempb\cpt@tempa
}
\endgroup
-
-% We need the equivalent of '\protected\let' and we want to be able to
-% do \shelllet\x=\y:
\robust@def*\shelllet#1{\cpt@ifeql{\cpt@shelllet{#1}}{\cpt@shelllet{#1}}}
\robust@def*\cpt@shelllet#1#2{%
\ifblankTF{#2}{%
@@ -989,6 +994,7 @@
\new@def*\ifdocstartedTF{%
\ifdefTF\cpt@docstarted\iofii\iiofii
}
+
\long\def\@gobblethree#1#2#3{}
\long\def\@firstofthree#1#2#3{#1}
\long\def\@secondofthree#1#2#3{#2}
@@ -999,8 +1005,8 @@
\new@def\cpt@car#1#2\car@nil{#1}
\new@def\cpt@cdr#1#2\cdr@nil{#2}
\ifcsdefinable\cpt@relax{\let\cpt@relax\relax}
-\new@def\cpt@gobbletorelax#1\cpt@relax{}
-\new@def\cpt@gobbletorelax@fi@endgroup\fi#1\cpt@relax{\fi\endgroup}
+\new@def\cptgobbletorelax#1\cpt@relax{}
+\new@def\cptbgobbletorelax\fi#1\cpt@relax{\fi\endgroup}
\new@def\cpt@removetonnil#1\cpt@nnil{}
\new@def\cpt@catchtonnil#1\cpt@nnil{#1}
\new@def\cpt@removetodot#1.{}
@@ -1082,7 +1088,7 @@
\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi
{%
\ifnum\cpt@pdfstrcmp{\expandafter\@car\detokenize{#1}\@nil}%
- \leftbracechar=\z@pt
+ \cpt@leftbracechar=\z@pt
\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}{%
\@secondoftwo
@@ -1169,6 +1175,7 @@
\ifdefboolFT{cpt@st}{}{\let#2=\cpt@rsvda}%
}%
}
+% \cptnewvariables{<type>}[<prf>]{<variables>}[<state/value>]
\robust@def*\cptnewvariables#1{\cpt@testopt{\cpt@newvariables{#1}}{}}
\robust@def*\cpt@newvariables#1[#2]#3{%
\edef\reserved@a{\noexpand\cpt@testopt{%
@@ -1182,7 +1189,7 @@
}%
\edef\cpt@tempb{\ifstrcmpTF{#1}{if}{if}{}}%
\cptfor#3\dofor{%
- \ifblankTF{##1}\cpt@gobbletorelax\relax
+ \ifblankTF{##1}\cptgobbletorelax\relax
\ifnamedefTF{\cpt@tempb#2##1}{%
\edef\undefinablecs{\cpt@tempb#2##1}%
\ifstrcmpTF{#1}{tog}{}{\cpt@notdefinable}%
@@ -1319,7 +1326,9 @@
\new@def*\xifdefTF#1{\cptexpandarg\ifdefTF{#1}}
\new@def*\xifdefFT#1{\cptexpandarg\ifdefFT{#1}}
\new@def*\ifcsndefTF#1{%
- \ifblankTF{#1}\@gobble{%
+ \ifblankTF{#1}{%
+ \expandafter\@secondoftwo\@gobble
+ }{%
\ifcsname#1\endcsname
\expandafter\@firstofone
\else
@@ -1361,15 +1370,7 @@
\robust@def*\ltxmsg@info{\@latex@info@no@line}
\robust@def*\ltxmsg@err{\@latex@error}
\robust@redef\cpt@testopt#1#2{\ifnextcharTF[{#1}{#1[{#2}]}}
-% Eg, \def\csa{\cpt@testcharopt\csb<{default}>}
-% \def\csb<#1>{...}
\robust@def*\cpt@testcharopt#1#2#3#4{\ifnextcharTF#2{#1}{#1#2{#3}#4}}
-
-% Expandable \@testopt:
-% Eg, \def\macroa#1{\cpt@xtestopt{#1}\macrob{Mr.}}
-% \def\macrob[#1]#2{#1 #2}
-% \edef\testa{\macroa{John Johnson}}
-% \edef\testb{\macroa[Dr.]{Haiki Heiki}}
\new@def*\cpt@xtestopt#1#2#3{%
\cpt@xifbrack#1\\[\\{#2#1}{#2[{#3}]{#1}}%
}
@@ -1377,10 +1378,6 @@
\ifcat$\detokenize{#1#2}$\expandafter\@firstoftwo
\else\expandafter\@secondoftwo\fi
}
-% Eg, \def\macroa{\cpt@newxtestopt\macrob{Mr.}}
-% \def\macrob[#1]#2{#1 #2}
-% \edef\testa{\expandafter\macroa\activespace{John Johnson}}
-% \edef\testb{\macroa[Dr.]{Haiki Heiki}}
\new@def*\cpt@newxtestopt#1#2#3{%
\ifstrcmpTF{ }{#3}{%
\cpt@newxtestopt#1{#2}%
@@ -1648,7 +1645,7 @@
\gletcs#1\cpt@tempa
\endgroup
}
-\robust@def*\dofunclist{%
+\robust@def*\cptdofunclist{%
\pushnumber\dofunclistdepth
\begingroup
\edef\sav@do{\cptmakecs{sav@do@\cptrm\dofunclistdepth}}%
@@ -1969,8 +1966,6 @@
\expandafter\csv@@loop\reserved@a[#1]{#2}%
\postgroupdef\cptelemnr\endgroup
}
-% Eg, \ifelemcountTF[;](>)[2]{a;b;c}{T}{F};
-% * -> #4 is a macro
\robust@def*\ifelemcountTF{\cpt@teststopt\cpt@ifelemcount@a,}
\robust@def*\cpt@ifelemcount@a[#1]{%
\cpt@testpnopt{\cpt@ifelemcount@b{#1}}=%
@@ -2170,11 +2165,8 @@
\new@def\cpt@iterate\@gobble#1{%
#1\relax\expandafter\cpt@iterate\fi\@gobble{#1}%
}
-\new@def\cptwhilecond#1\fi#2{%
- #1\relax#2\relax\cptswap{\cpt@whilecond{#1\relax#2\relax}\fi}\fi
-}
-\new@def\cpt@whilecond#1\fi{%
- #1\expandafter\cpt@whilecond\else\@gobbletwo\fi{#1}\fi
+\new@def\cptwhileexpr#1\do#2{%
+ #1\cptswap{#2\cptwhileexpr{#1}\do{#2}}\fi
}
\new@def*\cpt@numlt#1<{#1<\numexpr}
\new@def*\cpt@numgt#1>{#1>\numexpr}
@@ -2184,25 +2176,13 @@
\new@def*\cpt@dimeq#1={#1=\dimexpr}
\new@def*\cptwhilenum#1\do#2{%
\ifnum\numexpr\cpt@numlt\cpt@numgt\cpt@numeq#1%
- \cpt@removetonnil<=>\cpt@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%
- \cpt@removetonnil<=>\cpt@nnil#2%
- \expandafter\cpt@whilenum\else
- \expandafter\@gobbletwo\fi{#1}{#2}%
+ \cpt@removetonnil<=>\cpt@nnil\relax
+ \cptswap{#2\cptwhilenum{#1}\do{#2}}\fi
}
\new@def*\cptwhiledim#1\do#2{%
\ifdim\dimexpr\cpt@dimlt\cpt@dimgt\cpt@dimeq#1%
- \cpt@removetonnil<=>\cpt@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%
- \cpt@removetonnil<=>\cpt@nnil#2%
- \expandafter\cpt@whiledim\else
- \expandafter\@gobbletwo\fi{#1}{#2}%
+ \cpt@removetonnil<=>\cpt@nnil\relax
+ \cptswap{#2\cptwhiledim{#1}\do{#2}}\fi
}
\new@def*\ifnumcmpTF#1#{%
\usename{@\ifnum\numexpr\cpt@numlt\cpt@numgt\cpt@numeq#1%
@@ -2555,7 +2535,7 @@
}{%
\ifsingletokenTF{#1}{%
\xifinsetTF{\detokenize{#1}}\cpt@parserlist{%
- #2% Don't put \relax here!
+ #2%
}{%
\cpt@listparsererr{#1}%
}%
@@ -2662,8 +2642,6 @@
\ifblankTF{#2}{0 #3#1}{\cpt@fullexpand{#2}{#3#1}}%
}
\endgroup
-
-% [<fallback>]{<teststr>}{<{str1}{act1}{str2}{act2}...>}
\new@def*\cptifstreqcase#1{\cpt@xtestopt{#1}\cpt@ifstreqcase{}}
\new@def\cpt@ifstreqcase[#1]#2#3{%
\expandafter\cptswapbracefirst\expandafter{#2}%
@@ -2690,7 +2668,6 @@
}%
}%
}
-% [<default act>]{<teststr>}{<{str1}{act1}{str2}{act2}...>}
\new@def*\cptifstrpresentcase#1{\cpt@xtestopt{#1}\cpt@ifstrincase{}}
\new@def\cpt@ifstrincase[#1]#2#3{%
\expandafter\cptswapbracefirst\expandafter{#2}%
@@ -2706,29 +2683,6 @@
\new@def\all@to@endif#1\endif{#1}
\new@def\first@to@endif#1#2\endif{#1}
\new@def*\ifcassenumcmpTF#1#2#3{\ifdimcmpTF#1pt#2pt{#3}}
-% Eg,
-% \edef\x{%
-% \cptifcasse\ifcassestrcmpTF{teststr}
-% {str1}{case1 callback}
-% {str2}{case2 callback}
-% \elseif
-% no match
-% \endif
-% }
-% \edef\x{%
-% \cptifcasse\ifcassenumcmpTF{testnum}
-% {=2}{equal to 2}
-% {<3}{less than 3}
-% {>4}{greater than 4}
-% \elseif
-% no match
-% \endif
-% }
-% The omparator command is any test command that yields
-% <iofii> or <iiofii> but \ifnumcmpTF can't be used directly.
-% Use \ifcassenumcmpTF instead. The user can also define his own
-% logical test command and pass it to \cptifcasse, eg,
-% \def\test#1#2{\ifinsetTF{#2}{#1}}
\new@def*\cptifcasse#1#2{%
\ifstrcmpTF{#1}\elseif{%
\all@to@endif
@@ -2980,7 +2934,6 @@
\csv@@parse[#1]{#3}%
\postgroupdef#2\endgroup
}
-% \cptreplaceoneelement[<parser>]{<cs>}{<search>}{<replace>}
\robust@def*\cptreplaceoneelement{\cpt@teststopt\cpt@replaceoneelement,}
\robust@def\cpt@replaceoneelement[#1]#2#3#4{%
\begingroup
@@ -3128,7 +3081,7 @@
}{}%
\begingroup
\ifcat$\detokenize\expandafter\expandafter\expandafter
- {\expandafter\@gobble#2.}$\cpt@gobbletorelax@fi@endgroup\fi
+ {\expandafter\@gobble#2.}$\cptbgobbletorelax\fi
\def\reserved@e##1#1{%
\edef\reserved@a{\unexpanded\expandafter{\@gobble##1}}%
\ifx\reserved@a\@empty
@@ -3205,17 +3158,17 @@
{#3}{#1}{#2}%
}
\robust@def\cptstripallouterbraces#1#2{%
- \edef#2{\unexpanded\cptthreexp{\cpt@stripallouterbraces{#1}}}%
+ \edef#2{\unexpanded\cptthreexp{\cpt@stripallouterbraces#1\strip@nil}}%
}
\newletcs\cptstripallbr\cptstripallouterbraces
\robust@def\cptstripallouterbracesincs#1{%
\expandafter\cptstripallouterbraces\expandafter{#1}#1%
}
\newletcs\cptstripallbrincs\cptstripallouterbracesincs
-\robust@def\cpt@stripallouterbraces#1{%
+\robust@def\cpt@stripallouterbraces#1\strip@nil{%
\romannumeral\ifbracedTF{#1}{%
\expandafter\ifnullTF\expandafter{\@gobble#1}{%
- \expandafter\@gobble\cpt@stripallouterbraces#1%
+ \expandafter\@gobble\cpt@stripallouterbraces#1\strip@nil
}{0 #1}%
}{0 #1}%
}
@@ -3347,7 +3300,6 @@
\catcode`\{\@ne
\catcode`\}\tw@
}
-% #1 must be a non-parametered macro:
\robust@def*\cptscantokens#1{%
\begingroup
\edef#1{\long\def\string#1{\cptoxdetok{#1}}}%
@@ -3820,6 +3772,7 @@
\RequirePackage{#1}[#2]%
}%
}
+% If package has been loaded with <options>.
% \ifpackagewithoptionsTF{<package>}{<options>}
\robust@def*\ifpackagewithoptionsTF{\cpt@ifoptions\@pkgextension}
\robust@def*\ifclasswithoptionsTF{\cpt@ifoptions\@clsextension}
@@ -3852,6 +3805,7 @@
\ifboolTF{cpt@choicefd}
{\endgroup\@firstoftwo}{\endgroup\@secondoftwo}%
}
+% If package was later loaded (before begin-document).
% \ifpackageloadedlaterTF{<package>}{<true>}{<false>}
\robust@def*\ifpackageloadedlaterTF{\cpt@ifpkgloadedlater\@pkgextension}
\robust@def*\ifclassloadedlaterTF{\cpt@ifpkgloadedlater\@clsextension}
@@ -4025,13 +3979,16 @@
\cpt@normalizelist{#1}{#2}%
}
\ifcsdefinable\normalized@list\relax
+
+\begingroup
+\catcode`\^=3
\robust@gdef\cpt@normalizelist#1#2{%
\begingroup
\let\if@nmlzst\ifcpt@st
\cpt@stchoose{cpt@st}{#2}\reserved@e\cpt@normalizelist
\ifx\reserved@e\@empty
\def\normalized@list{}%
- \cpt@gobbletorelax@fi@endgroup
+ \cptbgobbletorelax
\fi
\cpt@ch@cklistparser{#1}%
\expandafter\setup@parser@nmlz\string#1%
@@ -4044,10 +4001,10 @@
\nmlz@activeequal
\nmlz@spaceletter=%
\nmlz@letterspace=%
- \toks@\expandafter{\the\toks@^?^}%
+ \toks@\expandafter{\the\toks@^?}%
\nmlz@doubleletter=%
\cpt@commaequalerr
- \def\reserved@a##1^?^##2\cpt@nil{\toks@{##1##2}}%
+ \def\reserved@a##1^?##2\cpt@nil{\toks@{##1##2}}%
\expandafter\reserved@a\the\toks@\cpt@nil
}%
\edef\normalized@list{\the\toks@}%
@@ -4061,6 +4018,8 @@
}%
\cpt@relax
}
+\endgroup
+
\def\setup@parser@nmlz#1{%
\begingroup
\uccode`\~=`#1%
@@ -5312,8 +5271,8 @@
\cptdocommalist{#1}{\cpt@rem@vevalues{##1}}%
}
\robust@def*\cpt@rem@vevalues#1{%
- \ifcseqTF#1\@empty\cpt@gobbletorelax\relax
- \xifinsetTF{=}{\cptoxdetok{#1}}{}\cpt@gobbletorelax
+ \ifcseqTF#1\@empty\cptgobbletorelax\relax
+ \xifinsetTF{=}{\cptoxdetok{#1}}{}\cptgobbletorelax
\begingroup
\def\cpt@resa{}%
\def\cpt@resb##1=##2\cpt@nil{%
@@ -5453,6 +5412,7 @@
}%
\ifdefTF\cpt@documentclass\endgroup\cpt@tempa
}
+
\cptonlypreamble{%
\cptonlypreamble,\cpt@getdocumentclass,\cptloadpackages,
\ifpackagewithoptionsTF,\ifclasswithoptionsTF,\cpt@ifoptions,