summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xkeyval/xkvex4.tex
blob: 916818b922fecd9588127e9e2bd2daab54f6313c (plain)
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
%%
%% This is file `xkvex4.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xkeyval.dtx  (with options: `xkvex4')
%% 
%% ---------------------------------------
%% Copyright (C) 2004-2014 Hendri Adriaens
%% ---------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Hendri Adriaens.
%%
%% This work consists of the file xkeyval.dtx and derived files
%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls,
%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex,
%% xkvex2.tex, xkvex3.tex and xkvex4.tex.
%%
%% The following files constitute the xkeyval bundle and must be
%% distributed as a whole: readme, xkeyval.pdf, keyval.tex,
%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx.
%%
%% Load LaTeX kernel macros patch
\RequirePackage{xkvltxp}

%% keyi will set \keyi in xkveca.cls
%% keyvi will set \keyvi in xkveca.cls and xkvesc.sty will pick
%% it up from \documentclass and redefine it
%% IgnoredGlobal and another=key will be considered as global
%% options to be passed on to packages. Not used anymore.
\documentclass[keyi=test1 on page \thepage,keyvi,another=key,IgnoredGlobal,10pt]{xkveca}

%% keyii will set \keyii in xkvesa.sty
%% keyiv will be passed to xkvesb.sty as unknown option
%% the other input will be passed on to xkvesb as well.
\usepackage[keyii=test2 on page \thepage,keyiv=test4 on page \thepage,test5]{xkvesa}

%% keyvii will set \keyvii in xkvesc.sty
\usepackage[keyvii]{xkvesc}

\title{\textsf{xkeyval} package\\\normalsize\emph{Example 4}}
\author{Hendri Adriaens}
\setlength{\parindent}{0cm}

\makeatletter
\let\@tempa\@classoptionslist
\let\@tempb\@unusedoptionlist
\let\@tempc\XKV@classoptionslist
\@onelevel@sanitize\@tempc

\begin{document}
\maketitle

This example demonstrates the use of the new macros for declaring
class and package options of the \textsf{xkeyval} package. Please
study the files \verb+xkvex2.tex+, \verb+xkveca.cls+,
\verb+xkvecb.cls+, \verb+xkvesa.sty+, \verb+xkvesb.sty+ and
\verb+xkvesc.sty+ carefully to understand the output below.\\

Set by \verb+xkveca.cls+: \keyi\par
Set by \verb+xkvesa.sty+, copied from \verb+\documentclass+: \keyia\par
Set by \verb+xkvesa.sty+: \keyii\par
Set by \verb+xkvesb.sty+, passed on from \verb+xkvesa.sty+: \keyiii\par
Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyiv\par
Set by \verb+xkvesb.sty+, passed on as unknown from \verb+xkvesa.sty+: \keyv\par
Set by the class, copied by \verb+xkvesc.sty+: \keyvi\par
Set by \verb+xkvesc.sty+: \keyvii\par
Set by \verb+xkvecb.cls+, passed on from \verb+xkveca.cls+: \keyviii\\

The document class is: \XKV@documentclass\par
Unused global options: \texttt{\@tempb}\\

Notice the content of the following macros.\par
\verb+\@classoptionslist+: \texttt{\@tempa}\par
\verb+\XKV@classoptionslist+:\par\texttt{\@tempc}\\

This shows that \verb+key=value+ pairs have been deleted from the
class options list so that subsequent packages which are not using
\textsf{xkeyval} and are scanning this list will not run into
problems.\\

\newpage
This page shows that key values are only expanded when they are
actually used. They are not expanded during option processing.\\

\keyi\par
\keyii\par
\keyiv

\end{document}
\endinput
%%
%% End of file `xkvex4.tex'.