Etoolbox - e-TeX
Etoolbox - e-TeX
Etoolbox - e-TeX
Contents
1 Introduction 1 3 Author Commands 6
1.1 About . . . . . . . . . . . 1 3.1 Definitions . . . . . . . . . 6
1.2 License . . . . . . . . . . . 1 3.2 Expansion Control . . . . 10
3.3 Hook Management . . . . 10
3.4 Patching . . . . . . . . . . 13
2 User Commands 2 3.5 Boolean Flags . . . . . . . 14
2.1 Definitions . . . . . . . . . 2 3.6 Generic Tests . . . . . . . 17
2.2 Patching . . . . . . . . . . 2 3.7 List Processing . . . . . . 28
2.3 Protection . . . . . . . . . 3 3.8 Miscellaneous Tools . . . 32
2.4 Lengths and Counters . . 3
4 Reporting issues 32
2.5 Document Hooks . . . . . 3
2.6 Environment Hooks . . . 5 5 Revision History 33
1 Introduction
1.1 About etoolbox
The etoolbox package is a toolbox of programming tools geared primarily towards
LaTeX class and package authors. It provides LaTeX frontends to some of the new
primitives provided by e-TeX as well as some generic tools which are not related to
e-TeX but match the profile of this package.
1.2 License
Copyright © 2007–2011 Philipp Lehman, 2015–2020 Joseph Wright. Permission is
granted to copy, distribute and/or modify this software under the terms of the LaTeX
Project Public License, version 1.3c or later.1
1
http://www.latex-project.org/lppl/
1
2 User Commands
The tools in this section are geared towards regular users as well as class and pack-
age authors.
2.1 Definitions
\newrobustcmd{hcommandi}[hargumentsi][hoptarg defaulti]{hreplacement texti}
\newrobustcmd*{hcommandi}[hargumentsi][hoptarg defaulti]{hreplacement texti}
The syntax and behavior of this command is similar to \newcommand except that the
newly defined hcommandi will be robust. The behavior of this command differs from
the \DeclareRobustCommand command from the LaTeX kernel in that it issues an
error rather than just an informational message if the hcommandi is already defined.
Since it uses e-TeX’s low-level protection mechanism rather than the corresponding
higher-level LaTeX facilities, it does not require an additional macro to implement
the ‘robustness’.
The syntax and behavior of this command is similar to \renewcommand except that
the redefined hcommandi will be robust.
The syntax and behavior of this command is similar to \providecommand except that
the newly defined hcommandi will be robust. Note that this command will provide
a robust definition of the hcommandi only if it is undefined. It will not make an
already defined hcommandi robust.
2.2 Patching
\robustify{hcommandi}
2
2.3 Protection
\protecting{hcodei}
This command applies LaTeX’s protection mechanism, which normally requires pre-
fixing each fragile command with \protect, to an entire chunk of arbitrary hcodei.
Its behavior depends on the current state of \protect. Note that the braces around
the hcodei are mandatory even if it is a single token.
3
\AfterPreamble{hcodei}
This hook is a variant of \AtBeginDocument which may be used in both the pream-
ble and the document body. When used in the preamble, it behaves exactely like
\AtBeginDocument. When used in the document body, it immediately executes its
hcodei argument. \AtBeginDocument would issue an error in this case. This hook is
useful to defer code which needs to write to the main aux file.
\AtEndPreamble{hcodei}
This hook differs from \AtBeginDocument in that the hcodei is executed right at the
end of the preamble, before the main aux file (as written on the previous LaTeX
pass) is read and prior to any \AtBeginDocument code. Note that it is not possible
to write to the aux file at this point.
\AfterEndPreamble{hcodei}
This hook differs from \AtBeginDocument in that the hcodei is executed at the very
end of \begin{document}, after any \AtBeginDocument code. Note that commands
whose scope has been restricted to the preamble with \@onlypreamble are no longer
available when this hook is executed.
\AfterEndDocument{hcodei}
This hook differs from \AtEndDocument in that the hcodei is executed at the very
end of the document, after the main aux file (as written on the current LaTeX pass)
has been read and after any \AtEndDocument code.
In a way, \AtBeginDocument code is part neither of the preamble nor the docu-
ment body but located in-between them since it gets executed in the middle of the
initialization sequence performed prior to typesetting. It is sometimes desirable to
move code to the end of the preamble because all requested packages have been
loaded at this point. \AtBeginDocument code, however, is executed too late if it
is required in the aux file. In contrast to that, \AtEndPreamble code is part of the
preamble; \AfterEndPreamble code is part of the document body and may contain
printable text to be typeset at the very beginning of the document. To sum that up,
LaTeX will perform the following tasks ‘inside’ \begin{document}:
4
• Execute any \AtBeginDocument code
• Complete initialization for document body
• Disable all \@onlypreamble commands
• Execute any \AfterEndPreamble code
Any \AtEndDocument code may be considered as being part of the document body
insofar as it is still possible to perform typesetting tasks and write to the main aux
file when it gets executed. \AfterEndDocument code is not part of the document
body. This hook is useful to evaluate the data in the aux file at the very end of a
LaTeX pass.
\AtBeginEnvironment{henvironmenti}{hcodei}
Appends arbitrary hcodei to a hook executed by the \begin command at the begin-
ning of a given henvironmenti, immediately before \henvironmenti, inside the group
opened by \begin.
\AtEndEnvironment{henvironmenti}{hcodei}
Appends arbitrary hcodei to a hook executed by the \end command at the end
of a given henvironmenti, immediately before \endhenvironmenti, inside the group
opened by \begin.
5
\BeforeBeginEnvironment{henvironmenti}{hcodei}
Appends arbitrary hcodei to a hook executed at a very early point by the \begin
command, before the group holding the environment is opened.
\AfterEndEnvironment{henvironmenti}{hcodei}
Appends arbitrary hcodei to a hook executed at a very late point by the \end com-
mand, after the group holding the environment has been closed.
3 Author Commands
The tools in this section are geared towards class and package authors.
3.1 Definitions
3.1.1 Macro Definitions
The tools in this section are simple but frequently required shorthands which extend
the scope of the \@namedef and \@nameuse macros from the LaTeX kernel.
\csdef{hcsnamei}hargumentsi{hreplacement texti}
Similar to the TeX primitive \def except that it takes a control sequence name as its
first argument. This command is robust and corresponds to \@namedef.
\csgdef{hcsnamei}hargumentsi{hreplacement texti}
Similar to the TeX primitive \gdef except that it takes a control sequence name as
its first argument. This command is robust.
\csedef{hcsnamei}hargumentsi{hreplacement texti}
Similar to the TeX primitive \edef except that it takes a control sequence name as
its first argument. This command is robust.
\csxdef{hcsnamei}hargumentsi{hreplacement texti}
Similar to the TeX primitive \xdef except that it takes a control sequence name as
its first argument. This command is robust.
\protected@csedef{hcsnamei}hargumentsi{hreplacement texti}
Similar to \csedef except that LaTeX’s protection mechanism is temporarily en-
abled. To put it in other words: this command is similar to the LaTeX kernel com-
mand \protected@edef except that it takes a control sequence name as its first
argument. This command is robust.
6
\protected@csxdef{hcsnamei}hargumentsi{hreplacement texti}
\cslet{hcsnamei}{hcommandi}
Similar to the TeX primitive \let except that the first argument is a control sequence
name. If hcommandi is undefined, hcsnamei will be undefined as well after the
assignment. This command is robust and may be prefixed with \global.
\letcs{hcommandi}{hcsnamei}
Similar to the TeX primitive \let except that the second argument is a control se-
quence name. If hcsnamei is undefined, the hcommandi will be undefined as well
after the assignment. This command is robust and may be prefixed with \global.
\csletcs{hcsnamei}{hcsnamei}
Similar to the TeX primitive \let except that both arguments are control sequence
names. If the second hcsnamei is undefined, the first hcsnamei will be undefined
as well after the assignment. This command is robust and may be prefixed with
\global.
\csuse{hcsnamei}
Takes a control sequence name as its argument and forms a control sequence to-
ken. This command differs from the \@nameuse macro in the LaTeX kernel in that it
expands to an empty string if the control sequence is undefined.
\undefhcommandi
Clears a hcommandi such that e-TeX’s \ifdefined and \ifcsname tests will consider
it as undefined. This command is robust and may be prefixed with \global.
\gundefhcommandi
\csundef{hcsnamei}
Similar to \undef except that it takes a control sequence name as its argument. This
command is robust and may be prefixed with \global.
7
\csgundef{hcsnamei}
Similar to \csundef but acts globally.
\csmeaning{hcsnamei}
Similar to the TeX primitive \meaning but takes a control sequence name as its
argument. If the control sequence is undefined, this command will not implicitly
assign a meaning of \relax to it.
\csshow{hcsnamei}
Similar to the TeX primitive \show but takes a control sequence name as its argu-
ment. If the control sequence is undefined, this command will not implicitly assign
a meaning of \relax to it. This command is robust.
8
\dimgdefhcommandi{hdimen expressioni}
\csdimdef{hcsnamei}{hdimen expressioni}
Similar to \dimdef except that it takes a control sequence name as its first argument.
\csdimgdef{hcsnamei}{hdimen expressioni}
Similar to \dimgdef except that it takes a control sequence name as its first argu-
ment.
\gluedefhcommandi{hglue expressioni}
Similar to \edef except that the hglue expressioni is processed with \glueexpr. The
hglue expressioni may be any arbitrary code which is valid in this context. The re-
placement text assigned to the hcommandi will be the result of that calculation. If
the hcommandi is undefined, it will be initialized to 0pt plus 0pt minus 0pt be-
fore the hglue expressioni is processed.
\gluegdefhcommandi{hglue expressioni}
\csgluedef{hcsnamei}{hglue expressioni}
Similar to \gluedef except that it takes a control sequence name as its first argu-
ment.
\csgluegdef{hcsnamei}{hglue expressioni}
Similar to \gluegdef except that it takes a control sequence name as its first argu-
ment.
\mudefhcommandi{hmuglue expressioni}
Similar to \edef except that the hmuglue expressioni is processed with \muexpr. The
hmuglue expressioni may be any arbitrary code which is valid in this context. The re-
placement text assigned to the hcommandi will be the result of that calculation. If the
hcommandi is undefined, it will be initialized to 0mu before the hmuglue expressioni
is processed.
\mugdefhcommandi{hmuglue expressioni}
9
\csmudef{hcsnamei}{hmuglue expressioni}
Similar to \mudef except that it takes a control sequence name as its first argument.
\csmugdef{hcsnamei}{hmuglue expressioni}
Similar to \mugdef except that it takes a control sequence name as its first argument.
\expandoncehcommandi
This command expands a hcommandi once and prevents further expansion of the
replacement text. This command is expandable.
\csexpandonce{hcsnamei}
Similar to \expandonce except that it takes a control sequence name as its argument.
\apptohhooki{hcodei}
This command appends arbitrary hcodei to a hhooki. If the hcodei contains any pa-
rameter characters, they need not be doubled. This command is robust.
\gapptohhooki{hcodei}
Similar to \appto except that the assignment is global. This command may be used
as a drop-in replacement for the \g@addto@macro command in the LaTeX kernel.
10
\eapptohhooki{hcodei}
\xapptohhooki{hcodei}
\protected@eapptohhooki{hcodei}
\protected@xapptohhooki{hcodei}
\csappto{hcsnamei}{hcodei}
Similar to \appto except that it takes a control sequence name as its first argument.
\csgappto{hcsnamei}{hcodei}
Similar to \gappto except that it takes a control sequence name as its first argument.
\cseappto{hcsnamei}{hcodei}
Similar to \eappto except that it takes a control sequence name as its first argument.
\csxappto{hcsnamei}{hcodei}
Similar to \xappto except that it takes a control sequence name as its first argument.
\protected@cseapptohhooki{hcodei}
\protected@csxapptohhooki{hcodei}
11
3.3.2 Prepending to a Hook
The tools in this section ‘prepend’ arbitrary code to a hook, i. e., the code is inserted
at the beginning of the hook rather than being added at the end.
\pretohhooki{hcodei}
Similar to \appto except that the hcodei is prepended.
\gpretohhooki{hcodei}
Similar to \preto except that the assignment is global.
\epretohhooki{hcodei}
Similar to \eappto except that the hcodei is prepended.
\xpretohhooki{hcodei}
Similar to \epreto except that the assignment is global.
\protected@epretohhooki{hcodei}
Similar to \epreto except that LaTeX’s protection mechanism is temporarily en-
abled.
\protected@xpretohhooki{hcodei}
Similar to \xpreto except that LaTeX’s protection mechanism is temporarily en-
abled.
\cspreto{hcsnamei}{hcodei}
Similar to \preto except that it takes a control sequence name as its first argument.
\csgpreto{hcsnamei}{hcodei}
Similar to \gpreto except that it takes a control sequence name as its first argument.
\csepreto{hcsnamei}{hcodei}
Similar to \epreto except that it takes a control sequence name as its first argument.
\csxpreto{hcsnamei}{hcodei}
Similar to \xpreto except that it takes a control sequence name as its first argument.
\protected@csepretohhooki{hcodei}
Similar to \protected@epreto except that it takes a control sequence name as its
first argument.
12
\protected@csxpretohhooki{hcodei}
Similar to \protected@xpreto except that it takes a control sequence name as its
first argument.
3.4 Patching
The tools in this section are useful to hook into or modify existing code. All com-
mands presented here preserve the parameters and the prefixes of the patched
hcommandi. Note that \outer commands may not be patched. Also note that the
commands in this section will not automatically issue any error messages if patching
fails. Instead, they take a hfailurei argument which should provide suitable fallback
code or an error message. Issuing \tracingpatches in the preamble will cause the
commands to write debugging information to the transcript file.
\patchcmd[hprefixi]{hcommandi}{hsearchi}{hreplacei}{hsuccessi}{hfailurei}
This command extracts the replacement text of a hcommandi, replaces hsearchi with
hreplacei, and reassembles the hcommandi. The pattern match is category code ag-
nostic and matches the first occurence of the hsearchi pattern in the replacement
text of the hcommandi to be patched. Note that the patching process involves deto-
kenizing the replacement text of the hcommandi and retokenizing it under the cur-
rent category code regime after patching. The category code of the @ sign is tem-
porarily set to 11. If the replacement text of the hcommandi includes any tokens
with non-standard category codes, the respective category codes must be adjusted
prior to patching. If the code to be replaced or inserted refers to the parameters
of the hcommandi to be patched, the parameter characters need not be doubled.
If an optional hprefixi is specified, it replaces the prefixes of the hcommandi. An
empty hprefixi argument strips all prefixes from the hcommandi. The assignment is
local. This command implicitly performs the equivalent of an \ifpatchable test
prior to patching. If this test succeeds, the command applies the patch and exe-
cutes hsuccessi. If the test fails, it executes hfailurei without modifying the original
hcommandi. This command is robust.
\ifpatchable{hcommandi}{hsearchi}{htruei}{hfalsei}
This command executes htruei if the hcommandi may be patched with \patchcmd
and if the hsearchi pattern is found in its replacement text, and hfalsei otherwise.
This command is robust.
\ifpatchable*{hcommandi}{htruei}{hfalsei}
Similar to \ifpatchable except that the starred variant does not require a search
pattern. Use this version to check if a command may be patched with \apptocmd
and \pretocmd.
13
\apptocmd{hcommandi}{hcodei}{hsuccessi}{hfailurei}
\pretocmd{hcommandi}{hcodei}{hsuccessi}{hfailurei}
This command is similar to \apptocmd except that the hcodei is inserted at the begin-
ning of the replacement text of the hcommandi. If the hcommandi is a parameterless
macro, it behaves like \preto from section 3.3.1. In contrast to \preto, \pretocmd
may also be used to patch commands with parameters. In this case, it will detokenize
the replacement text of the hcommandi, apply the patch, and retokenize it under the
current category code regime. The category code of the @ sign is temporarily set
to 11. The hcodei may refer to the parameters of the hcommandi. The assignment
is local. If patching succeeds, this command executes hsuccessi. If patching fails,
it executes hfailurei without modifying the original hcommandi. This command is
robust.
\tracingpatches Enables tracing for all patching commands, including \ifpatchable. The debug-
ging information will be written to the transcript file. This is useful if the reason
why a patch is not applied or \ifpatchable yields hfalsei is not obvious. This com-
mand must be issued in the preamble.
14
\newbool{hnamei}
Defines a new boolean flag called hnamei. If the flag has already been defined, this
command issues an error. The initial state of newly defined flags is false. This
command is robust.
\providebool{hnamei}
Defines a new boolean flag called hnamei unless it has already been defined. This
command is robust.
\booltrue{hnamei}
Sets the boolean flag hnamei to true. This command is robust and may be prefixed
with \global. It will issue an error if the flag is undefined.
\boolfalse{hnamei}
Sets the boolean flag hnamei to false. This command is robust and may be prefixed
with \global. It will issue an error if the flag is undefined.
\setbool{hnamei}{hvaluei}
Sets the boolean flag hnamei to hvaluei which may be either true or false. This
command is robust and may be prefixed with \global. It will issue an error if the
flag is undefined.
\ifbool{hnamei}{htruei}{hfalsei}
Expands to htruei if the state of the boolean flag hnamei is true, and to hfalsei
otherwise. If the flag is undefined, this command issues an error. This command
may be used to perform any boolean test based on plain TeX syntax, i. e., any test
normally employed like this:
\iftest true\else false\fi
This includes all flags defined with \newif as well as TeX primitives such as \ifmmode.
The \if prefix is omitted when using the flag or the primitive in the expression. For
example:
\ifmytest true\else false\fi
\ifmmode true\else false\fi
becomes
\ifbool{mytest}{true}{false}
\ifbool{mmode}{true}{false}
15
\notbool{hnamei}{hnot truei}{hnot falsei}
\newtoggle{hnamei}
Defines a new boolean flag called hnamei. If the flag has already been defined, this
command issues an error. The initial state of newly defined flags is false. This
command is robust.
\providetoggle{hnamei}
Defines a new boolean flag called hnamei unless it has already been defined. This
command is robust.
\toggletrue{hnamei}
Sets the boolean flag hnamei to true. This command is robust and may be prefixed
with \global. It will issue an error if the flag is undefined.
\togglefalse{hnamei}
Sets the boolean flag hnamei to false. This command is robust and may be prefixed
with \global. It will issue an error if the flag is undefined.
\settoggle{hnamei}{hvaluei}
Sets the boolean flag hnamei to hvaluei which may be either true or false. This
command is robust and may be prefixed with \global. It will issue an error if the
flag is undefined.
\iftoggle{hnamei}{htruei}{hfalsei}
Expands to htruei if the state of the boolean flag hnamei is true, and to hfalsei
otherwise. If the flag is undefined, this command issues an error.
16
\nottoggle{hnamei}{hnot truei}{hnot falsei}
Expands to htruei if the hcontrol sequencei is defined, and to hfalsei otherwise. Note
that control sequences will be considered as defined even if their meaning is \relax.
This command is a LaTeX wrapper for the e-TeX primitive \ifdefined.
\ifcsdef{hcsnamei}{htruei}{hfalsei}
Similar to \ifdef except that it takes a control sequence name as its first argument.
This command is a LaTeX wrapper for the e-TeX primitive \ifcsname.
\ifundef{hcontrol sequencei}{htruei}{hfalsei}
\ifcsundef{hcsnamei}{htruei}{hfalsei}
Similar to \ifundef except that it takes a control sequence name as its first argu-
ment. This command may be used as a drop-in replacement for the \@ifundefined
test in the LaTeX kernel.
\ifdefmacro{hcontrol sequencei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is defined and is a macro, and to hfalsei
otherwise.
\ifcsmacro{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefmacro except that it takes a control sequence name as its first
argument.
\ifdefparam{hcontrol sequencei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is defined and is a macro with one or more
parameters, and to hfalsei otherwise.
17
\ifcsparam{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefparam except that it takes a control sequence name as its first
argument.
\ifdefprefix{hcontrol sequencei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is defined and is a macro prefixed with
\long and/or \protected, and to hfalsei otherwise. Note that \outer macros may
not be tested.
\ifcsprefix{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefprefix except that it takes a control sequence name as its first
argument.
\ifdefprotected{hcontrol sequencei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is defined and is a macro prefixed with
\protected, and to hfalsei otherwise.
\ifcsprotected{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefprotected except that it takes a control sequence name as its first
argument.
\ifdefltxprotect{hcontrol sequencei}{htruei}{hfalsei}
Executes htruei if the hcontrol sequencei is defined and is a LaTeX protection shell,
and hfalsei otherwise. This command is robust. It will detect commands which have
been defined with \DeclareRobustCommand or by way of a similar technique.
\ifcsltxprotect{hcsnamei}{htruei}{hfalsei}
\ifdefempty{hcontrol sequencei}{htruei}{hfalsei}
\ifcsempty{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefempty except that it takes a control sequence name as its first
argument.
18
\ifdefvoid{hcontrol sequencei}{htruei}{hfalsei}
\ifcsvoid{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefvoid except that it takes a control sequence name as its first argu-
ment.
Compares two control sequences and expands to htruei if they are equal in the sense
of \ifx, and to hfalsei otherwise. In contrast to \ifx, this test will also yield hfalsei
if both control sequences are undefined or have a meaning of \relax.
\ifcsequal{hcsnamei}{hcsnamei}{htruei}{hfalsei}
\ifdefstring{hcommandi}{hstringi}{htruei}{hfalsei}
\long\edef\mymacro#1#2{\string&}
\ifdefstring{\mymacro}{&}{true}{false}
would yield htruei. The prefix and the parameters of \mymacro as well as the cate-
gory codes in the replacement text are ignored.
\ifcsstring{hcsnamei}{hstringi}{htruei}{hfalsei}
Similar to \ifdefstring except that it takes a control sequence name as its first
argument.
\ifdefstrequal{hcommandi}{hcommandi}{htruei}{hfalsei}
Performs a category code agnostic string comparison of the replacement text of two
commands. This command is similar to \ifdefstring except that both arguments
to be compared are macros. This command is robust.
19
\ifcsstrequal{hcsnamei}{hcsnamei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is a TeX \count register allocated with
\newcount, and to hfalsei otherwise.
\ifcscounter{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefcounter except that it takes a control sequence name as its first
argument.
\ifltxcounter{hnamei}{htruei}{hfalsei}
\ifdeflength{hcontrol sequencei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is a TeX \skip register allocated with
\newskip or \newlength, and to hfalsei otherwise.
\ifcslength{hcsnamei}{htruei}{hfalsei}
Similar to \ifdeflength except that it takes a control sequence name as its first
argument.
\ifdefdimen{hcontrol sequencei}{htruei}{hfalsei}
Expands to htruei if the hcontrol sequencei is a TeX \dimen register allocated with
\newdimen, and to hfalsei otherwise.
\ifcsdimen{hcsnamei}{htruei}{hfalsei}
Similar to \ifdefdimen except that it takes a control sequence name as its first
argument.
20
3.6.3 String Tests
\ifstrequal{hstringi}{hstringi}{htruei}{hfalsei}
Compares two strings and executes htruei if they are equal, and hfalsei otherwise.
The strings are not expanded in the test and the comparison is category code agnos-
tic. Control sequence tokens in any of the hstringi arguments will be detokenized
and treated as strings. This command is robust.
\ifstrempty{hstringi}{htruei}{hfalsei}
Expands to htruei if the hstringi is empty, and to hfalsei otherwise. The hstringi is not
expanded in the test.
\ifblank{hstringi}{htruei}{hfalsei}
Expands to htruei if the hstringi is blank (empty or spaces), and to hfalsei otherwise.
The hstringi is not expanded in the test.
\notblank{hstringi}{hnot truei}{hnot falsei}
Similar to \ifblank but negates the test.
Technically, this command is a LaTeX wrapper for the TeX primitive \ifnum, incorpo-
rating \numexpr. Note that \numexpr will round the result of all integer expressions,
i. e., both expressions will be processed and rounded prior to being compared. In
the last line of the above examples, the result of the second expression is 2.5, which
is rounded to 3, hence \ifnumcomp will expand to htruei.
21
\ifnumequal{hinteger expressioni}{hinteger expressioni}{htruei}{hfalsei}
\ifnumodd{hinteger expressioni}{htruei}{hfalsei}
Evaluates an integer expression and expands to htruei if the result is an odd number,
and to hfalsei otherwise. Technically, this command is a LaTeX wrapper for the TeX
primitive \ifodd, incorporating \numexpr.
\ifdimcomp{1cm}{=}{28.45274pt}{true}{false}
\ifdimcomp{(7pt + 5pt) / 2}{<}{2pt}{true}{false}
\ifdimcomp{(3.725pt + 0.025pt) * 2}{<}{7pt}{true}{false}
\newlength{\lengthA}
\setlength{\lengthA}{7.25pt}
\newlength{\lengthB}
\setlength{\lengthB}{4.75pt}
\ifdimcomp{(\lengthA + \lengthB) / 2}{>}{2.75pt * 2}{true}{false}
\ifdimcomp{(\lengthA + \lengthB) / 2}{>}{25pt / 6}{true}{false}
Technically, this command is a LaTeX wrapper for the TeX primitive \ifdim, incor-
porating \dimexpr. Since both \ifdimcomp and \ifnumcomp are expandable, they
may also be nested:
\ifnumcomp{\ifdimcomp{5pt+5pt}{=}{10pt}{1}{0}}{>}{0}{true}{false}
22
\ifdimgreater{hdimen expressioni}{hdimen expressioni}{htruei}{hfalsei}
Alternative syntax for \ifdimcomp{...}{>}{...}{...}{...}.
\ifdimless{hdimen expressioni}{hdimen expressioni}{htruei}{hfalsei}
Alternative syntax for \ifdimcomp{...}{<}{...}{...}{...}.
\ifboolexpr{hexpressioni}{htruei}{hfalsei}
Evaluates the hexpressioni and executes htruei if it is true, and hfalsei otherwise. The
hexpressioni is evaluated sequentially from left to right. The following elements,
discussed in more detail below, are available in the hexpressioni: the test operators
togl, bool, test; the logical operators not, and, or; and the subexpression delimiter
(...). Spaces, tabs, and line endings may be used freely to arrange the hexpressioni
visually. Blank lines are not permissible in the hexpressioni. This command is robust.
\ifboolexpe{hexpressioni}{htruei}{hfalsei}
An expandable version of \ifboolexpr which may be processed in an expansion-
only context, e. g., in an \edef or in a \write operation. Note that all tests used
in the hexpressioni must be expandable, even if \ifboolexpe is not located in an
expansion-only context.
\whileboolexpr{hexpressioni}{hcodei}
Evaluates the hexpressioni like \ifboolexpr and repeatedly executes the hcodei while
the expression is true. The hcodei may be any valid TeX or LaTeX code. This com-
mand is robust.
\unlessboolexpr{hexpressioni}{hcodei}
Similar to \whileboolexpr but negates the hexpressioni, i. e., it keeps executing the
hcodei repeatedly unless the expression is true. This command is robust.
togl Use the togl operator to test the state of a flag defined with \newtoggle. For
example:
23
\iftoggle{mytoggle}{true}{false}
becomes
The togl operator may be used with both \ifboolexpr and \ifboolexpe.
bool Use the bool operator to perform a boolean test based on plain TeX syntax, i. e., any
test normally employed like this:
This includes all flags defined with \newif as well as TeX primitives such as \ifmmode.
The \if prefix is omitted when using the flag or the primitive in the expression. For
example:
becomes
This also works with flags defined with \newbool (see § 3.5.1). In this case
\ifbool{mybool}{true}{false}
becomes
The bool operator may be used with both \ifboolexpr and \ifboolexpe.
test Use the test operator to perform a test based on LaTeX syntax, i. e., any test nor-
mally employed like this:
\iftest{true}{false}
This applies to all macros based on LaTeX syntax, i. e., the macro must take a htruei
and a hfalsei argument and these must be the final arguments. For example:
24
\ifdef{\somemacro}{true}{false}
\ifdimless{\textwidth}{365pt}{true}{false}
\ifnumcomp{\value{somecounter}}{>}{3}{true}{false}
When using such tests in the hexpressioni, their htruei and hfalsei arguments are
omitted. For example:
\ifcsdef{mymacro}{true}{false}
becomes
\ifboolexpr{ test {\ifcsdef{mymacro}} }{true}{false}
and
\ifnumcomp{\value{mycounter}}{>}{3}{true}{false}
becomes
\ifboolexpr{
test {\ifnumcomp{\value{mycounter}}{>}{3}}
}
{true}
{false}
The test operator may be used with \ifboolexpr without any restrictions. It may
also be used with \ifboolexpe, provided that the test is expandable. Some of the
generic tests in § 3.6 are robust and may not be used with \ifboolexpe, even if
\ifboolexpe is not located in an expansion-only context. Use \ifboolexpr instead
if the test is not expandable.
not The not operator negates the truth value of the immediately following element. You
may prefix togl, bool, test, and subexpressions with not. For example:
\ifboolexpr{
not bool {mybool}
}
{true}
{false}
25
will yield htruei if mybool is false and hfalsei if mybool is true, and
\ifboolexpr{
not ( bool {boolA} or bool {boolB} )
}
{true}
{false}
and The and operator expresses a conjunction (both a and b). The hexpressioni is true if
all elements joined with and are true. For example:
\ifboolexpr{
bool {boolA} and bool {boolB}
}
{true}
{false}
will yield htruei if both bool tests are true. The nand operator (negated and, i. e.,
not both) is not provided as such but may be expressed by using and in a negated
subexpression. For example:
may be written as
\ifboolexpr{
togl {toglA} or togl {toglB}
}
{true}
{false}
will yield htruei if either togl test or both tests are true. The nor operator (negated
non-exclusive disjunction, i. e., neither a nor b nor both) is not provided as such but
may be expressed by using or in a negated subexpression. For example:
may be written as
26
not ( bool {boolA} or bool {boolB} )
is true if both subexpressions are true, i. e., if at least one of boolA/boolB and at
least one of boolC/boolD is true. Subexpressions are generally not required if all
elements are joined with and or with or. For example, the expressions
bool {boolA} and bool {boolB} and {boolC} and bool {boolD}
bool {boolA} or bool {boolB} or {boolC} or bool {boolD}
will yield the expected results: the first one is true if all elements are true; the second
one is true if at least one element is true. However, when combining and and or,
it is advisable to always group the elements in subexpressions in order to avoid
potential misconceptions which may arise from differences between the semantics
of formal boolean expressions and the semantics of natural languages. For example,
the following expression
is always true if sugar is true since the or operator will take the result of the and
evaluation as input. In contrast to the meaning of this expression when pronounced
in English, it is not processed like this
27
3.7 List Processing
3.7.1 User Input
The tools in this section are primarily designed to handle user input. When building
lists for internal use by a package, using the tools in section 3.7.2 may be preferable
as they allow testing if an element is in a list.
\DeclareListParser{hcommandi}{hseparatori}
This command defines a list parser similar to the \docsvlist command below,
which is defined like this:
\DeclareListParser{\docsvlist}{,}
Note that the list parsers are sensitive to the category code of the hseparatori.
\DeclareListParser*{hcommandi}{hseparatori}
The starred variant of \DeclareListParser defines a list parser similar to the \forcsvlist
command below, which is defined like this:
\DeclareListParser*{\forcsvlist}{,}
28
In this example, the list is written to the log file as part of an informational message.
The list processing takes place during the \write operation.
\listadd{hlistmacroi}{hitemi}
\listgadd{hlistmacroi}{hitemi}
\listeadd{hlistmacroi}{hitemi}
Similar to \listadd except that the hitemi is expanded at definition-time. Only the
new hitemi is expanded, the hlistmacroi is not. If the expanded hitemi is blank, it is
not added to the list.
\listxadd{hlistmacroi}{hitemi}
\listcsadd{hlistcsnamei}{hitemi}
Similar to \listadd except that it takes a control sequence name as its first argu-
ment.
2
The character | with category code 3. Note that you may not typeset a list by saying \listname.
Use \show instead to inspect the list.
29
\listcsgadd{hlistcsnamei}{hitemi}
\listcseadd{hlistcsnamei}{hitemi}
Similar to \listeadd except that it takes a control sequence name as its first argu-
ment.
\listcsxadd{hlistcsnamei}{hitemi}
\listremove{hlistmacroi}{hitemi}
\listgremove{hlistmacroi}{hitemi}
\listcsremove{hlistcsnamei}{hitemi}
Similar to \listremove except that it takes a control sequence name as its first
argument.
\listcsgremove{hlistcsnamei}{hitemi}
\dolistloop{hlistmacroi}
This command loops over all items in a hlistmacroi and executes the auxiliary com-
mand \do for every item in the list, passing the item as an argument. The list loop
itself is expandable. You may use \listbreak at the end of the replacement text of
\do to stop processing and discard the remaining items in the list. Here is a usage
example which prints an internal list called \mylist as an itemize environment:
\begin{itemize}
\renewcommand*{\do}[1]{\item #1}
\dolistloop{\mylist}
\end{itemize}
\dolistcsloop{hlistcsnamei}
Similar to \dolistloop except that it takes a control sequence name as its argument.
30
\forlistloop{hhandleri}{hlistmacroi}
\newcounter{itemcount}
\begin{itemize}
\forlistloop{\stepcounter{itemcount}\item}{\mylist}
\item Total: \number\value{itemcount} items
\end{itemize}
\forlistcsloop{hhandleri}{hlistcsnamei}
Similar to \forlistloop except that it takes a control sequence name as its second
argument.
\ifinlist{hitemi}{hlistmacroi}{htruei}{hfalsei}
This command executes htruei if the hitemi is included in a hlistmacroi, and hfalsei
otherwise. Note that this test uses pattern matching based on TeX’s argument scan-
ner to check if the search string is included in the list. This means that it is usually
faster than looping over all items in the list, but it also implies that the items must
not include curly braces which would effectively hide them from the scanner. In
other words, this macro is most useful when dealing with lists of plain strings rather
than printable data. When dealing with printable text, it is safer to use \dolistloop
to check if an item is in the list as follows:
\renewcommand*{\do}[1]{%
\ifstrequal{#1}{item}
{item found!\listbreak}
{}}
\dolistloop{\mylist}
\xifinlist{hitemi}{hlistmacroi}{htruei}{hfalsei}
Similar to \ifinlist except that the hitemi is expanded prior to the test.
\ifinlistcs{hitemi}{hlistcsnamei}{htruei}{hfalsei}
Similar to \ifinlist except that it takes a control sequence name as its second
argument.
31
\xifinlistcs{hitemi}{hlistcsnamei}{htruei}{hfalsei}
Similar to \xifinlist except that it takes a control sequence name as its second
argument.
The TeX primitive \romannumeral converts an integer to a Roman numeral but TeX
or LaTeX provide no command which goes the opposite way. \rmntonum fills this
gap. It takes a Roman numeral as its argument and converts it to the correspond-
ing integer. Since it is expandable, it may also be used in counter assignments or
arithmetic tests:
\rmntonum{mcmxcv}
\setcounter{counter}{\rmntonum{CXVI}}
\ifnumless{\rmntonum{mcmxcviii}}{2000}{true}{false}
\ifrmnum{hstringi}{htruei}{hfalsei}
4 Reporting issues
The development code for etoolbox is hosted on GitHub: https://github.com/
josephwright/etoolbox. This is the best place to log any issues with the package.
32
5 Revision History
This revision history is a list of changes relevant to users of this package. Changes
of a more technical nature which do not affect the user interface or the behavior
of the package are not included in the list. If an entry in the revision history states
that a feature has been improved or extended, this indicates a syntactically backwards
compatible modification, such as the addition of an optional argument to an existing
command. Entries stating that a feature has been modified demand attention. They
indicate a modification which may require changes to existing documents in some,
hopefully rare, cases. The numbers on the right indicate the relevant section of this
manual.
2.5k 2020-10-05
Internal updates
2.5j 2020-08-24
Track LATEX 2ε kernel changes
2.5i 2020-07-13
Track LATEX 2ε kernel changes
2.5h 2019-09-21
Add missing \gundef
2.5g 2019-09-09
Update patching of \begin and \end in advance of LATEX kernel changes
2.5f 2018-08-18
Fix issue with \ifdefempty, \ifcsempty, \ifdefvoid and \ifcsvoid when
applied to macros expanding to space tokens
2.5e 2018-02-11
More work on empty list separator in \DeclareListParser
2.5d 2018-02-10
Allow for empty list separator in \DeclareListParser
2.5c 2018-02-06
Fix issue with \forcsvlist introduced by v2.5b
33
2.5b 2018-02-04
Preserve braces in some internal steps
Internal performance improvements in list processors
2.5a 2018-02-03
Internal performance improvements in list processors
2.5 2017-11-22
Added \csgundef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Added \gundef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Allow scanning of macros containing new line characters
2.4 2017-01-02
Renamed \listdel to \listremove (name clash) . . . . . . . . . . . . . 3.7.2
Renamed \listgdel to \listgremove (name clash) . . . . . . . . . . . . 3.7.2
2.3 2016-12-26
Added \listdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listgdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
2.2b 2016-12-01
Fixed \ifdefltxprotect for some types of LaTeX robust commands
Remove redundant macro after \robustify processing
2.2a 2015-08-02
Fixed robustness bug in \ifblank/\notblank
2.2 2015-05-04
Added \csmeaning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
2.1d 2015-03-19
Fixed issue with bm and some classes
2.1c 2015-03-15
Fixed space bug in \ifpatchable
Fixed space bug in \patchcmd
Fixed space bug in \robustify
34
2.1b 2015-03-10
Minor documentation fixes
2.1a 2015-03-10
New maintainer: Joseph Wright
Skip loading etex package with newer LaTeX kernel releases
2.1 2011-01-03
Added \AtBeginEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . 2.6
Added \AtEndEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6
Added \BeforeBeginEnvironment . . . . . . . . . . . . . . . . . . . . . . 2.6
Added \AfterEndEnvironment . . . . . . . . . . . . . . . . . . . . . . . . 2.6
Added \ifdefstrequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsstrequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefcounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
Added \ifcscounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
Added \ifltxcounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
Added \ifdeflength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
Added \ifcslength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
Added \ifdefdimen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
Added \ifcsdimen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2
2.0a 2010-09-12
Fixed bug in \patchcmd, \apptocmd, \pretocmd . . . . . . . . . . . . . . 3.4
2.0 2010-08-21
Added \csshow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Added \DeclareListParser* . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.1
Added \forcsvlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.1
Added \forlistloop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \forlistcsloop . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Allow testing \par in macro tests . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Fixed some bugs
35
1.9 2010-04-10
Improved \letcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Improved \csletcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Improved \listeadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Improved \listxadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \notblank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.3
Added \ifnumodd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifboolexpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.5
Added \ifboolexpe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.5
Added \whileboolexpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.5
Added \unlessboolexpr . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.5
1.8 2009-08-06
Improved \deflength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4
Added \ifnumcomp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifnumequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifnumgreater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifnumless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifdimcomp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifdimequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifdimgreater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
Added \ifdimless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4
1.7 2008-06-28
Renamed \AfterBeginDocument to \AfterEndPreamble (name clash) . . 2.5
Resolved conflict with hyperref
Rearranged manual slightly
1.6 2008-06-22
Improved \robustify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2
Improved \patchcmd and \ifpatchable . . . . . . . . . . . . . . . . . . . 3.4
Modified and improved \apptocmd . . . . . . . . . . . . . . . . . . . . . . 3.4
Modified and improved \pretocmd . . . . . . . . . . . . . . . . . . . . . . 3.4
Added \ifpatchable* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4
36
Added \tracingpatches . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4
Added \AfterBeginDocument . . . . . . . . . . . . . . . . . . . . . . . . . 2.5
Added \ifdefmacro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsmacro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefprefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsprefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefparam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsparam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefprotected . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsprotected . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefltxprotect . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsltxprotect . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefempty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsempty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Improved \ifdefvoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Improved \ifcsvoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifstrempty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.3
Added \setbool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \settoggle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
1.5 2008-04-26
Added \defcounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4
Added \deflength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4
Added \ifdefstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Improved \rmntonum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8
Added \ifrmnum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8
Added extended PDF bookmarks to this manual
Rearranged manual slightly
1.4 2008-01-24
Resolved conflict with tex4ht
37
1.3 2007-10-08
Renamed package from elatex to etoolbox . . . . . . . . . . . . . . . . . 1
Renamed \newswitch to \newtoggle (name clash) . . . . . . . . . . . . . 3.5.2
Renamed \provideswitch to \providetoggle (consistency) . . . . . . . 3.5.2
Renamed \switchtrue to \toggletrue (consistency) . . . . . . . . . . . 3.5.2
Renamed \switchfalse to \togglefalse (consistency) . . . . . . . . . . 3.5.2
Renamed \ifswitch to \iftoggle (consistency) . . . . . . . . . . . . . . 3.5.2
Renamed \notswitch to \nottoggle (consistency) . . . . . . . . . . . . . 3.5.2
Added \AtEndPreamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5
Added \AfterEndDocument . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5
Added \AfterPreamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5
Added \undef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Added \csundef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Added \ifdefvoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsvoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifdefequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifcsequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1
Added \ifstrequal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.3
Added \listadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listeadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listgadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listxadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listcsadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listcseadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listcsgadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \listcsxadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \ifinlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \xifinlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \ifinlistcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \xifinlistcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \dolistloop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
Added \dolistcsloop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.2
38
1.2 2007-07-13
Renamed \patchcommand to \patchcmd (name clash) . . . . . . . . . . . 3.4
Renamed \apptocommand to \apptocmd (consistency) . . . . . . . . . . . 3.4
Renamed \pretocommand to \pretocmd (consistency) . . . . . . . . . . . 3.4
Added \newbool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \providebool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \booltrue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \boolfalse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \ifbool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \notbool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1
Added \newswitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
Added \provideswitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
Added \switchtrue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
Added \switchfalse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
Added \ifswitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
Added \notswitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2
Added \DeclareListParser . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.1
Added \docsvlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7.1
Added \rmntonum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8
1.1 2007-05-28
Added \protected@csedef . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Added \protected@csxdef . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1
Added \gluedef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \gluegdef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \csgluedef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \csgluegdef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \mudef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \mugdef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \csmudef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \csmugdef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2
Added \protected@eappto . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1
39
Added \protected@xappto . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1
Added \protected@cseappto . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1
Added \protected@csxappto . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1
Added \protected@epreto . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2
Added \protected@xpreto . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2
Added \protected@csepreto . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2
Added \protected@csxpreto . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2
Fixed bug in \newrobustcmd . . . . . . . . . . . . . . . . . . . . . . . . . 2.1
Fixed bug in \renewrobustcmd . . . . . . . . . . . . . . . . . . . . . . . . 2.1
Fixed bug in \providerobustcmd . . . . . . . . . . . . . . . . . . . . . . . 2.1
1.0 2007-05-07
Initial public release
40