| 1 |
\addsec{Introduction} |
| 2 |
%The name \expkv\ stands for \emph{exp}andable \emph{k}ey-\emph{v}alue and shall |
| 3 |
%be pronounced \enquote{axe(b) kay vee}. |
| 4 |
|
| 5 |
This bundle consists of different packages the base being \expkv. Most of these |
| 6 |
packages are available for \hologo{plainTeX}, \LaTeXe, and \hologo{ConTeXt}. For |
| 7 |
stylistic reasons the package names are printed as |
| 8 |
\expkvLogoFormat{\textit{$\langle$pkg$\rangle$}}, but the files are named |
| 9 |
\texttt{expkv-\meta{pkg}} (CTAN-rules don't allow \string| in names), so in |
| 10 |
order to load \expkvc\ in \LaTeXe\ you should use |
| 11 |
\begin{enverb}[no-tcb] |
| 12 |
\usepackage{expkv-cs} |
| 13 |
\end{enverb} |
| 14 |
Each section describing a package of this bundle has next to its heading the |
| 15 |
formats in which they work printed flush right. If more than a single format is |
| 16 |
supported by a package the functionality is defined by the \hologo{plainTeX} |
| 17 |
variant and the other variants only load the generic code in a way suitable for |
| 18 |
the format. |
| 19 |
|
| 20 |
\addssec{Terminology} |
| 21 |
This documentation uses a few terms which always mean specific things: |
| 22 |
\begin{description} |
| 23 |
\item[\kv\ pair] |
| 24 |
is one element in a comma separated list which contains at least one equals |
| 25 |
sign \emph{not} contained in any braces, and the first such equals sign is |
| 26 |
the separator between the \key\ (with an optional \expansion\ prefix) and |
| 27 |
the \val. |
| 28 |
\item[\key] |
| 29 |
means the entire left-hand side of a \kv\ pair with an optional \expansion\ |
| 30 |
prefix stripped, or if =\val\ is omitted the complete list element, again |
| 31 |
with an \expansion\ prefix stripped. |
| 32 |
\item[\key-name] |
| 33 |
synonymous to \key. |
| 34 |
\item[\Vkey] |
| 35 |
describes a \key\ in a \kv\ pair. |
| 36 |
\item[\Nkey] |
| 37 |
describes a \key\ for which =\val\ was or should be omitted. |
| 38 |
\item[\val] |
| 39 |
is the right-hand side of a \kv\ pair. |
| 40 |
\item[\kv\ list] |
| 41 |
is a comma separated list containing \kv\ pairs and \Nkey{}s (each possibly |
| 42 |
with an \expansion\ prefix). |
| 43 |
\item[\kvarg] |
| 44 |
an argument that should get a \kv\ list. |
| 45 |
\item[\expansion\ prefix] |
| 46 |
an optional prefix in front of \key\ to specify \expansion-rules (see |
| 47 |
\autoref{sec:expkv:expansion}), that prefix consists of the \expansion-rules |
| 48 |
followed by a colon immediately followed by a space. |
| 49 |
\item[\expansion] |
| 50 |
a list of tokens specifying expansion steps for \key\ and \val. |
| 51 |
\item[\expansion-rule] |
| 52 |
a single expansion step in the \expansion-rules. |
| 53 |
\item[\expansion-rules] |
| 54 |
synonymous to \expansion. |
| 55 |
\item[\expnotation] |
| 56 |
the notation of \expansion-rules in form of the \expansion\ prefix. |
| 57 |
\item[key-code] |
| 58 |
the code that is executed for a given \key. |
| 59 |
\item[key-macro] |
| 60 |
the internal macro that stores the key-code. |
| 61 |
\end{description} |
| 62 |
|
| 63 |
Though not really terminology but more typographic representation I want to |
| 64 |
highlight a distinction between two different types of code listings in this |
| 65 |
documentation. I use the following looks to show a code example and its results: |
| 66 |
\begin{enverb}[same-line=0.6] |
| 67 |
\newcommand*\foo{This is an example.} |
| 68 |
\foo |
| 69 |
\end{enverb} |
| 70 |
And this is how a syntax summary or a syntax example looks like (this is more |
| 71 |
abstract than an example and contains short meta-descriptions of inputs): |
| 72 |
\begin{syntaxexample} |
| 73 |
\cs[no-index]{function}\marg{syntax} |
| 74 |
\end{syntaxexample} |
| 75 |
Inside such syntax summaries the following rules usually apply (and \meta{arg} |
| 76 |
would be the meta description here): |
| 77 |
\begin{description}[font=\small\ttfamily] |
| 78 |
\item[\marg{arg}] |
| 79 |
a mandatory argument is shown in braces |
| 80 |
\item[\meta{arg}] |
| 81 |
a mandatory argument that should be a single token is shown without |
| 82 |
additional parentheses/braces/brackets |
| 83 |
\item[\oarg{arg}] |
| 84 |
an optional argument is shown in brackets (and should be input with |
| 85 |
brackets) |
| 86 |
\item[\meta{*}] |
| 87 |
an optional star is shown like this |
| 88 |
\end{description} |
| 89 |
If other types of arguments are displayed the documentation will explain what |
| 90 |
they mean in this particular place. |
| 91 |
|
| 92 |
\addssec{Category Codes} |
| 93 |
Supporting different category codes of a single character code makes the |
| 94 |
programmer's life harder in \TeX, but there are valid reasons to make some |
| 95 |
active, or letter. Because of this the packages in this bundle support different |
| 96 |
category codes for specific syntax relevant characters (unless otherwise |
| 97 |
documented). This doesn't mean that \expkv\ changes any category codes, only |
| 98 |
that parsing is correct \emph{if} they are changed later (the codes listed |
| 99 |
assume standard category codes of \hologo{plainTeX} and \LaTeXe\ apply while |
| 100 |
\expkv\ is loaded). The supported tokens are: |
| 101 |
\begin{description} |
| 102 |
\item[=] \tkn{=}{12} and \tkn{=}{13} |
| 103 |
\item[,] \tkn{,}{12} and \tkn{,}{13} |
| 104 |
\item[:] (for the \expnotation) \tkn{:}{11}, \tkn{:}{12}, and \tkn{:}{13} |
| 105 |
\item[*] (for starred macros) \tkn{*}{3}, \tkn{*}{4}, \tkn{*}{6}, \tkn{*}{7}, |
| 106 |
\tkn{*}{8}, \tkn{*}{11}, \tkn{*}{12}, and \tkn{*}{13} |
| 107 |
\item[{[}] (for |\ekvoptarg|) only \tkn{[}{12} |
| 108 |
\item[{]}] (for |\ekvoptarg|) only \tkn{]}{12} |
| 109 |
\end{description} |
| 110 |
|
| 111 |
\addssec{Bugs} |
| 112 |
Just like \pkg{keyval}, \expkv\ is bug free. But if you find \pmso{bugs}hidden |
| 113 |
features\footnote{Thanks, David!} you can tell me about them either via mail |
| 114 |
(see the first page) or directly on GitLab if you have an account there: |
| 115 |
\url{https://gitlab.com/islandoftex/texmf/expkv-bundle} |