18

Consider the following example:

\documentclass{article}
\begin{document}
$(1-\theta_1) \dots (1-\theta_m)$
\end{document}

output

Isn't the ellipsis supposed to be vertically centered since they indicate multiplication?

Update

I'm now fully convinced that I'm wrong. To everyone with access to The TeXbook, have a look at page 172. :)

9
  • 5
    Use \cdots. It works.
    – Sigur
    Nov 27, 2013 at 0:30
  • @Sigur I know, but what should it be? Normally \dots places an ellipsis correct, so I'm wondering if I'm wong in my assumption or I've found an error. (I guess it's the first.) Nov 27, 2013 at 0:36
  • 2
    \dots looks ahead to see what follows and based on that decides whether to use certain dots. The decision is based on whether the following element is \mathbin, or \mathrel, or ... And ( does not provide \mathrel or \mathbin (the only two leading to \dotsm or\dotsb - a vertical adjustment of the dots).
    – Werner
    Nov 27, 2013 at 0:48
  • 2
    You should use \dotsm here. Nov 27, 2013 at 1:01
  • 3
    @Werner it doesn't just look at the math class of the following token, it uses code such as \def\rightdelim@{\gtest@true \ifx\@let@token)\else \ifx\@let@token]\else \ifx\@let@token\rbrack\else \ifx\@let@token\}\else to special case known delimiters and the entire \DOTS? mechanism so that it can be affected by the preceding token. (not that it makes any difference in this case:-) Nov 27, 2013 at 1:22

2 Answers 2

21

In the base LaTeX format \dots is just an alias for \ldots and is always on the baseline.

If you add amsmath then it does change according to context, but not in this case, it is more optimised for the case where the binary operator is explicit:

\documentclass{article}
%\usepackage{amsmath}
\begin{document}
$(1-\theta_1) \times \dots \times(1-\theta_m)$
\end{document}

The dots will raise if you uncomment amsmath.

5
  • 2
    +1. I've just learned that amsmath changes the vertical positioning based on the surrounding operators.
    – Sigur
    Nov 27, 2013 at 0:48
  • 1
    The problem comes when you don't use \times, but \cdot, for example, where you need to write \cdots.
    – Manuel
    Nov 27, 2013 at 1:10
  • 1
    @Manuel amsmath version of \dots gives centred dots if used with \cdot Nov 27, 2013 at 1:17
  • No, I meant you have to omit the \cdot, ergo you have to explicitly write \cdots.
    – Manuel
    Nov 27, 2013 at 23:28
  • @Manuel Oh I see OK Nov 27, 2013 at 23:30
16

Only for the best practitioners. We should stick to the semantic rules by using the following dots.

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{itemize}
    \item \verb+\dotsc+ for comma separated element $A_1, A_2, \dotsc, A_{n-1}, A_n$.
    \item \verb+\dotsb+ for binary operator $A_1 +A_2 + \dotsb + A_{n-1} + A_n$.
    \item \verb+\dotsm+ for multiplication $A_1 A_2 \dotsm A_{n-1}  A_n$.
    \item \verb+\dotsi+ for integral  $\int_{A_1} \int_{A_2} \dotsi \int_{A_{n-1}}  \int_{A_n}$.
    \item \verb+\dotso+ for others.
\end{itemize}
\end{document}

enter image description here

Advantages:

You can redefine the implementation for each dots above in the preamble whenever your institution ask you to change its behavior to meet its own adopted layout. If you use just \ldots and \cdots rather than the above semantic dots then you have to manually change them per equation --- as a result, this job makes your life boring.

\dots (general dots) versus \dots* (amsmath's semantically defined dots)

\documentclass[preview,border=12pt,varwidth]{standalone}
\usepackage{amsmath,xcolor}
\begin{document}
\begin{itemize}
        \item (\verb+\dots+)  $A_1, \dots, A_n$ \textcolor{red}{v.s.}\ $A_1, \dotsc, A_n$  (\verb+\dotsc+).
    \item (\verb+\dots+)  $A_1 + \dots + A_n$ \textcolor{red}{v.s.}\ $A_1 + \dotsb + A_n$ (\verb+\dotsb+).
    \item (\verb+\dots+)  $A_1 \dots  A_n$ \textcolor{red}{v.s.}\ $A_1 \dotsm  A_n$ (\verb+\dotsm+).
    \item (\verb+\dots+) $\int_{A_1} \dots  \int_{A_n}$ \textcolor{red}{v.s.}\ $\int_{A_1} \dotsi  \int_{A_n}$ (\verb+\dotsi+).
    \item (\verb+\dots+) \dots\ \textcolor{red}{v.s.}\ \dotso\ (\verb+\dotso+).
\end{itemize}
\end{document}

enter image description here

10
  • 2
    I know of the "Short Math Guide for LaTeX" but thank you none the less. :) Nov 27, 2013 at 1:10
  • 2
    I don't agree. You should use \dots except when it can't determine the semantics (at end of lists, for instance) or it gets it wrong.
    – egreg
    Nov 27, 2013 at 11:14
  • @egreg: I don't understand what you said. Probably because you also did not understand what I meant. :-) Nov 27, 2013 at 13:13
  • You meant wrong; it's by redefining \dots that the classes can use their preferred placement (low or center) depending on the semantics.
    – egreg
    Nov 27, 2013 at 16:51
  • @egreg: I still don't understand. What I said is that when the institutions want us to change the meaning of \dotsc to be centered rather than bottom aligned or \dotsm to be bottom aligned rather than centered, we can do the requirement without hassle by just redefining \dotsc and \dotsc at the preamble without having to change each equation. This approach is only possible when we use \dotsc for comma separated elements and \dotsm for multiplication as explained above. If we don't use \dotsc and/or \dotsm then redefining \dots will not be possible. Nov 27, 2013 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .