How To Typeset an Ellipsis in a Mathematical Expression

In mathematical typesetting we often use an ellipsis (three dots) to denote omission in an expression. It’s well known to \LaTeX users that an ellipsis is not typed as three dots, but rather as \dots or \cdots. The vertically centered \cdots is used between operators that sit above the baseline, such as +, -, = and \le. Ground level dots are produced by \dots and are used in a list or to indicate a product.

Recently the question arose of whether to write

$a_1$, $a_2$, \dots, $a_n$

or

$a_1, a_2, \dots, a_n$

The difference between these two does not show up well if I allow WordPress to interpret the \LaTeX, but as this PDF file shows the first of these two alternatives produces more space after the commas.

I don’t discuss this question in my Handbook of Writing for the Mathematical Sciences, nor does the SIAM Style Guide offer an opinion (it implies that the copy editor should stet whatever the author chooses).

As usual, Knuth offers some good advice. On page 172 of the TeXbook he gives the example

The coefficients $c_1$, $c_2$, \dots, $c_n$ are positive.

the justification for which is that the commas belong to the sentence, not the formula. (He uses \ldots, which I have translated to \dots, as used in \LaTeX.) In Exercise 18.17 he notes that this is preferred to $c_1, c_2, \dots, c_n$ because the latter leaves too little space after the commas and also does not allow line breaks after the commas. But he notes that in a more terse example such as

Clearly $a_i<b_i$ \ $(i=1,2,\dots,n)$

the tighter spacing is fine. Indeed I would always write $i=1,2,\dots,n$, because $i=1$, $2$, \dots, $n$ would be logically incorrect. Likewise, there is no alternative in the examples

$D = \diag(d_1,d_2,\dots,d_n)$ 
$f(x_1,x_2,\dots,x_n)$

Looking back over my own writing I find that when typesetting a list within a sentence I have used both forms and not been consistent—and no copy editor has ever queried it. Does it matter? Not really. But in future I will try to follow Knuth’s advice.

About these ads
This entry was posted in LaTeX and tagged , . Bookmark the permalink.

2 Responses to How To Typeset an Ellipsis in a Mathematical Expression

  1. Duncan says:

    In addition to \dots and \cdots, the amsmath package from the American Mathematical Society provides
    \dotsc for “dots with commas”
    \dotsb for “dots with binary operators/relations”
    \dotsm for “multiplication dots”
    \dotsi for “dots with integrals”
    \dotso for “other dots” (none of the above)

    http://www.ctan.org/tex-archive/macros/latex/required/amslatex/math/

  2. Nick Higham says:

    Thanks, Duncan. I had spotted those commands, but since they stay in math mode I don’t think they address the issue of allowing line breaks after the comma.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s