Debian Codegraph @

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

raw
1 %%
2 %% This is file `pgfopts.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% pgfopts.dtx (with options: `package')
8 %% ----------------------------------------------------------------
9 %% pgfopts --- LaTeX package options with pgfkeys
10 %% E-mail: [email protected]
11 %% Released under the LaTeX Project Public License v1.3c or later
12 %% See http://www.latex-project.org/lppl.txt
13 %% ----------------------------------------------------------------
14 %%
15 \ProvidesPackage{pgfopts}
16 [2014/07/10 v2.1a LaTeX package options with pgfkeys]
17 \RequirePackage{pgfkeys}
18 \newif\ifpgfopts@process@class
19 \newcommand*\pgfopts@options@clist{}
20 \newcommand*\pgfopts@options@execute{}
21 \newcommand*\pgfopts@key@path{}
22 \newcommand\pgfopts@process@options[1]{%
23 \def\pgfopts@options@clist{}%
24 \def\pgfopts@options@execute{}%
25 \def\pgfopts@key@path{#1/}%
26 \ifx\@currext\@clsextension\else
27 \expandafter\pgfopts@check@class@options
28 \fi
29 \pgfopts@process@local@options
30 \pgfopts@options@execute
31 \let\CurrentOption\@empty
32 \AtEndOfPackage{\let\@unprocessedoptions\relax}%
33 }
34 \newcommand*\pgfopts@current@option{}
35 \newcommand*\pgfopts@check@class@options{%
36 \ifpgfopts@process@class
37 \ifx\@classoptionslist\relax\else
38 \expandafter\expandafter\expandafter
39 \pgfopts@check@class@options@aux
40 \fi
41 \fi
42 }
43 \newcommand*\pgfopts@check@class@options@aux{%
44 \@for\pgfopts@current@option:=\@classoptionslist\do
45 {%
46 \pgfkeysifdefined
47 {%
48 \pgfopts@key@path
49 \pgfopts@get@key@name\pgfopts@current@option
50 /.@cmd%
51 }%
52 {%
53 \pgfopts@list@add\pgfopts@options@clist\pgfopts@current@option
54 \@expandtwoargs\@removeelement\pgfopts@current@option
55 \@unusedoptionlist\@unusedoptionlist
56 }%
57 {}%
58 }%
59 }
60 \newcommand*\pgfopts@local@options{}
61 \newcommand*\pgfopts@process@local@options{%
62 \begingroup
63 \@ifundefined{opt@\@currname.\@currext}%
64 {\endgroup}%
65 {%
66 \toks@\expandafter\expandafter\expandafter
67 {\csname opt@\@currname.\@currext\endcsname}%
68 \expandafter\endgroup
69 \expandafter\def\expandafter\pgfopts@local@options
70 \expandafter{\the\toks@}%
71 \pgfopts@process@local@options@aux@i
72 }%
73 }
74 \newcommand*\pgfopts@process@local@options@aux@i{%
75 \ifx\@currext\@clsextension
76 \expandafter\pgfopts@process@local@options@class
77 \else
78 \expandafter\pgfopts@process@local@options@package
79 \fi
80 \ifx\pgfopts@options@clist\@empty\else
81 \expandafter\pgfopts@process@local@options@aux@ii
82 \fi
83 }
84 \newcommand*\pgfopts@process@local@options@aux@ii{%
85 \begingroup
86 \toks@\expandafter{\pgfopts@options@clist}%
87 \edef\pgfopts@options@execute
88 {%
89 \noexpand\pgfkeys
90 {%
91 \pgfopts@key@path .cd,%
92 \the\toks@
93 }%
94 }%
95 \expandafter\endgroup
96 \expandafter\def\expandafter\pgfopts@options@execute
97 \expandafter{\pgfopts@options@execute}%
98 }
99 \newcommand*\pgfopts@process@local@options@class
100 {%
101 \pgfkeysifdefined{\pgfopts@key@path .unknown/.@cmd}%
102 {\pgfopts@list@add\pgfopts@options@clist\@classoptionslist}
103 {\pgfopts@process@local@options@class@aux}%
104 }
105 \newcommand*\pgfopts@process@local@options@class@aux{%
106 \@for\pgfopts@current@option:=\pgfopts@local@options\do{%
107 \pgfkeysifdefined
108 {%
109 \pgfopts@key@path
110 \pgfopts@get@key@name\pgfopts@current@option
111 /.@cmd%
112 }%
113 {\pgfopts@list@add\pgfopts@options@clist\pgfopts@current@option}%
114 {\pgfopts@list@add\@unusedoptionlist\pgfopts@current@option}%
115 }%
116 }
117 \newcommand*\pgfopts@process@local@options@package{%
118 \pgfopts@list@add\pgfopts@options@clist\pgfopts@local@options
119 }
120 \newcommand\pgfopts@get@key@name[1]{%
121 \expandafter\pgfopts@get@key@name@aux#1=\@nil
122 }
123 \def\pgfopts@get@key@name@aux#1=#2\@nil{#1}
124 \newtoks\pgfopts@list@add@a@toks
125 \newtoks\pgfopts@list@add@b@toks
126 \newcommand*\pgfopts@list@add@temp{}
127 \newcommand\pgfopts@list@add[2]{%
128 \pgfopts@list@add@a@toks\expandafter{#2}%
129 \def\pgfopts@list@add@temp{#2}%
130 \pgfopts@list@add@b@toks\expandafter{#1}%
131 \ifx\pgfopts@options@clist\@empty
132 \edef#1{\the\pgfopts@list@add@a@toks}%
133 \else
134 \ifx\pgfopts@list@add@temp\@empty\else
135 \edef#1%
136 {\the\pgfopts@list@add@b@toks,\the\pgfopts@list@add@a@toks}%
137 \fi
138 \fi
139 }
140 \newcommand*\ProcessPgfOptions{%
141 \pgfopts@process@classtrue
142 \pgfopts@star@check
143 }
144 \newcommand*\ProcessPgfPackageOptions{%
145 \pgfopts@process@classfalse
146 \pgfopts@star@check
147 }
148 \newcommand*\pgfopts@star@check{%
149 \@ifstar
150 {%
151 \begingroup
152 \edef\@tempa
153 {%
154 \endgroup
155 \noexpand\pgfopts@process@options{/\@currname}%
156 }%
157 \@tempa
158 }%
159 {\pgfopts@process@options}%
160 }
161 \@onlypreamble\ProcessPgfOptions
162 \@onlypreamble\ProcessPgfPackageOptions
163 %%
164 %% Copyright (C) 2008-2011,2013,2014 by
165 %% Joseph Wright <[email protected]>
166 %%
167 %% It may be distributed and/or modified under the conditions of
168 %% the LaTeX Project Public License (LPPL), either version 1.3c of
169 %% this license or (at your option) any later version. The latest
170 %% version of this license is in the file:
171 %%
172 %% http://www.latex-project.org/lppl.txt
173 %%
174 %% This work is "maintained" (as per LPPL maintenance status) by
175 %% Joseph Wright.
176 %%
177 %% This work consists of the file pgfopts.dtx
178 %% and the derived files pgfopts.ins and
179 %% pgfopts.pdf.
180 %%
181 %%
182 %% End of file `pgfopts.sty'.