Size scaling of math fonts and big delimiters

Ulrik Vieth

1 Size scaling of subscripts and superscripts

In the original (L^{A})TEX setup using the Computer Modern typefaces, a 10 pt / 7 pt / 5 pt size scaling is used for the first and second order subscripts and superscripts. This setup is based on the assumption that the 5 pt and 7 pt font sizes will come from a family of meta-fonts which are specially designed for use at the given design sizes, rather than just representing a scaled-down version of a 10 pt font design.

While this assumption is indeed justified for the typical font families such as Computer Modern, Concrete, and AMS Euler, the situation is different when it comes to scalable PostScript fonts in Adobe Type 1 format, such as Times Roman or MathTime. In the latter case, there is usually only a single version of each font at a design size of 10 pt, which is then scaled linearly to cover the whole range of sizes from very small to very large.

If a 10 pt / 7 pt / 5 pt size scaling for subscripts and superscripts is applied to such a scalable font, the characters from the resulting 5 pt font size might turn out to be too tiny and too hard to read, and a different size scaling is used instead to avoid this problem. For the MathTime fonts, the recommended size scaling is 10 pt / 7.6 pt / 6 pt. A similar scheme is also used in the mathptm package.

While this approach solves the problem of readability, it also leads to another problem that will be discussed in detail in the remainder of this paper. In short, the problem is that since the subscripts and superscript now happen to be somewhat bigger in proportion to the text font size, they happen to have a surprising effect on the automatic choice of “appropriately-sized” big delimiters around expressions enclosed by \left and \right.

2 Size scaling of big delimiters

In the original (L^{A})TEX setup, the math extension font cmex10 contains big delimiters in four sizes at 12 pt, 18 pt, 24 pt, and 30 pt. These sizes seem to have been carefully chosen as multiples of the 12 pt \baselineskip. The four sizes can be selected explicitly by using the commands \big, \Big, \bigg, and \Bigg, where \big and \bigg correspond to the frequent case of formulas of one or two lines tall while \Big and \Bigg correspond to intermediate sizes of 1.5 or 2.5 lines tall (see The TEXbook, Exercise 17.11).

If the MathTime fonts are used instead of the default Computer Modern, there is only a single scalable version of the math extension font MTEX, which is typically loaded at its design size of 10 pt. It provides big delimiters in the same four sizes as in cmex10, yet the resulting choice of sizes may turn out to be completely different, depending on the expression enclosed between delimiters. In some cases, the resulting size exhibits a kind of sensitivity in that it critically depends on which letter appears in a subscript or superscript position and whether or not it has an ascender or descender.

To be specific, we shall consider the example of the mathtime package for L^{A}TEX 2ε, which establishes a size scaling of 10 pt / 7.6 pt / 6 pt. In this setup, a very simple expression such as

                                                  \left( x_{0} \right)

still produces normalsize parentheses taken from a 10 pt text font, while an expression such as

                                                  \left( x_{\mu} \right)

already produces \big delimiters at 12 pt, simply because the letter μ extends a little further below the baseline than the digit 0. Even worse, the expression

                                                  \left( x^{2} \right)

already becomes so big that it doesn’t fit into12 pt delimiters anymore, and somehow triggers the use of \Big delimiters at 18 pt. Imagine that! While this might be a little irritating but perhaps tolerable in a displayed formula, it would be truly inappropriate in the case of an inline formula.

Furthermore, the resulting size might even depend on whether an expression is typeset in cramped or non-cramped style, since the expression

                                                  \left( {\textstyle x^{2}} \right)

does happen to fit within \big delimiters at 12 pt quite unlike the previous example in \displaystyle. Unsurprisingly, the situation is similar for fractions just over two lines tall, in which case a second derivative (with a superscript in the numerator) will trigger \Bigg delimiters at 30 pt while a first derivative does fit within \bigg delimiters at 24 pt.

It should be obvious that such a behavior might be perceived as erratic and unpredictable, and hence undesirable for use in a production environment.

3 How TEX chooses big delimiters

To get a better understanding of how this size scaling comes about, it is interesting to consider a specific example of the formula x^{2} typeset either in cramped or non-cramped style, and study the details of how TEX goes about to choose an “appropriate” size of delimiters (see The TEXbook, p. 152).

Task 3: Technical Studies  Task 3: Technical Studies 2  Task 3: Technical Studies  MFG discussion document
x^{2} typeset in  CM fonts  MathTime
\textstyle  8.14+0.0 pt 8.81+0.15 pt
\displaystyle 8.64+0.0 pt 9.31+0.15 pt

Table 1: Height and depth of a simple formula, typeset using Computer Modern or MathTime.

As can be seen from Table 1, the results of measuring the height and depth of the box enclosing the formula x^{2} with the superscript typeset either in 7 pt (Computer Modern) or in 7.6 pt (MathTime) differ by a little more than the nominal difference of 0.6 pt due to the differences of the font designs.

What is important, however, is not the actual height or depth of the formula, but rather how far it extends above or below the axis height, since TEX has to choose a delimiter which is big enough to cover the height and depth of the enclosed expression when it is placed symmetrically on the axis.

According to the explanations in The TEXbook, p. 152, TEX first takes the maximum of the distances between the height or depth of the formula and the axis height (which happens to be 2.5 pt in both cases). In the case of the MathTime example, this yields 6.81 pt, resulting in a total required size of 13.62 pt when multiplied by a factor of two. As a further processing step, TEX now multiplies the result by \delimiterfactor/1000. Since the default value of this parameter is 901, the result is 12.27 pt, which clearly exceeds the 12 pt size of \big delimiters. In this case TEX has no choice but to proceed to use the next larger size of delimiters, which is 18 pt for \Big delimiters.

To coerce TEX into using \big delimiters instead, there are at least two possibilities. One option would be to reduce the size of the subscripts and superscripts until a \delimiterfactor of 901 produces the desired result, but this would counteract the intended effect of increasing the readability.

Another option would be to reduce the default \delimiterfactor to achieve a similar effect. From the MathTime example, the required value can be easily determined to be 12 pt/13.62 pt · 1000 = 881, or perhaps a little smaller than that to be on the safe side. A similar calculation for a displaystyle fraction involving a first-level superscript in the numerator yields an even smaller value of 24 pt/(2 · 13.82 pt) · 1000 = 868.

Yet another option worth investigating might be to adjust the \fontdimen parameters of the math symbol font to raise the axis height or to modify the \fontdimen parameters related to the positioning of subscripts and superscripts. Since the side-effects of such kind of adjustments may be far-reaching, it is not advisable to proceed along these lines without further studies of the consequences.

4 Conclusions

It has been illustrated in this paper in several examples that increasing the relative size of subscripts and superscripts to improve the readability may lead to unpleasant surprises regarding the choice of appropriate sizes of big delimiters. This problem can be corrected most easily by adjusting the parameters affecting this choice, among them, in particular, the \delimiterfactor. While the default value of 901 is suitable for 7 pt superscripts in Computer Modern, a smaller value is needed for 7.6 pt superscripts in MathTime.

It seems to be the logical consequence that any math layout using a non-standard size scaling for first and second order subscripts and superscripts should take care of choosing an appropriate value of the \delimiterfactor, so that simple expressions such as x^{2} will still fit into the smallest size of big delimiters without resorting to bigger sizes.

⋄ Ulrik Vieth Heinrich-Heine-Universität Institut für Theoretische Physik II Universitätsstraße 1 D-40225 Düsseldorf, Germany

                                                                     vieth@thphy.uni-duesseldorf.de