11.8 Symbols in formulas

The tables at the end of this section advertise the large range of mathematical symbols provided by the AMS font packages, including the command to use for each symbol. They also include the supplementary symbols from the St. Mary Road Font, which was designed by Alan Jeffrey and Jeremy Gibbons. This font extends the Computer Modern and AMS symbol font collections; the corresponding stmaryrd package should normally be loaded in addition to amssymb, but always after it. It provides extra symbols for fields such as functional programming, process algebra, domain theory, linear logic, and many more. For a wealth of information about an even wider variety of symbols, see the Comprehensive LATEX Symbol List by Scott Pakin [161].

The tables indicate which extra packages need to be loaded to use each symbol command. They are organized as follows: symbols with command names in black are available in standard LaTEX without loading further packages; symbols in blue require loading either amsmath, amssymb, or stmaryrd, as explained in the table notes. If necessary, further classification is given by markings: (StM) signals a symbol from stmaryrd when the table also contains symbols from other packages; (kernel) identifies symbols that are available in standard LaTEX but only by combining two or more glyphs, whereas a single glyph exists in the indicated package; and (var) marks “Alphabetic characters/symbols” (of type ; see Table 9.20 on page →I 751) that change appearance when used within the scope of a math alphabet identifier (see Section 9.4).

11.8.1 Mathematical symbol classes

The symbols are classified primarily by their “mathematical class”, occasionally called their “math symbol type”. This classification is related to their “meaning” in standard technical usage, but its importance for mathematical typography is that it influences the layout of a formula. For example, TEX’s mathematical formatter adjusts the horizontal space on either side of each symbol according to its mathematical class. There are also some finer distinctions made, for example, between accents and simple symbols and in breaking up the enormous list of Relation symbols into several tables. The setup for mathematics puts each symbol into one of these classes: Ordinary (Ord), Operator (Op), Binary (Bin), Relation (Rel), Opening (Open), Closing (Close), or Punctuation (Punct). This classification can be explicitly changed by using the commands , , , , , ,

and , thereby altering the surrounding spacing. In the next example, # and (both Ord by default) are changed into a Rel and an Op:

A symbol can be declared to belong to one of the above classes using the mechanism described in Section 9.8.5. In addition, certain subformulas — most importantly fractions, and those produced by and — form a class called Inner; it is explicitly available through the command.

In TEX, spacing within formulas is done simply by identifying the class of each object in a formula and then adding space between each pair of adjacent objects as

defined in Table 11.9; this table is unfortunately hardwired into TEX’s mathematical typesetting routines and so cannot be changed by macro packages.1 In this table 0, 1, 2, and 3 stand for no space, a thin space (,), a medium space (:), and a thick space (;), respectively. The exact amounts of space used are listed in Section 11.7.7 on page 204.

A Binary symbol is turned into an Ordinary symbol whenever it is not preceded and followed by symbols of a nature compatible with a binary operation; for this reason, some entries in the table are marked with a star to indicate that they are not possible. For example, \(+x\) gives +x (a “unary plus”) and not + x; the latter can be produced by \({}+x\).

Finally, an entry in (blue) in Table 11.9 indicates that the corresponding space is not inserted when the style is script or scriptscript.

As an example of applying these rules, consider the following formula (the default values are deliberately changed to show the added spaces more clearly):

TEX identifies the objects as Ord, Bin, Ord, Rel, and so on, and then inserts spaces as follows:

The minus in front of is turned into an Ordinary because a Binary cannot follow a Relation.

11.8.2 Letters, numerals, and other Ordinary symbols

The unaccented ASCII Latin letters and arabic numeral digits (see Table 11.10) are referred to as “Alphabetic symbols”. The font used for them can vary: in mathematical formulas, the default font for Latin letters is italic, whereas for the arabic digits it is upright/roman. Alphabetical symbols are all of class Ordinary.

