Debian Codegraph @

texmf-dist/tex/latex/xkeyval/xkeyval.sty

raw
1 %%
2 %% This is file `xkeyval.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xkeyval.dtx (with options: `xkvlatex')
8 %%
9 %% ---------------------------------------
10 %% Copyright (C) 2004-2022 Hendri Adriaens
11 %% 2025 David Carlisle for latex-package-repositories
12 %% ---------------------------------------
13 %%
14 %% This work may be distributed and/or modified under the
15 %% conditions of the LaTeX Project Public License, either version 1.3
16 %% of this license or (at your option) any later version.
17 %% The latest version of this license is in
18 %% http://www.latex-project.org/lppl.txt
19 %% and version 1.3 or later is part of all distributions of LaTeX
20 %% version 2003/12/01 or later.
21 %%
22 %% This work has the LPPL maintenance status "maintained".
23 %%
24 %% This Current Maintainer of this work is Hendri Adriaens.
25 %%
26 %% This work consists of the file xkeyval.dtx and derived files
27 %% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
28 %% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls,
29 %% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex,
30 %% xkvex2.tex, xkvex3.tex and xkvex4.tex.
31 %%
32 %% The following files constitute the xkeyval bundle and must be
33 %% distributed as a whole: readme, xkeyval.pdf, keyval.tex,
34 %% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
35 %% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx.
36 %%
37 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
38 \ProvidesPackage{xkeyval}
39 [2025/11/04 v2.10 package option processing (HA)]
40 \ifx\XKeyValLoaded\endinput\else\input xkeyval \fi
41 \edef\XKVcatcodes{%
42 \catcode`\noexpand\=\the\catcode`\=\relax
43 \catcode`\noexpand\,\the\catcode`\,\relax
44 \let\noexpand\XKVcatcodes\relax
45 }
46 \catcode`\=12\relax
47 \catcode`\,12\relax
48 \let\XKV@doxs\relax
49 \def\XKV@warn#1{\PackageWarning{xkeyval}{#1}}
50 \def\XKV@err#1{\PackageError{xkeyval}{#1}\@ehc}
51 \XKV@whilist\@filelist\XKV@tempa\ifx\XKV@documentclass\@undefined\fi{%
52 \filename@parse\XKV@tempa
53 \ifx\filename@ext\@clsextension
54 \XKV@ifundefined{opt@\filename@base.\filename@ext
55 }{}{\edef\XKV@documentclass{\filename@base.\filename@ext}}%
56 \fi
57 }
58 \ifx\XKV@documentclass\@undefined
59 \XKV@err{xkeyval loaded before \protect\documentclass}%
60 \let\XKV@documentclass\@empty
61 \let\XKV@classoptionslist\@empty
62 \else
63 \let\XKV@classoptionslist\@classoptionslist
64 \def\XKV@tempa#1{%
65 \let\@classoptionslist\@empty
66 \XKV@for@n{#1}\XKV@tempa{%
67 \expandafter\in@\expandafter=\expandafter{\XKV@tempa}%
68 \ifin@\else\XKV@addtolist@o\@classoptionslist\XKV@tempa\fi
69 }%
70 }
71 \expandafter\XKV@tempa\expandafter{\@classoptionslist}
72 \fi
73 \def\XKV@testopte#1{%
74 \XKV@ifstar{\XKV@sttrue\XKV@t@stopte#1}{\XKV@stfalse\XKV@t@stopte#1}%
75 }
76 \def\XKV@t@stopte#1{\@testopt{\XKV@t@st@pte#1}{KV}}
77 \def\XKV@t@st@pte#1[#2]{%
78 \XKV@makepf{#2}%
79 \@ifnextchar<{\XKV@@t@st@pte#1}%
80 {\XKV@@t@st@pte#1<\@currname.\@currext>}%
81 }
82 \def\XKV@@t@st@pte#1<#2>{%
83 \XKV@sp@deflist\XKV@fams{#2}%
84 \@testopt#1{}%
85 }
86 \def\DeclareOptionX{%
87 \let\@fileswith@pti@ns\@badrequireerror
88 \XKV@ifstar\XKV@dox\XKV@d@x
89 }
90 \long\def\XKV@dox#1{\XKV@toks{#1}\edef\XKV@doxs{\the\XKV@toks}}
91 \def\XKV@d@x{\@testopt\XKV@@d@x{KV}}
92 \def\XKV@@d@x[#1]{%
93 \@ifnextchar<{\XKV@@@d@x[#1]}{\XKV@@@d@x[#1]<\@currname.\@currext>}%
94 }
95 \def\XKV@@@d@x[#1]<#2>#3{\@testopt{\define@key[#1]{#2}{#3}}{}}
96 \def\ExecuteOptionsX{\XKV@stfalse\XKV@plfalse\XKV@t@stopte\XKV@setkeys}
97 \def\ProcessOptionsX{\XKV@plfalse\XKV@testopte\XKV@pox}
98 \def\XKV@pox[#1]{%
99 \let\XKV@tempa\@empty
100 \XKV@inpoxtrue
101 \let\@fileswith@pti@ns\@badrequireerror
102 \edef\XKV@testclass{\@currname.\@currext}%
103 \ifx\XKV@testclass\XKV@documentclass
104 \let\@unusedoptionlist\XKV@classoptionslist
105 \XKV@ifundefined{[email protected]}{}{%
106 \@onelevel@sanitize\@unusedoptionlist
107 }%
108 \else
109 \ifXKV@st
110 \def\XKV@tempb##1,{%
111 \def\CurrentOption{##1}%
112 \ifx\CurrentOption\@nnil\else
113 \XKV@g@tkeyname##1=\@nil\CurrentOption
114 \XKV@key@if@ndefined{\CurrentOption}{}{%
115 \XKV@useoption{##1}%
116 \XKV@addtolist@n\XKV@tempa{##1}%
117 }%
118 \expandafter\XKV@tempb
119 \fi
120 }%
121 \expandafter\XKV@tempb\XKV@classoptionslist,\@nil,%
122 \fi
123 \fi
124 \expandafter\XKV@addtolist@o\expandafter
125 \XKV@tempa\csname opt@\@currname.\@currext\endcsname
126 \def\XKV@tempb{\XKV@setkeys[#1]}%
127 \expandafter\XKV@tempb\expandafter{\XKV@tempa}%
128 \let\XKV@doxs\relax
129 \let\XKV@rm\@empty
130 \XKV@inpoxfalse
131 \let\@fileswith@pti@ns\@@fileswith@pti@ns
132 \AtEndOfPackage{\let\@unprocessedoptions\relax}%
133 }
134 \def\XKV@useoption#1{%
135 \def\XKV@resa{#1}%
136 \XKV@ifundefined{[email protected]}{}{%
137 \@onelevel@sanitize\XKV@resa
138 }%
139 \@expandtwoargs\@removeelement{\expandafter\@remove@eq@value\XKV@resa=\@nil}%
140 {\@unusedoptionlist}\@unusedoptionlist
141 }
142 \DeclareOptionX*{%
143 \PackageWarning{xkeyval}{Unknown option `\CurrentOption'}%
144 }
145 \ProcessOptionsX
146 \XKVcatcodes
147 \endinput
148 %%
149 %% End of file `xkeyval.sty'.