Download The ltxkeys Package
Transcript
The ltxkeys package
19th December 2011
will be available in the macro \cmdhprefi@hfami@hkeyi. The command \hprefi@hfami@hkeyi is the
‘key macro’ and will hold the callback hcbki. This type of key is traditionally called ‘command
key’ (a name that most likely emanated from the xkeyval package) because it gives rise to the
macro \hmpihkeyi, but in the ltxkeys package even boolean, style and choice keys are associated
with this type of macro.
3.3.1 Command keys that share the same attributes
The commands \ltxkeys@cmdkey and \ltxkeys@newcmdkey can be used to introduce command
keys hkeysi that share the same path or bases (key prefix, key family, and macro prefix) and
callback hcbki. Simply replace hkeyi in these commands with the comma-separated list hkeysi.
Some users might prefer to see these commands in their plural forms when defining several keys
with the same callback. We have therefore provided the following aliases:
New macros: \ltxkeys@cmdkeys, \ltxkeys@newcmdkeys
19
20
\ltxkeys@cmdkeys[hprefi]{hfami}[hmpi]{hkeysi}[hdfti]{hcbki}
\ltxkeys@newcmdkeys[hprefi]{hfami}[hmpi]{hkeysi}[hdfti]{hcbki}
3.4 Style keys
Style keys are keys with dependants (i. e., keys that are processed when the master is set). They
have the following syntaxes:
New macros: \ltxkeys@stylekey, \ltxkeys@newstylekey
21
22
23
24
\ltxkeys@stylekey[hprefi]{hfami}[hmpi]{hkeyi}[hdfti](hdepsi){hcbki}
\ltxkeys@stylekey?[hprefi]{hfami}[hmpi]{hkeyi}[hdfti](hdepsi){hcbki}
\ltxkeys@newstylekey[hprefi]{hfami}[hmpi]{hkeyi}[hdfti](hdepsi){hcbki}
\ltxkeys@newstylekey?[hprefi]{hfami}[hmpi]{hkeyi}[hdfti](hdepsi){hcbki}
The dependants hdepsi have the syntax:
Dependant keys syntax
25
(
hkeytypei/hkeynamei/hdfti/hcbki;
another set of dependant; etc.
26
27
28
)
The default value hdfti and the callback hcbki can be absent in the syntax of style keys. hkeytypei
can be ‘ord’ (ordinary key), ‘cmd’ (command key), ‘bool’ (boolean key), or ‘choice’ (choice key).
Dependant keys always share the same key prefix hprefi, family hfami, and macro prefix hmpi with
the parent key.
If hmpi is given, the command \hmpihkeyi will hold the current user input for the parent key; otherwise the user input will be available in \stylehprefi@hfami@hkeyi. The macro \hprefi@hfami@hkeyi
will always hold the callback hcbki.
If the starred (?) variant is used, all undefined dependants will be defined and set on the fly as the
parent is being set. If the starred (?) variant isn’t used and undefined dependants occur, then an
error message will be flagged at the time the parent is being set.
Most of the time it is possible to access the parent key’s current value with \parentval. Within
hdfti and hcbki of hdepsi, it is possible to refer to the parent key’s callback with its full macro
Page 7 of 66