-
Notifications
You must be signed in to change notification settings - Fork 178
/
basics.dtx
113 lines (112 loc) · 2.71 KB
/
basics.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
% \iffalse
%<*driver>
\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\clearpage
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \title{Example l3doc document}
% \author{The \LaTeX3 Project}
%
% \maketitle
%
% \begin{documentation}
%
% \section{Documentation}
%
% \begin{function}{\ProcessKeysOptions}
% \begin{syntax}
% \cs{ProcessKeysOptions} \Arg{module}
% \end{syntax}
% This function is used to check the current
% option list against the keys defined for \Arg{module}. Global (class)
% options and local (package) options are checked when this function
% is called in a package. Each option which does match a key name is
% then used to attempt to set the appropriate key using
% \cs{keys_set:nn}. For example, the option defined earlier would be
% processed by the line
% \begin{verbatim}
% \ProcessKeysOptions { module }
% \end{verbatim}
% \end{function}
%
% \begin{function}{\l_@@_latexe_options_clist}
% An internal variable.
% Here is a reference to \cs{bool_set_false:N}.
% \end{function}
%
%\end{documentation}
%
% \clearpage
%
%\begin{implementation}
%
%\section{Implementation}
%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
% \begin{macrocode}
\ProvidesExplPackage{l3keys2e}{2017/09/18}{}
{LaTeX2e option processing using LaTeX3 keys}
% \end{macrocode}
%
% Non-standard variants.
% \begin{macrocode}
\cs_generate_variant:Nn \clist_put_right:Nn { Nv }
\cs_generate_variant:Nn \keys_if_exist:nnT { nx }
\cs_generate_variant:Nn \keys_if_exist:nnTF { nx }
% \end{macrocode}
%
% \begin{macro}{\l_@@_latexe_options_clist}
% A single list is used for all options, into which they are collected
% before processing.
% \begin{macrocode}
\clist_new:N \l_@@_latexe_options_clist
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_process_class_bool}
% A flag to indicate that class options should be processed for
% packages.
% \begin{macrocode}
\bool_new:N \l_@@_process_class_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ProcessKeysOptions}
% \begin{macro}{\ProcessKeysPackageOptions}
% The user macro are simply wrappers around the internal process. In
% contrast to other similar packages, the module name is always required
% here.
% \begin{macrocode}
\cs_new_protected:Npn \ProcessKeysOptions #1
{
\bool_set_true:N \l_@@_process_class_bool
\@@_latexe_options:n {#1}
}
\cs_new_protected:Npn \ProcessKeysPackageOptions #1
{
\bool_set_false:N \l_@@_process_class_bool
\@@_latexe_options:n {#1}
}
\@onlypreamble \ProcessKeysOptions
\@onlypreamble \ProcessKeysPackageOptions
% \end{macrocode}
%\end{macro}
%\end{macro}
%
%
% \begin{macrocode}
%</package>
% \end{macrocode}
%
% \end{implementation}
%
%
\endinput