| 1 |
%% |
| 2 |
%% This is file `kvoptions.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% kvoptions.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Project: kvoptions |
| 12 |
%% Version: 2022-06-15 v3.15 |
| 13 |
%% |
| 14 |
%% Copyright (C) |
| 15 |
%% 2004, 2006, 2007, 2009-2011 Heiko Oberdiek |
| 16 |
%% 2016-2022 Oberdiek Package Support Group |
| 17 |
%% |
| 18 |
%% This work may be distributed and/or modified under the |
| 19 |
%% conditions of the LaTeX Project Public License, either |
| 20 |
%% version 1.3c of this license or (at your option) any later |
| 21 |
%% version. This version of this license is in |
| 22 |
%% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 23 |
%% and the latest version of this license is in |
| 24 |
%% https://www.latex-project.org/lppl.txt |
| 25 |
%% and version 1.3 or later is part of all distributions of |
| 26 |
%% LaTeX version 2005/12/01 or later. |
| 27 |
%% |
| 28 |
%% This work has the LPPL maintenance status "maintained". |
| 29 |
%% |
| 30 |
%% The Current Maintainers of this work are |
| 31 |
%% Heiko Oberdiek and the Oberdiek Package Support Group |
| 32 |
%% https://github.com/ho-tex/kvoptions/issues |
| 33 |
%% |
| 34 |
%% This work consists of the main source file kvoptions.dtx |
| 35 |
%% and the derived files |
| 36 |
%% kvoptions.sty, kvoptions.pdf, kvoptions.ins, kvoptions.drv, |
| 37 |
%% kvoptions-patch.sty, example-mycolorsetup.sty, |
| 38 |
%% kvoptions-test1.tex, kvoptions-test2.tex, |
| 39 |
%% kvoptions-test3.tex, kvoptions-test4.tex, |
| 40 |
%% kvoptions-test4.sty. |
| 41 |
%% |
| 42 |
%% No we don't need the option 'color'. |
| 43 |
%% With color support option 'emphcolor' will dynamically |
| 44 |
%% change the color of \emph statements. |
| 45 |
|
| 46 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 47 |
\catcode13=5 % ^^M |
| 48 |
\endlinechar=13 % |
| 49 |
\catcode35=6 % # |
| 50 |
\catcode39=12 % ' |
| 51 |
\catcode44=12 % , |
| 52 |
\catcode45=12 % - |
| 53 |
\catcode46=12 % . |
| 54 |
\catcode58=12 % : |
| 55 |
\catcode64=11 % @ |
| 56 |
\catcode123=1 % { |
| 57 |
\catcode125=2 % } |
| 58 |
\expandafter\let\expandafter\x\csname [email protected]\endcsname |
| 59 |
\ifx\x\relax % plain-TeX, first loading |
| 60 |
\else |
| 61 |
\def\empty{}% |
| 62 |
\ifx\x\empty % LaTeX, first loading, |
| 63 |
% variable is initialized, but \ProvidesPackage not yet seen |
| 64 |
\else |
| 65 |
\expandafter\ifx\csname PackageInfo\endcsname\relax |
| 66 |
\def\x#1#2{% |
| 67 |
\immediate\write-1{Package #1 Info: #2.}% |
| 68 |
}% |
| 69 |
\else |
| 70 |
\def\x#1#2{\PackageInfo{#1}{#2, stopped}}% |
| 71 |
\fi |
| 72 |
\x{kvoptions}{The package is already loaded}% |
| 73 |
\aftergroup\endinput |
| 74 |
\fi |
| 75 |
\fi |
| 76 |
\endgroup% |
| 77 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 78 |
\catcode13=5 % ^^M |
| 79 |
\endlinechar=13 % |
| 80 |
\catcode35=6 % # |
| 81 |
\catcode39=12 % ' |
| 82 |
\catcode40=12 % ( |
| 83 |
\catcode41=12 % ) |
| 84 |
\catcode44=12 % , |
| 85 |
\catcode45=12 % - |
| 86 |
\catcode46=12 % . |
| 87 |
\catcode47=12 % / |
| 88 |
\catcode58=12 % : |
| 89 |
\catcode64=11 % @ |
| 90 |
\catcode91=12 % [ |
| 91 |
\catcode93=12 % ] |
| 92 |
\catcode123=1 % { |
| 93 |
\catcode125=2 % } |
| 94 |
\expandafter\ifx\csname ProvidesPackage\endcsname\relax |
| 95 |
\def\x#1#2#3[#4]{\endgroup |
| 96 |
\immediate\write-1{Package: #3 #4}% |
| 97 |
\xdef#1{#4}% |
| 98 |
}% |
| 99 |
\else |
| 100 |
\def\x#1#2[#3]{\endgroup |
| 101 |
#2[{#3}]% |
| 102 |
\ifx#1\@undefined |
| 103 |
\xdef#1{#3}% |
| 104 |
\fi |
| 105 |
\ifx#1\relax |
| 106 |
\xdef#1{#3}% |
| 107 |
\fi |
| 108 |
}% |
| 109 |
\fi |
| 110 |
\expandafter\x\csname [email protected]\endcsname |
| 111 |
\ProvidesPackage{kvoptions}% |
| 112 |
[2022-06-15 v3.15 Key value format for package options (HO)]% |
| 113 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 114 |
\catcode13=5 % ^^M |
| 115 |
\endlinechar=13 % |
| 116 |
\catcode123=1 % { |
| 117 |
\catcode125=2 % } |
| 118 |
\catcode64=11 % @ |
| 119 |
\def\x{\endgroup |
| 120 |
\expandafter\edef\csname KVO@AtEnd\endcsname{% |
| 121 |
\endlinechar=\the\endlinechar\relax |
| 122 |
\catcode13=\the\catcode13\relax |
| 123 |
\catcode32=\the\catcode32\relax |
| 124 |
\catcode35=\the\catcode35\relax |
| 125 |
\catcode61=\the\catcode61\relax |
| 126 |
\catcode64=\the\catcode64\relax |
| 127 |
\catcode123=\the\catcode123\relax |
| 128 |
\catcode125=\the\catcode125\relax |
| 129 |
}% |
| 130 |
}% |
| 131 |
\x\catcode61\catcode48\catcode32=10\relax% |
| 132 |
\catcode13=5 % ^^M |
| 133 |
\endlinechar=13 % |
| 134 |
\catcode35=6 % # |
| 135 |
\catcode64=11 % @ |
| 136 |
\catcode123=1 % { |
| 137 |
\catcode125=2 % } |
| 138 |
\def\TMP@EnsureCode#1#2{% |
| 139 |
\edef\KVO@AtEnd{% |
| 140 |
\KVO@AtEnd |
| 141 |
\catcode#1=\the\catcode#1\relax |
| 142 |
}% |
| 143 |
\catcode#1=#2\relax |
| 144 |
} |
| 145 |
\TMP@EnsureCode{1}{14}% ^^A (comment) |
| 146 |
\TMP@EnsureCode{2}{14}% ^^A (comment) |
| 147 |
\TMP@EnsureCode{33}{12}% ! |
| 148 |
\TMP@EnsureCode{39}{12}% ' |
| 149 |
\TMP@EnsureCode{40}{12}% ( |
| 150 |
\TMP@EnsureCode{41}{12}% ) |
| 151 |
\TMP@EnsureCode{42}{12}% * |
| 152 |
\TMP@EnsureCode{44}{12}% , |
| 153 |
\TMP@EnsureCode{45}{12}% - |
| 154 |
\TMP@EnsureCode{46}{12}% . |
| 155 |
\TMP@EnsureCode{47}{12}% / |
| 156 |
\TMP@EnsureCode{58}{12}% : |
| 157 |
\TMP@EnsureCode{62}{12}% > |
| 158 |
\TMP@EnsureCode{91}{12}% [ |
| 159 |
\TMP@EnsureCode{93}{12}% ] |
| 160 |
\TMP@EnsureCode{94}{7}% ^ (superscript) |
| 161 |
\TMP@EnsureCode{96}{12}% ` |
| 162 |
\edef\KVO@AtEnd{\KVO@AtEnd\noexpand\endinput} |
| 163 |
\@ifundefined{define@key}{% |
| 164 |
\RequirePackage{keyval}\relax |
| 165 |
}{} |
| 166 |
\RequirePackage{ltxcmds}[2010/12/02] |
| 167 |
\RequirePackage{kvsetkeys}[2007/09/29] |
| 168 |
\@ifundefined{@x@protect}{% |
| 169 |
\def\@x@protect#1\fi#2#3{% |
| 170 |
\fi\protect#1% |
| 171 |
}% |
| 172 |
\let\@typeset@protect\relax |
| 173 |
}{} |
| 174 |
\@ifundefined{@currname}{% |
| 175 |
\def\@currname{}% |
| 176 |
}{} |
| 177 |
\@ifundefined{@currext}{% |
| 178 |
\def\@currext{}% |
| 179 |
}{} |
| 180 |
\DeclareOption{debugshow}{\catcode\@ne=9 } |
| 181 |
\DeclareOption{patch}{% |
| 182 |
\AtEndOfPackage{% |
| 183 |
\RequirePackage{kvoptions-patch}[2019/11/29]% |
| 184 |
}% |
| 185 |
} |
| 186 |
\ProcessOptions\relax |
| 187 |
\define@key{KVO}{family}{% |
| 188 |
\expandafter\edef\csname KVO@family@% |
| 189 |
\@currname.\@currext\endcsname{#1}% |
| 190 |
} |
| 191 |
\def\KVO@family{% |
| 192 |
\@ifundefined{KVO@family@\@currname.\@currext}{% |
| 193 |
\@currname |
| 194 |
}{% |
| 195 |
\csname KVO@family@\@currname.\@currext\endcsname |
| 196 |
}% |
| 197 |
} |
| 198 |
\define@key{KVO}{prefix}{% |
| 199 |
\expandafter\edef\csname KVO@prefix@% |
| 200 |
\@currname.\@currext\endcsname{#1}% |
| 201 |
} |
| 202 |
\def\KVO@prefix{% |
| 203 |
\ltx@ifundefined{KVO@prefix@\@currname.\@currext}{% |
| 204 |
\@currname @% |
| 205 |
}{% |
| 206 |
\csname KVO@prefix@\@currname.\@currext\endcsname |
| 207 |
}% |
| 208 |
} |
| 209 |
\define@key{KVO}{setkeys}{% |
| 210 |
\expandafter\def\csname KVO@setkeys@% |
| 211 |
\@currname.\@currext\endcsname{#1}% |
| 212 |
} |
| 213 |
\def\KVO@setkeys{% |
| 214 |
\ltx@IfUndefined{KVO@setkeys@\@currname.\@currext}{% |
| 215 |
\setkeys |
| 216 |
}{% |
| 217 |
\csname KVO@setkeys@\@currname.\@currext\endcsname |
| 218 |
}% |
| 219 |
} |
| 220 |
\newcommand*{\SetupKeyvalOptions}{% |
| 221 |
\kvsetkeys{KVO}% |
| 222 |
} |
| 223 |
\newcommand*{\DeclareBoolOption}[2][false]{% |
| 224 |
\KVO@ifdefinable{if\KVO@prefix#2}{% |
| 225 |
\KVO@ifdefinable{\KVO@prefix#2true}{% |
| 226 |
\KVO@ifdefinable{\KVO@prefix#2false}{% |
| 227 |
\csname newif\expandafter\endcsname |
| 228 |
\csname if\KVO@prefix#2\endcsname |
| 229 |
\@ifundefined{\KVO@prefix#2#1}{% |
| 230 |
\PackageWarning{kvoptions}{% |
| 231 |
Initialization of option `#2' failed,\MessageBreak |
| 232 |
cannot set boolean option to `#1',\MessageBreak |
| 233 |
use `true' or `false', now using `false'% |
| 234 |
}% |
| 235 |
}{% |
| 236 |
\csname\KVO@prefix#2#1\endcsname |
| 237 |
}% |
| 238 |
\begingroup |
| 239 |
\edef\x{\endgroup |
| 240 |
\noexpand\define@key{\KVO@family}{#2}[true]{% |
| 241 |
\noexpand\KVO@boolkey{\@currname}% |
| 242 |
\ifx\@currext\@clsextension |
| 243 |
\noexpand\@clsextension |
| 244 |
\else |
| 245 |
\noexpand\@pkgextension |
| 246 |
\fi |
| 247 |
{\KVO@prefix}{#2}{####1}% |
| 248 |
}% |
| 249 |
}% |
| 250 |
\x |
| 251 |
}% |
| 252 |
}% |
| 253 |
}% |
| 254 |
} |
| 255 |
\newcommand*{\DeclareComplementaryOption}[2]{% |
| 256 |
\@ifundefined{if\KVO@prefix#2}{% |
| 257 |
\PackageError{kvoptions}{% |
| 258 |
Cannot generate option code for `#1',\MessageBreak |
| 259 |
parent switch `#2' does not exist% |
| 260 |
}{% |
| 261 |
You are inside % |
| 262 |
\ifx\@currext\@clsextension class\else package\fi\space |
| 263 |
`\@currname.\@currext'.\MessageBreak |
| 264 |
`\KVO@family' is used as familiy % |
| 265 |
for the keyval options.\MessageBreak |
| 266 |
`\KVO@prefix' serves as prefix % |
| 267 |
for internal switch macros.\MessageBreak |
| 268 |
\MessageBreak |
| 269 |
\@ehc |
| 270 |
}% |
| 271 |
}{% |
| 272 |
\KVO@ifdefinable{\KVO@prefix#1true}{% |
| 273 |
\KVO@ifdefinable{\KVO@prefix#1false}{% |
| 274 |
\expandafter\let\csname\KVO@prefix#1false\expandafter\endcsname |
| 275 |
\csname\KVO@prefix#2true\endcsname |
| 276 |
\expandafter\let\csname\KVO@prefix#1true\expandafter\endcsname |
| 277 |
\csname\KVO@prefix#2false\endcsname |
| 278 |
\begingroup |
| 279 |
\edef\x{\endgroup |
| 280 |
\noexpand\define@key{\KVO@family}{#1}[true]{% |
| 281 |
\noexpand\KVO@boolkey{\@currname}% |
| 282 |
\ifx\@currext\@clsextension |
| 283 |
\noexpand\@clsextension |
| 284 |
\else |
| 285 |
\noexpand\@pkgextension |
| 286 |
\fi |
| 287 |
{\KVO@prefix}{#1}{####1}% |
| 288 |
}% |
| 289 |
}% |
| 290 |
\x |
| 291 |
}% |
| 292 |
}% |
| 293 |
}% |
| 294 |
} |
| 295 |
\def\KVO@ifdefinable#1{% |
| 296 |
\expandafter\@ifdefinable\csname #1\endcsname |
| 297 |
} |
| 298 |
\def\KVO@boolkey#1#2#3#4#5{% |
| 299 |
\edef\KVO@param{#5}% |
| 300 |
\ltx@onelevel@sanitize\KVO@param |
| 301 |
\ifx\KVO@param\KVO@true |
| 302 |
\expandafter\@firstofone |
| 303 |
\else |
| 304 |
\ifx\KVO@param\KVO@false |
| 305 |
\expandafter\expandafter\expandafter\@firstofone |
| 306 |
\else |
| 307 |
\ifx#2\@clsextension |
| 308 |
\expandafter\ClassWarning |
| 309 |
\else |
| 310 |
\expandafter\PackageWarning |
| 311 |
\fi |
| 312 |
{#1}{% |
| 313 |
Value `\KVO@param' is not supported by\MessageBreak |
| 314 |
option `#4'% |
| 315 |
}% |
| 316 |
\expandafter\expandafter\expandafter\@gobble |
| 317 |
\fi |
| 318 |
\fi |
| 319 |
{% |
| 320 |
^^A\ifx#2\@clsextension |
| 321 |
^^A \expandafter\ClassInfo |
| 322 |
^^A\else |
| 323 |
^^A \expandafter\PackageInfo |
| 324 |
^^A\fi |
| 325 |
^^A{#1}{[option] #4=\KVO@param}% |
| 326 |
\csname#3#4\KVO@param\endcsname |
| 327 |
}% |
| 328 |
} |
| 329 |
\def\KVO@true{true} |
| 330 |
\def\KVO@false{false} |
| 331 |
\ltx@onelevel@sanitize\KVO@true |
| 332 |
\ltx@onelevel@sanitize\KVO@false |
| 333 |
\newcommand*{\DeclareStringOption}[2][]{% |
| 334 |
\@ifnextchar[{% |
| 335 |
\KVO@DeclareStringOption{#1}{#2}@% |
| 336 |
}{% |
| 337 |
\KVO@DeclareStringOption{#1}{#2}{}[]% |
| 338 |
}% |
| 339 |
} |
| 340 |
\def\KVO@DeclareStringOption#1#2#3[#4]{% |
| 341 |
\KVO@ifdefinable{\KVO@prefix#2}{% |
| 342 |
\@namedef{\KVO@prefix#2}{#1}% |
| 343 |
\begingroup |
| 344 |
\ifx\\#3\\% |
| 345 |
\toks@{}% |
| 346 |
\else |
| 347 |
\toks@{[{#4}]}% |
| 348 |
\fi |
| 349 |
\edef\x{\endgroup |
| 350 |
\noexpand\define@key{\KVO@family}{#2}\the\toks@{% |
| 351 |
^^A\begingroup |
| 352 |
^^A \toks@{####1}% |
| 353 |
^^A \ifx\@currext\@clsextension |
| 354 |
^^A \noexpand\ClassInfo |
| 355 |
^^A \else |
| 356 |
^^A \noexpand\PackageInfo |
| 357 |
^^A \fi |
| 358 |
^^A {\@currname}{% |
| 359 |
^^A [option] #2={\noexpand\the\toks@}% |
| 360 |
^^A }% |
| 361 |
^^A\endgroup |
| 362 |
\noexpand\def |
| 363 |
\expandafter\noexpand\csname\KVO@prefix#2\endcsname{####1}% |
| 364 |
}% |
| 365 |
}% |
| 366 |
\x |
| 367 |
}% |
| 368 |
} |
| 369 |
\newcommand*{\DeclareVoidOption}[2]{% |
| 370 |
\begingroup |
| 371 |
\let\next\@gobbletwo |
| 372 |
\KVO@ifdefinable{\KVO@prefix#1}{% |
| 373 |
\let\next\@firstofone |
| 374 |
}% |
| 375 |
\expandafter\endgroup |
| 376 |
\next{% |
| 377 |
\begingroup |
| 378 |
\edef\x{\endgroup |
| 379 |
\noexpand\define@key{\KVO@family}{#1}[\KVO@VOID@]{% |
| 380 |
\noexpand\KVO@voidkey{\@currname}% |
| 381 |
\ifx\@currext\@clsextension |
| 382 |
\noexpand\@clsextension |
| 383 |
\else |
| 384 |
\noexpand\@pkgextension |
| 385 |
\fi |
| 386 |
{#1}% |
| 387 |
{####1}% |
| 388 |
\expandafter\noexpand\csname\KVO@prefix#1\endcsname |
| 389 |
}% |
| 390 |
}% |
| 391 |
\x |
| 392 |
\begingroup |
| 393 |
\toks@{#2}% |
| 394 |
\expandafter\endgroup |
| 395 |
\expandafter\def |
| 396 |
\csname\KVO@prefix#1\expandafter\endcsname |
| 397 |
\expandafter{\the\toks@}% |
| 398 |
}% |
| 399 |
} |
| 400 |
\def\KVO@VOID@{@VOID@} |
| 401 |
\def\KVO@voidkey#1#2#3#4{% |
| 402 |
\def\CurrentOption{#3}% |
| 403 |
\begingroup |
| 404 |
\def\x{#4}% |
| 405 |
\expandafter\endgroup |
| 406 |
\ifx\x\KVO@VOID@ |
| 407 |
\else |
| 408 |
\ifx#2\@clsextension |
| 409 |
\expandafter\ClassWarning |
| 410 |
\else |
| 411 |
\expandafter\PackageWarning |
| 412 |
\fi |
| 413 |
{#1}{% |
| 414 |
Unexpected value for option `#3'\MessageBreak |
| 415 |
is ignored% |
| 416 |
}% |
| 417 |
\fi |
| 418 |
^^A\ifx#2\@clsextension |
| 419 |
^^A \expandafter\ClassInfo |
| 420 |
^^A\else |
| 421 |
^^A \expandafter\PackageInfo |
| 422 |
^^A\fi |
| 423 |
^^A{#1}{[option] #3}% |
| 424 |
} |
| 425 |
\newcommand*{\DeclareDefaultOption}{% |
| 426 |
\@namedef{KVO@default@\@currname.\@currext}% |
| 427 |
} |
| 428 |
\newcommand*{\DeclareLocalOptions}[1]{% |
| 429 |
\comma@parse{#1}\KVO@DeclareLocalOption |
| 430 |
} |
| 431 |
\def\KVO@DeclareLocalOption#1{% |
| 432 |
\expandafter\def\csname KVO@local@\KVO@family @#1\endcsname{}% |
| 433 |
} |
| 434 |
\SetupKeyvalOptions{% |
| 435 |
family=KVOdyn,% |
| 436 |
prefix=KVOdyn@% |
| 437 |
} |
| 438 |
\DeclareBoolOption[true]{global} |
| 439 |
\DeclareComplementaryOption{local}{global} |
| 440 |
\DeclareStringOption[undef]{action} |
| 441 |
\let\KVOdyn@name\relax |
| 442 |
\let\KVOdyn@ext\@empty |
| 443 |
\define@key{KVOdyn}{class}{% |
| 444 |
\def\KVOdyn@name{#1}% |
| 445 |
\let\KVOdyn@ext\@clsextension |
| 446 |
} |
| 447 |
\define@key{KVOdyn}{package}{% |
| 448 |
\def\KVOdyn@name{#1}% |
| 449 |
\let\KVOdyn@ext\@pkgextension |
| 450 |
} |
| 451 |
\newcommand*{\DisableKeyvalOption}[3][]{% |
| 452 |
\begingroup |
| 453 |
\kvsetkeys{KVOdyn}{#1}% |
| 454 |
\def\x{\endgroup}% |
| 455 |
\@ifundefined{KVO@action@\KVOdyn@action}{% |
| 456 |
\PackageError{kvoptions}{% |
| 457 |
Unknown disable action % |
| 458 |
`\expandafter\strip@prefix\meaning\KVOdyn@action'\MessageBreak |
| 459 |
for option `#3' in keyval family '#2'% |
| 460 |
}\@ehc |
| 461 |
}{% |
| 462 |
\csname KVO@action@\KVOdyn@action\endcsname{#2}{#3}% |
| 463 |
}% |
| 464 |
\x |
| 465 |
} |
| 466 |
\def\KVO@action@undef#1#2{% |
| 467 |
\edef\x{\endgroup |
| 468 |
\ifKVOdyn@global\global\fi |
| 469 |
\let |
| 470 |
\expandafter\noexpand\csname KV@#1@#2\endcsname |
| 471 |
\relax |
| 472 |
\ifKVOdyn@global\global\fi |
| 473 |
\let |
| 474 |
\expandafter\noexpand\csname KV@#1@#2@default\endcsname |
| 475 |
\relax |
| 476 |
}% |
| 477 |
^^A\PackageInfo{kvoptions}{% |
| 478 |
^^A [option] key `#2' of family `#1'\MessageBreak |
| 479 |
^^A is disabled (undef, \ifKVOdyn@global global\else local\fi)% |
| 480 |
^^A}% |
| 481 |
} |
| 482 |
\def\KVO@action@ignore#1#2{% |
| 483 |
\edef\x{\endgroup |
| 484 |
\ifKVOdyn@global\global\fi |
| 485 |
\let |
| 486 |
\expandafter\noexpand\csname KV@#1@#2\endcsname |
| 487 |
\noexpand\@gobble |
| 488 |
\ifKVOdyn@global\global\fi |
| 489 |
\let |
| 490 |
\expandafter\noexpand\csname KV@#1@#2@default\endcsname |
| 491 |
\noexpand\@empty |
| 492 |
}% |
| 493 |
^^A\PackageInfo{kvoptions}{% |
| 494 |
^^A [option] key `#2' of family `#1'\MessageBreak |
| 495 |
^^A is disabled (ignore, \ifKVOdyn@global global\else local\fi)% |
| 496 |
^^A}% |
| 497 |
} |
| 498 |
\def\KVO@action@error{% |
| 499 |
\KVO@do@action{error}% |
| 500 |
} |
| 501 |
\def\KVO@action@warning{% |
| 502 |
\KVO@do@action{warning}% |
| 503 |
} |
| 504 |
\def\KVO@do@action#1#2#3{% |
| 505 |
\ifx\KVOdyn@name\relax |
| 506 |
\PackageError{kvoptions}{% |
| 507 |
Action type `#1' needs package/class name\MessageBreak |
| 508 |
for key `#3' in family `#2'% |
| 509 |
}\@ehc |
| 510 |
\else |
| 511 |
\edef\x{\endgroup |
| 512 |
\noexpand\define@key{#2}{#3}[]{% |
| 513 |
\expandafter\noexpand\csname KVO@disable@#1\endcsname |
| 514 |
{\KVOdyn@name}\noexpand\KVOdyn@ext{#3}% |
| 515 |
}% |
| 516 |
\ifKVOdyn@global |
| 517 |
\global\let |
| 518 |
\expandafter\noexpand\csname KV@#2@#3\endcsname |
| 519 |
\expandafter\noexpand\csname KV@#2@#3\endcsname |
| 520 |
\global\let |
| 521 |
\expandafter\noexpand\csname KV@#2@#3@default\endcsname |
| 522 |
\expandafter\noexpand\csname KV@#2@#3@default\endcsname |
| 523 |
\fi |
| 524 |
}% |
| 525 |
^^A\ifx\KVOdyn@ext\@clsextension |
| 526 |
^^A \expandafter\ClassInfo |
| 527 |
^^A\else |
| 528 |
^^A \expandafter\PackageInfo |
| 529 |
^^A\fi |
| 530 |
^^A{\KVOdyn@name}{% |
| 531 |
^^A [option] key `#3' of family `#2'\MessageBreak |
| 532 |
^^A is disabled (#1, \ifKVOdyn@global global\else local\fi)% |
| 533 |
^^A}% |
| 534 |
\fi |
| 535 |
} |
| 536 |
\def\KVO@disable@error#1#2#3{% |
| 537 |
\ifx#2\@clsextension |
| 538 |
\expandafter\ClassError |
| 539 |
\else |
| 540 |
\expandafter\PackageError |
| 541 |
\fi |
| 542 |
{#1}{% |
| 543 |
Option `#3' is given too late,\MessageBreak |
| 544 |
now the option is ignored% |
| 545 |
}\@ehc |
| 546 |
} |
| 547 |
\def\KVO@disable@warning#1#2#3{% |
| 548 |
\ifx#2\@clsextension |
| 549 |
\expandafter\ClassWarning |
| 550 |
\else |
| 551 |
\expandafter\PackageWarning |
| 552 |
\fi |
| 553 |
{#1}{% |
| 554 |
Option `#3' is already consumed\MessageBreak |
| 555 |
and has no effect% |
| 556 |
}% |
| 557 |
} |
| 558 |
\newcommand*{\AddToKeyvalOption}{% |
| 559 |
\@ifstar{% |
| 560 |
\begingroup |
| 561 |
\edef\x{\endgroup |
| 562 |
\noexpand\KVO@AddToKeyvalOption{\KVO@family}% |
| 563 |
}% |
| 564 |
\x |
| 565 |
}% |
| 566 |
\KVO@AddToKeyvalOption |
| 567 |
} |
| 568 |
\def\KVO@AddToKeyvalOption#1#2{% |
| 569 |
\@ifundefined{KV@#1@#2}{% |
| 570 |
\PackageWarning{kvoptions}{% |
| 571 |
Key `#2' of family `#1' does not exist.\MessageBreak |
| 572 |
Ignoring \string\AddToKeyvalOption |
| 573 |
}% |
| 574 |
\@gobble |
| 575 |
}{% |
| 576 |
\edef\KVO@next{% |
| 577 |
\noexpand\KVO@@AddToKeyvalOption |
| 578 |
\expandafter\noexpand\csname KV@#1@#2\endcsname |
| 579 |
}% |
| 580 |
\afterassignment\KVO@next |
| 581 |
\def\KVO@temp##1% |
| 582 |
}% |
| 583 |
} |
| 584 |
\def\KVO@@AddToKeyvalOption#1{% |
| 585 |
\begingroup |
| 586 |
\toks@\expandafter{#1{##1}}% |
| 587 |
\toks@\expandafter{\the\expandafter\toks@\KVO@temp{##1}}% |
| 588 |
\edef\x{\endgroup |
| 589 |
\noexpand\def\noexpand#1####1{\the\toks@}% |
| 590 |
}% |
| 591 |
\x |
| 592 |
} |
| 593 |
\def\KVO@IfDefThen#1#2{% |
| 594 |
\ifx#1\ltx@undefined |
| 595 |
\else |
| 596 |
\ifx#1\relax |
| 597 |
\else |
| 598 |
#2% |
| 599 |
\fi |
| 600 |
\fi |
| 601 |
}% |
| 602 |
\def\KVO@GetClassOptionsList{% |
| 603 |
\let\KVO@classoptionslist\@classoptionslist |
| 604 |
\KVO@IfDefThen\@classoptionslist{% |
| 605 |
\KVO@IfDefThen\XKV@documentclass{% |
| 606 |
\ifx\XKV@documentclass\ltx@empty |
| 607 |
\else |
| 608 |
\KVO@IfDefThen\XKV@classoptionslist{% |
| 609 |
\ifx\XKV@classoptionslist\ltx@empty |
| 610 |
\else |
| 611 |
\let\KVO@classoptionslist\XKV@classoptionslist |
| 612 |
\fi |
| 613 |
}% |
| 614 |
\fi |
| 615 |
}% |
| 616 |
}% |
| 617 |
}% |
| 618 |
\newcommand*{\ProcessKeyvalOptions}{% |
| 619 |
\@ifstar{% |
| 620 |
\begingroup |
| 621 |
\edef\x{\endgroup |
| 622 |
\noexpand\KVO@ProcessKeyvalOptions{\KVO@family}% |
| 623 |
}% |
| 624 |
\x |
| 625 |
}% |
| 626 |
\KVO@ProcessKeyvalOptions |
| 627 |
} |
| 628 |
\def\KVO@ProcessKeyvalOptions#1{% |
| 629 |
\let\@tempc\relax |
| 630 |
\let\KVO@temp\@empty |
| 631 |
\ifx\@currext\@clsextension |
| 632 |
\else |
| 633 |
\KVO@GetClassOptionsList |
| 634 |
\ifx\KVO@classoptionslist\relax |
| 635 |
\else |
| 636 |
\@for\KVO@CurrentOption:=\KVO@classoptionslist\do{% |
| 637 |
\@ifundefined{KV@#1@\expandafter\KVO@getkey |
| 638 |
\KVO@CurrentOption=\@nil}{% |
| 639 |
}{% |
| 640 |
\@ifundefined{KVO@local@#1@\expandafter\KVO@getkey |
| 641 |
\KVO@CurrentOption=\@nil}{% |
| 642 |
\ifx\KVO@Patch Y% |
| 643 |
\edef\KVO@temp{% |
| 644 |
\etex@unexpanded\expandafter{% |
| 645 |
\KVO@temp |
| 646 |
}% |
| 647 |
,% |
| 648 |
\etex@unexpanded\expandafter{% |
| 649 |
\KVO@CurrentOption |
| 650 |
}% |
| 651 |
,% |
| 652 |
}% |
| 653 |
\ltx@onelevel@sanitize\KVO@CurrentOption |
| 654 |
\else |
| 655 |
\edef\KVO@temp{% |
| 656 |
\KVO@temp |
| 657 |
,% |
| 658 |
\KVO@CurrentOption |
| 659 |
,% |
| 660 |
}% |
| 661 |
\fi |
| 662 |
\@expandtwoargs\@removeelement{\expandafter\@remove@eq@value\KVO@CurrentOption=\@nil}% |
| 663 |
\@unusedoptionlist\@unusedoptionlist |
| 664 |
}{}% |
| 665 |
}% |
| 666 |
}% |
| 667 |
\fi |
| 668 |
\fi |
| 669 |
\begingroup |
| 670 |
\toks\tw@{}% |
| 671 |
\@ifundefined{opt@\@currname.\@currext}{% |
| 672 |
\toks@\expandafter{\KVO@temp}% |
| 673 |
}{% |
| 674 |
\toks@\expandafter\expandafter\expandafter{% |
| 675 |
\csname opt@\@currname.\@currext\endcsname |
| 676 |
}% |
| 677 |
\ifx\@currext\@clsextension |
| 678 |
\edef\CurrentOption{\the\toks@}% |
| 679 |
\toks@\expandafter{\KVO@temp}% |
| 680 |
\@for\CurrentOption:=\CurrentOption\do{% |
| 681 |
\@ifundefined{% |
| 682 |
KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil |
| 683 |
}{% |
| 684 |
\@ifundefined{KVO@default@\@currname.\@currext}{% |
| 685 |
\ifx\KVO@Patch Y% |
| 686 |
\ltx@onelevel@sanitize\CurrentOption |
| 687 |
\fi |
| 688 |
\ifx\@unusedoptionlist\@empty |
| 689 |
\global\let\@unusedoptionlist\CurrentOption |
| 690 |
\else |
| 691 |
\expandafter\expandafter\expandafter\gdef |
| 692 |
\expandafter\expandafter\expandafter\@unusedoptionlist |
| 693 |
\expandafter\expandafter\expandafter{% |
| 694 |
\expandafter\@unusedoptionlist |
| 695 |
\expandafter,\CurrentOption |
| 696 |
}% |
| 697 |
\fi |
| 698 |
}{% |
| 699 |
\toks\tw@\expandafter{% |
| 700 |
\the\toks\expandafter\tw@\expandafter,\CurrentOption |
| 701 |
}% |
| 702 |
}% |
| 703 |
}{% |
| 704 |
\toks@\expandafter{% |
| 705 |
\the\expandafter\toks@\expandafter,\CurrentOption |
| 706 |
}% |
| 707 |
}% |
| 708 |
}% |
| 709 |
\else |
| 710 |
\@ifundefined{KVO@default@\@currname.\@currext}{% |
| 711 |
\toks@\expandafter\expandafter\expandafter{% |
| 712 |
\expandafter\KVO@temp\the\toks@ |
| 713 |
}% |
| 714 |
}{% |
| 715 |
\edef\CurrentOption{\the\toks@}% |
| 716 |
\toks@\expandafter{\KVO@temp}% |
| 717 |
\@for\CurrentOption:=\CurrentOption\do{% |
| 718 |
\@ifundefined{% |
| 719 |
KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil |
| 720 |
}{% |
| 721 |
\toks\tw@\expandafter{% |
| 722 |
\the\toks\expandafter\tw@\expandafter,\CurrentOption |
| 723 |
}% |
| 724 |
}{% |
| 725 |
\toks@\expandafter{% |
| 726 |
\the\expandafter\toks@\expandafter,\CurrentOption |
| 727 |
}% |
| 728 |
}% |
| 729 |
}% |
| 730 |
}% |
| 731 |
\fi |
| 732 |
}% |
| 733 |
\edef\KVO@temp{\endgroup |
| 734 |
\noexpand\KVO@calldefault{\the\toks\tw@}% |
| 735 |
\noexpand\KVO@setkeys{#1}{\the\toks@}% |
| 736 |
}% |
| 737 |
\KVO@temp |
| 738 |
\let\CurrentOption\@empty |
| 739 |
\AtEndOfPackage{\let\@unprocessedoptions\relax}% |
| 740 |
} |
| 741 |
\newcommand*{\ProcessLocalKeyvalOptions}{% |
| 742 |
\@ifstar{% |
| 743 |
\begingroup |
| 744 |
\edef\x{\endgroup |
| 745 |
\noexpand\KVO@ProcessLocalKeyvalOptions{\KVO@family}% |
| 746 |
}% |
| 747 |
\x |
| 748 |
}% |
| 749 |
\KVO@ProcessLocalKeyvalOptions |
| 750 |
} |
| 751 |
\def\KVO@ProcessLocalKeyvalOptions#1{% |
| 752 |
\let\@tempc\relax |
| 753 |
\let\KVO@temp\@empty |
| 754 |
\ifx\@currext\@pkgextension |
| 755 |
\else |
| 756 |
\PackageError{kvoptions}{% |
| 757 |
\string\ProcessLocalKeyvalOptions\space is intended for packages only% |
| 758 |
}\@ehc |
| 759 |
\fi |
| 760 |
\begingroup |
| 761 |
\toks\tw@{}% |
| 762 |
\@ifundefined{opt@\@currname.\@currext}{% |
| 763 |
\toks@\expandafter{\KVO@temp}% |
| 764 |
}{% |
| 765 |
\toks@\expandafter\expandafter\expandafter{% |
| 766 |
\csname opt@\@currname.\@currext\endcsname |
| 767 |
}% |
| 768 |
\@ifundefined{KVO@default@\@currname.\@currext}{% |
| 769 |
\toks@\expandafter\expandafter\expandafter{% |
| 770 |
\expandafter\KVO@temp\the\toks@ |
| 771 |
}% |
| 772 |
}{% |
| 773 |
\edef\CurrentOption{\the\toks@}% |
| 774 |
\toks@\expandafter{\KVO@temp}% |
| 775 |
\@for\CurrentOption:=\CurrentOption\do{% |
| 776 |
\@ifundefined{% |
| 777 |
KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil |
| 778 |
}{% |
| 779 |
\toks\tw@\expandafter{% |
| 780 |
\the\toks\expandafter\tw@\expandafter,\CurrentOption |
| 781 |
}% |
| 782 |
}{% |
| 783 |
\toks@\expandafter{% |
| 784 |
\the\expandafter\toks@\expandafter,\CurrentOption |
| 785 |
}% |
| 786 |
}% |
| 787 |
}% |
| 788 |
}% |
| 789 |
}% |
| 790 |
\edef\KVO@temp{\endgroup |
| 791 |
\noexpand\KVO@calldefault{\the\toks\tw@}% |
| 792 |
\noexpand\KVO@setkeys{#1}{\the\toks@}% |
| 793 |
}% |
| 794 |
\KVO@temp |
| 795 |
\let\CurrentOption\@empty |
| 796 |
\AtEndOfPackage{\let\@unprocessedoptions\relax}% |
| 797 |
} |
| 798 |
\def\KVO@getkey#1=#2\@nil{#1} |
| 799 |
\def\KVO@calldefault#1{% |
| 800 |
\begingroup |
| 801 |
\def\x{#1}% |
| 802 |
\expandafter\endgroup |
| 803 |
\ifx\x\@empty |
| 804 |
\else |
| 805 |
\@for\CurrentOption:=#1\do{% |
| 806 |
\ifx\CurrentOption\@empty |
| 807 |
\else |
| 808 |
\expandafter\KVO@setcurrents\CurrentOption=\@nil |
| 809 |
\@nameuse{KVO@default@\@currname.\@currext}% |
| 810 |
\fi |
| 811 |
}% |
| 812 |
\fi |
| 813 |
} |
| 814 |
\def\KVO@setcurrents#1=#2\@nil{% |
| 815 |
\def\CurrentOptionValue{#2}% |
| 816 |
\ifx\CurrentOptionValue\@empty |
| 817 |
\let\CurrentOptionKey\CurrentOption |
| 818 |
\let\CurrentOptionValue\relax |
| 819 |
\else |
| 820 |
\edef\CurrentOptionKey{\zap@space#1 \@empty}% |
| 821 |
\expandafter\KVO@setcurrentvalue\CurrentOption\@nil |
| 822 |
\fi |
| 823 |
} |
| 824 |
\def\KVO@setcurrentvalue#1=#2\@nil{% |
| 825 |
\KV@@sp@def\CurrentOptionValue{#2}% |
| 826 |
} |
| 827 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 828 |
\expandafter\ifx\csname documentclass\endcsname\relax |
| 829 |
\def\ProcessKeyvalOptions{% |
| 830 |
\@ifstar{}\@gobble |
| 831 |
}% |
| 832 |
\fi |
| 833 |
\KVO@AtEnd% |
| 834 |
\endinput |
| 835 |
%% |
| 836 |
%% End of file `kvoptions.sty'. |