• No results found

The l3keys2e package LATEX2ε

N/A
N/A
Protected

Academic year: 2021

Share "The l3keys2e package LATEX2ε"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The l3keys2e package

L

A

TEX 2ε option processing using L

A

TEX3 keys

The L

A

TEX Project

Released 2021-08-27

The key–value method for optional arguments is very popular, as it allows the class or package author to define a large number of options with a simple interface. The expl3 bundle of LATEX3 base code includes the module l3keys for defining keys, but to use these

when loading LATEX 2ε packages and classes requires extra support. That support is

provided by this small package, which is intended to enable LATEX 2ε packages to benefit

from the power of the LATEX3 key–value system.

0.1

Creating and using keyval options

As with any key–value input, using key–value pairs as package or class options has two parts. The first stage is to define one or more keys, using the \keys_define:nn function. For example, an option which simply stores a value would be created using:

\keys_define:nn { module }

{ option .tl_set:N = \l_module_variable_tl }

On its own, this will not make the key an option for the package or class containing the definition. The second stage is therefore to process the current options, searching for applicable keys.

\ProcessKeysOptions {⟨module ⟩}

The \ProcessKeysOptions function is used to check the current option list against the keys defined for {⟨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 \keys_set:nn. For example, the option defined earlier would be processed by the line

\ProcessKeysOptions { module }

\ProcessKeysOptions

\ProcessKeysPackageOptions {⟨module ⟩}

This function works in a similar manner to \ProcessKeysOptions. When used in a LATEX 2ε package, \ProcessKeysPackageOptions will not examine any class options

available. In contrast, \ProcessKeysOptions does parse class options (in common with the LATEX 2ε kernel function \ProcessOptions).

\ProcessKeysPackageOptions

E-mail: [email protected]

(2)

When passing unknown keys to other packages, the standard LATEX \CurrentOption

command is available and should be used. In contrast to \l_keys_key_str, \CurrentOption is a token list and thus retains category code information. Depending on how options are used by third-party packages, this may be essential for the option to be recognised.

Index

The italic numbers denote the pages where the corresponding entry is described, numbers underlined point to the definition, all others indicate the places where it is used.

C \CurrentOption . . . 2 K keys commands: \keys_define:nn . . . 1 \l_keys_key_str . . . 2 \keys_set:nn . . . 1 P \ProcessKeysOptions . . . 1 \ProcessKeysPackageOptions . . . 1 \ProcessOptions . . . 1 T

TEX and LATEX 2ε commands:

\CurrentOption . . . 2

Referenties

GERELATEERDE DOCUMENTEN

Beginning with British American Tobacco in 2002, each of the big players (just 10 brands control a quarter of the tobacco industry) began to roll out an annual corporate social

So, by redefining this macro we can feed a variable (a L3 sequence), and then do what it usually does, which is to define each label with the internal macro \@newl@bel, when the

zref-check depends on zref, as the name entails, which means it is able to work with zref labels, in general created by \zlabel, but also with \zctarget and the zcregion

For example, the code point U+006E (the Latin lowercase ”n”) followed by U+0303 (the combining tilde) is defined by Unicode to be canonically equivalent to the single code point

For long section headings to wrap around within the TOC, we need to take the hyperref option linktocpage, unless pdflatex or xelatex are used.. 1.1 Now is the time for all good men

As we have mentioned above this version of the greek option of the babel package supports the use of Greek numerals. The commands \greeknumeral and \Greeknumeral produce the

\Z and \ZZ are different only for the second is used for backreferences, or for typical in serial zoological keys references for theses and antitheses.. These two commands along

The fortextbook option provides a number of features of value to textbook authors: (1) For the instructor edition, answers can be placed in a wide mar- gin, or inline; (2) short or