Ellipsis / dots (…) in LaTeX
LaTeX has a dots command for each position: \ldots on the baseline, \cdots centred, \vdots vertical and \ddots diagonal, and with amsmath, \dots picks low or centred dots for you. The table below shows every one and how it looks.
LaTeX command
\dotsEvery dots command
| Looks like | LaTeX | Use it for |
|---|---|---|
\ldots | Low dots on the baseline, for lists with commas | |
\cdots | Centred dots, between + and = signs | |
\vdots | Vertical dots, down a column of a matrix | |
\ddots | Diagonal dots, down to the right | |
| ⋰ | \iddots | Diagonal dots, up to the right (mathdots package) |
\dots | Low or centred, chosen from the next symbol (with amsmath) | |
\dotsc | Dots with commas (amsmath) | |
\dotsb | Dots with + and = signs (amsmath) | |
\dotsm | Dots in a product written without signs (amsmath) | |
\dotsi | Dots between integrals (amsmath) | |
\dotso | Other dots, low (amsmath) | |
| . . . . . . . . . | \hdotsfor{3} | A row of dots across 3 columns of a matrix (amsmath) |
| 1 . . . . . . . . 5 | \dotfill | Text: fills the rest of the line with dots, as in a contents page |
| … | \textellipsis | An ellipsis in ordinary text (\dots works there too) |
\cdot | One centred dot: multiplication, the dot product | |
\dot{x} | A dot over a letter, a time derivative (\ddot{x} for two) |
Not the symbol you meant? Draw it to find the command →
Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →
Pick the dots by their neighbours. Between commas they sit on the baseline, ; between + or = signs they are centred, . Mixing the two up is the most common dots mistake.
With amsmath loaded, \dots looks at the next symbol and chooses for you, and KaTeX does the same. Without amsmath, \dots always gives low dots, like \ldots.
For matrices, \vdots continues a column and \ddots the diagonal; \cdots, \ldots, \vdots and \ddots are built into LaTeX and work in KaTeX. \iddots needs the mathdots package, and the \dotsc family and \hdotsfor come with amsmath.
\ldots or \cdots: low or centred dots
\ldots puts the dots on the baseline, level with commas. \cdots centres them, level with the bar of a + or =. So a list takes \ldots and a sum takes \cdots.
a_1, a_2, \ldots, a_na_1 + a_2 + \cdots + a_nLet amsmath choose: \dots, \dotsc, \dotsb, \dotsm, \dotsi and \dotso
\dots looks at the symbol after it. Before a + or = it gives centred dots, before a comma low ones. At the end of a formula, or before a closing bracket, there is nothing to look at and it gives low dots, which is wrong after a +.
There, name the kind instead: \dotsc for dots with commas, \dotsb with + and = signs, \dotsm for a product written without signs, \dotsi between integrals, and \dotso for anything else.
x_1 + x_2 + \dotsbx_1 x_2 \dotsm x_n\int_{A_1} \dotsi \int_{A_n}Dots in a matrix: \vdots, \ddots, \iddots and \hdotsfor
In a matrix, \cdots continues a row, \vdots a column and \ddots the main diagonal. For the other diagonal, rising to the right, load the mathdots package and use \iddots.
\hdotsfor{4} fills four columns of a row with dots, which reads better than \cdots in one cell. It is part of amsmath.
\begin{pmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1} & \cdots & a_{mn} \end{pmatrix}\usepackage{mathdots}\begin{pmatrix} 0 & \cdots & 1 \\ \vdots & \iddots & \vdots \\ 1 & \cdots & 0 \end{pmatrix}\begin{pmatrix} 1 & 2 & 3 & 4 \\ \hdotsfor{4} \\ 5 & 6 & 7 & 8 \end{pmatrix}More on this: Matrices in LaTeX
Dots in text: \dots, \textellipsis and \dotfill
In ordinary text, write \dots or \textellipsis for an ellipsis. LaTeX drops the space after a command, so when a word follows, write \dots{} or a backslash and a space: Wait\dots{} what? Three full stops typed in a row sit too close together.
\dotfill fills the rest of a line with dots, as between a chapter and its page number in a contents list.
Wait\dots{} what?Chapter 1 \dotfill 5One dot: \cdot and \dot{x}
For a single centred dot, for multiplication or a dot product, use \cdot: . For a dot above a letter, the time derivative in physics, use \dot{x}, and \ddot{x} for two dots.
a \cdot b\dot{x}\ddot{x}More on this: Dot product / centred dot (·) in LaTeX, Dot / time derivative (ẋ) in LaTeX
Other forms
\cdotscentred (⋯)\vdotsvertical (⋮)\ddotsdiagonal (⋱)Examples
$1 + 2 + \cdots + n$centred dots between operators
$x_1, x_2, \ldots, x_n$baseline dots in a list
$a_1 + a_2 + \dots + a_n$\dots choosing dots from context
$\begin{pmatrix} 1 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 1 \end{pmatrix}$dots filling a matrix
$f(x_1, x_2, \dotsc, x_n)$dots in a list of arguments
$\prod_{k=1}^{n} a_k = a_1 a_2 \dotsm a_n$dots in a product written without signs
Tips and common mistakes
- Use
\ldotsbetween commas and\cdotsbetween operators; with amsmath,\dotsusually picks for you. - At the end of a formula
\dotscannot see what follows; write\dotsbafter a + and\dotscafter a comma. \vdotsand\ddotsare for matrices and tables;\iddotsneeds the mathdots package.- Do not type three full stops (...); they sit too close together. Use
\dots. - In text, follow
\dotswith {} or a backslash and a space before the next word, or the space disappears.
Working from handwritten notes?
LatexNotes turns a photo or PDF of handwritten mathematics into LaTeX, graphs and all. It is built with real pdflatex before you see it, and the .tex file is yours to edit or take to Overleaf. Free to try, no sign-up.
See how handwriting to LaTeX works, step by step, or go from GoodNotes to LaTeX if you write on an iPad (Notability works the same way).
Convert your maths to LaTeX →FAQ
What is the difference between \ldots and \cdots?
\ldots sits on the baseline, for lists separated by commas; \cdots is vertically centred, for expressions joined by operators like + or =.
How do I put dots in a matrix?
Use \cdots along a row, \vdots down a column and \ddots along the diagonal. \iddots (mathdots package) goes up the other diagonal, and \hdotsfor{n} fills n columns of a row.
Should I just type three dots (...)?
No. Three full stops have incorrect spacing. Use \dots, \ldots or \cdots so the ellipsis is spaced properly.
What does \dots do?
With amsmath, \dots looks at the next symbol: centred dots before + or =, low dots before a comma. Without amsmath it always gives low dots, like \ldots.
How do I make dots that go up diagonally?
Load the mathdots package and use \iddots. \ddots only goes down to the right.