11.5 Variable symbol commands

Many LaTEX commands are often thought of as producing a particular symbol when, in fact, the exact form is not fixed (even when the font and size are fixed). Certain features of TEX’s mathematical typesetting can even be used to produce structures that can, in principle, grow to whatever size is required.

Such context-dependent variability is very important in mathematical typesetting, and this section discusses some aspects of it. With a few clearly noted exceptions, the commands covered in this section are available in standard LaTEX.

A well-known, but not very exciting, example of such variability entails the mathematical operator symbols, such as and , which typically come in just two sizes: a smaller size that is used in running text and a larger size that is used in displayed formulas. Such symbols appear in Table 11.27 on page 222.

11.5.1 Ellipsis and other kinds of . . .

Standard LaTEX provides several types of mathematical ellipsis dots: , , and so on. When using amsmath, however, such ellipsis dots within math mode should almost always be marked up using ,1 and amsmath should decide what kind of dots are to be used.

The vertical position (on the baseline or centered) of the ellipsis, together with the space around it, are both automatically selected according to what kind of symbol follows . For example, if the next symbol is a plus sign, the dots will be centered; if it is a comma, they are typeset on the baseline. In all cases, three dots are used, but the spacing varies. These defaults from the amsmath package can be changed in a class file when different conventions are in use.

If the dots fall at the end of a mathematical formula, the next object will be something like \end or ] or $, which does not give any information about how to place the dots. In such a case, you must help by using for “dots with commas”, for “dots with Binary operator/Relation symbols”, for “multiplication dots”, for “dots with integrals”, or even for “none of the above”. These commands should be used only in such special positions: otherwise you should just use .

In this example, low dots are produced in the first instance and centered dots in the other cases, with the space around the dots being nicely adjusted.

11.5.2 Horizontal extensions in standard LATEX

In principle, any mathematical accent command can be set up to produce the appropriate glyph from a range of widths whenever these are provided by the available fonts. However, in standard LaTEX there are only two such commands: and .

This section describes a few commands that produce constructions similar to these extensible accents. All, except and , produce compound symbols of mathematical class Ordinary (see Section 11.8.1 on page 209). They are illustrated in this example:

The and commands are somewhat special in that they produce compound symbols of the Operator class and take . This means that you can easily attach some explanatory text or other material to the brace. For this the command from amsmath can be very useful.

Another horizontally extensible feature of LaTEX is the bar in a radical sign; it is described at the end of the next subsection.

11.5.3 Further horizontal extensions

To the basic set of horizontally extensible structures, amsmath adds a few more arrows and perhaps more importantly also reimplements and so that they change their mathematical style. This means that they look right when used, for example, in fractions or subscripts/superscripts (see Section 11.7.1 on page 195). In contrast, the arrowheads in standard LaTEX always stay at the same size so that the commands without amsmath are suitable for use only at the top level of displayed mathematics.

11.5.4 abraces — Customizable over and under braces

If you have a need for more specialized over or under braces, e.g., with special tips, or the middle part of the brace not centered or dashes instead of straight horizontal parts, etc., then take a look at the abraces package by Werner Grundlingh.

This package offers a construction method (somewhat modeled after the preamble of a tabular) allowing for a huge number of variant extensible braces.

Without the optional argument the commands behave just like and , and if you load the package with the option overload, the standard LaTEX commands get the optional argument added so that you can continue to use the standard names.

The optional argument lets you construct specially formed braces by specifying a pattern out of the characters given in Table 11.4. For example, the standard over brace would have the specification of L1U1R where the two numbers represent the horizontal filler parts and their values define the ratio, i.e., “1:1” in that case. Thus, if you want to move the middle part to the left, you could use a ratio like “1:3” or “2:5”, etc. Similarly, if you want to have several “middle” parts, place several U or D characters at the right point into the pattern. A few variants are shown in the following example:

11.5.5 underoverlap — Partly overlapping horizontal braces

While it is possible to nest or commands (or the equivalents from the abraces package), it is rather difficult with the standard tools to produce partly overlapping braces within a single formula. If this is needed, you can use the underoverlap package by Michiel Helvensteijn.1 It offers by default four commands that can produce partly overlapping structures. Others can be added as needed.

The brace spans both the private and the common parts, i.e., as if both parts are inside the argument of . However, the optional common part is typeset only by the next … command, which therefore should follow immediately. If not, you get results as shown in the second and third formula of the next example.

By default and are also available, and all commands can be intermixed freely.

11.5.6 Vertical extensions

While only a few symbols are horizontally extensible, there is a much larger range available with vertical extensions. The full list is given in Table 11.5. These symbols become extensible only in certain usages; they must all be based on a construction of the following form:

The ⟨ext-Middle⟩ is optional, while and have to be present. The ⟨ext-Open⟩, ⟨ext-Middle⟩, and ⟨ext-Close⟩ can be any of the symbols (except ) listed in Table 11.5, or possibly others if additional packages are loaded. They must be symbols that have been set up to be extensible using the methods described in [113], which is part of every LaTEX distribution; thus, a symbol must be available to represent the absence of an actual glyph. This symbol, which is sometimes called the null delimiter, is denoted by a period “.”.

The sizes of the actual glyphs used to typeset the extensible symbols are chosen to fit with the vertical size (height and depth) of the typeset subformula that lies in between them; the exact details of how this is done, and of the parameters that affect the process, can be found in Chapter 17 and Appendix G (Rule 19) of The TEXbook [84]. One can also request specific sizes for such symbols as explained in Section 11.7.4 on page 199.