Debian Codegraph @

texmf-dist/doc/latex/xkeyval/xkvex4.tex

raw
1 %%
2 %% This is file `xkvex4.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xkeyval.dtx (with options: `xkvex4')
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 %% Load LaTeX kernel macros patch
38 \RequirePackage{xkvltxp}
39
40 %% keyi will set \keyi in xkveca.cls
41 %% keyvi will set \keyvi in xkveca.cls and xkvesc.sty will pick
42 %% it up from \documentclass and redefine it
43 %% IgnoredGlobal and another=key will be considered as global
44 %% options to be passed on to packages. Not used anymore.
45 \documentclass[keyi=test1 on page \thepage,keyvi,another=key,IgnoredGlobal,10pt]{xkveca}
46
47 %% keyii will set \keyii in xkvesa.sty
48 %% keyiv will be passed to xkvesb.sty as unknown option
49 %% the other input will be passed on to xkvesb as well.
50 \usepackage[keyii=test2 on page \thepage,keyiv=test4 on page \thepage,test5]{xkvesa}
51
52 %% keyvii will set \keyvii in xkvesc.sty
53 \usepackage[keyvii]{xkvesc}
54
55 \title{\textsf{xkeyval} package\\\normalsize\emph{Example 4}}
56 \author{Hendri Adriaens}
57 \setlength{\parindent}{0cm}
58
59 \makeatletter
60 \let\@tempa\@classoptionslist
61 \let\@tempb\@unusedoptionlist
62 \let\@tempc\XKV@classoptionslist
63 \@onelevel@sanitize\@tempc
64
65 \begin{document}
66 \maketitle
67
68 This example demonstrates the use of the new macros for declaring
69 class and package options of the \textsf{xkeyval} package. Please
70 study the files \verb+xkvex2.tex+, \verb+xkveca.cls+,
71 \verb+xkvecb.cls+, \verb+xkvesa.sty+, \verb+xkvesb.sty+ and
72 \verb+xkvesc.sty+ carefully to understand the output below.\\
73
74 Set by \verb+xkveca.cls+: \keyi\par
75 Set by \verb+xkvesa.sty+, copied from \verb+\documentclass+: \keyia\par
76 Set by \verb+xkvesa.sty+: \keyii\par
77 Set by \verb+xkvesb.sty+, passed on from \verb+xkvesa.sty+: \keyiii\par
78 Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyiv\par
79 Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyv\par
80 Set by the class, copied by \verb+xkvesc.sty+: \keyvi\par
81 Set by \verb+xkvesc.sty+: \keyvii\par
82 Set by \verb+xkvecb.cls+, passed on from \verb+xkveca.cls+: \keyviii\\
83
84 The document class is: \XKV@documentclass\par
85 Unused global options: \texttt{\@tempb}\\
86
87 Notice the content of the following macros.\par
88 \verb+\@classoptionslist+: \texttt{\@tempa}\par
89 \verb+\XKV@classoptionslist+:\par\texttt{\@tempc}\\
90
91 This shows that \verb+key=value+ pairs have been deleted from the
92 class options list so that subsequent packages which are not using
93 \textsf{xkeyval} and are scanning this list will not run into
94 problems.\\
95
96 \newpage
97 This page shows that key values are only expanded when they are
98 actually used. They are not expanded during option processing.\\
99
100 \keyi\par
101 \keyii\par
102 \keyiv
103
104 \end{document}
105 \endinput
106 %%
107 %% End of file `xkvex4.tex'.