Unlike the Latin letters, the mathematical Greek letters are no longer closely related to the glyphs used for typesetting normal Greek text. Due to an interesting 18th century happenstance, in the major European tradition of mathematical typography the default font for lowercase Greek letters in mathematical formulas is italic, whereas for uppercase Greek letters it is upright/roman. (In other fields, such as physics and chemistry, the typographical traditions are slightly different.) The capital Greek letters in the first rows of Table 11.11 are also Alphabetic symbols whose font varies, with the default being upright/roman. Those capital Greek letters not present in this table are the letters that have the same appearance as some Latin letter (e.g., A and Alpha, B and Beta, K and Kappa, O and Omicron). Similarly, the list of lowercase Greek letters contains no omicron because it would be identical in appearance to the Latin o. Thus, in practice, the Greek letters that have Latin look-alikes are not used in mathematical formulas. Table 11.12 on the facing page lists other letter-shaped symbols of class Ordinary. The first four are Hebrew letters. Table 11.13 lists the remaining symbols in the Ordinary class, including some common punctuation. These behave like letters and digits, so they never get any extra space around them. A common mistake is to use the symbols from Table 11.13 directly as Binary operator or Relation symbols, without using a properly defined math symbol command for that type. Thus, if you use commands such as #, , or &, check carefully that you get the correct inter-symbol spaces or, even better, define your own symbol command, which can be done with , which is explained in Section 9.8.5 on page →I 750.

11.8.3 Mathematical accents

The basic accent commands available for use in formulas are listed in Table 11.14. Most of them are already defined in standard LaTEX. See Section 11.4.12 for ways to define additional accent commands and ways to make compound accents and Section 11.5.2 for information about extensible accents. Adding a mathematical accent to a symbol always produces a symbol of class Ordinary. Thus, without additional help from or , one cannot use the accents to produce new Binary or Relation symbols.

11.8.5 Relation symbols

The class of binary Relation symbols forms a collection even larger than that of the Binary operators. The lists start with symbols for equality and order (Table 11.18 on the next page). You can put a slash through any Relation symbol by preceding it with the command; this negated symbol represents the complement (or negation) of the relation.

Especially with larger symbols, this generic method of negating a Relation symbol does not always give good results because the slash will always be of the same size, position, and slope. Therefore, some specially designed “negated symbols” are also available (see Table 11.19 on the facing page). If a choice is available, the designed glyphs are usually preferable. To see why, compare the symbols in this example.

11.8.6 Operator symbols

The Operator symbols typically come in two sizes, for text and display uses; most of them are related to similar Binary operator symbols. Whether an Operator symbol takes limits in displays depends on a variety of factors (see Section 11.4.4). The available collection is shown in Table 11.27.

11.8.7 Punctuation

The symbols of class Punctuation appear in Table 11.28, together with some other punctuation-like symbols. Note that some of the typical punctuation characters (i.e., “. ! ?”) are not set up as mathematical punctuation but rather as symbols of class Ordinary. This can cause unexpected results for common uses of these symbols, especially in the cases of ! and ?. Some of the dots symbols listed here are of class Inner; Section 11.5.1 on page 180 provides information about using dots for mathematical ellipsis.

The : character produces a colon with class Relation — not a Punctuation symbol. As an alternative, standard LaTEX offers the command as the Punctuation symbol. However, the amsmath package makes unfortunate major changes to the spacing produced by the command so that it is useful only for a particular layout in constructions such as fAB where it produces f : A → B. It is therefore wise to always use for the simple punctuation colon in mathematics.

11.8.8 Opening and Closing symbols

The paired extensible delimiters, when used on their own (i.e., without a preceding , , or ), produce symbols of class Opening or Closing; these pairs are listed in Table 11.29. See Section 11.5.6 on page 191 for further information about the extensible symbols.

To improve the flexibility of the vertical bar notation, amsmath defines some new pairs of paired extensible delimiter commands: , , , and . These commands are comparable to standard LaTEX’s and commands.

Finally, there are a few nonextensible paired symbols of class Opening and Closing, as listed in Table 11.30. They should not be used after or .