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. :)

  • 5
    Use \cdots. It works. – Sigur Nov 27 '13 at 00: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.) – Svend Tveskæg Nov 27 '13 at 00:36
  • What do you mean by Normally \dots places an ellipsis correct? Are you talking about other language? – Sigur Nov 27 '13 at 00:37
  • @Sigur I'm not sure what you mean by your question. When I type \dots in a math expression in LaTeX, the ellipsis is almost always placed correct, so I think I might be wrong in assuming that the ellipsis in the example should be vertically centered. What is correct? – Svend Tveskæg Nov 27 '13 at 00:41
  • 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 '13 at 00:48
  • @Werner Nice explanation. Thank you, Werner. – Svend Tveskæg Nov 27 '13 at 00:49
  • 2
    You should use \dotsm here. – kiss my armpit Nov 27 '13 at 01: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:-) – David Carlisle Nov 27 '13 at 01:22

2 Answers2

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.

David Carlisle
  • 757,742
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

  • 2
    I know of the "Short Math Guide for LaTeX" but thank you none the less. :) – Svend Tveskæg Nov 27 '13 at 01: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 '13 at 11:14
  • @egreg: I don't understand what you said. Probably because you also did not understand what I meant. :-) – kiss my armpit Nov 27 '13 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 '13 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. – kiss my armpit Nov 27 '13 at 18:13
  • Redefining \dots is not possible as \dots are used everywhere with different semantic meaning in equations. If we redefine \dots to be centered then all \dots becomes centered, for example --- it might not be what we want to achieve. – kiss my armpit Nov 27 '13 at 18:15
  • @DonutE.Knot No, that's not how it works. I said “redefine \dots” to mean ”redefine the working of the inner macros called by \dots to take care of what surrounds it”. The idea is that the user only uses \dots except when at the end of a list. – egreg Nov 27 '13 at 18:19
  • @egreg: My argumentation above is based on my understanding after reading amsmath's documentation on page 11-12. I don't know whether or not the documentation is also wrong. – kiss my armpit Nov 27 '13 at 18:24
  • @DonutE.Knot It may be not clear, but if you look at the examples, they are only for final dots. There would be no need for adding the internal macro \DOTS in several commands to take care of transforming \dots into the right call, if one those five commands was requested in all cases. – egreg Nov 27 '13 at 18:28
  • @DonutE.Knot http://tex.stackexchange.com/a/122497/4427 – egreg Nov 27 '13 at 18:39