Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Knuth incorporated many of the typographical rules for mathematics in the TeX engine. However some rules were left out. One such case is the use of elisions in equations. Sometimes \cdots are used and in other case \ldots.

In general, after examining a number of maths papers, I inferred the following "rules":

enter image description here

enter image description here

enter image description here

One could think of an \xdots type of command (similar to \xspace that could switch between the right type of ellipsis and allow the right space before and after it. A rough macro to do this is show in the MWE below:

\documentclass{article}
\usepackage{amsmath}
\makeatletter

\def\xdots{%
  \newif\if@found
  \@foundfalse
  \def\ifPlus{\@ifnextchar+{\cdots}{\ifDot}}
  \def\ifDot{\@ifnextchar.{\ldots\@foundtrue}{\ifSemicolon}}
  \def\ifSemicolon{\@ifnextchar;{\cdots\@foundtrue}{\ifLeftBracket}}
  \def\ifLeftBracket{\@ifnextchar){\ldots\,\@foundtrue}{\ifOpenBracket}}
  \def\ifOpenBracket{\@ifnextchar({\dots\@foundtrue}{\ifNotFound}}
  \def\ifNotFound{\if@found\relax\else\ldots\fi}
  \ifPlus
}

\makeatother
\begin{document}
\begin{eqnarray*}
e^{xf(z)}-1
&=(z,z^2\!/2!,z^3\!/3!,\ldots\,)\,F\,(x,x^2,x^3,\xdots)^{\rm T}\\
\noalign{\smallskip}
e^{xg(z)}-1
&=(z,z^2\!/2!,z^3\!/3!,\ldots\,)\,G\,(x,x^2,x^3,\xdots)^{\rm T}
\end{eqnarray*}

\end{document}

amsmath has what I consider a partial solution with \dots and offers various commands for different cases.

Unfortunately this is not a trivial problem, as one needs to consider both the symbol before the ellipsis as well as the one that follows it. I am looking for suggestions, solutions and or strategies. I am also looking for "rules" that I might have missed in the above description.

share|improve this question
1  
There are more variants with amsmath, depending on the spacing: \dotsc, for an ellipsis followed by a comma. \dotsb, for an ellipsis followed by a binary operation or relation. \dotsm, for an ellipsis followed by multiplication. \dotsi, for an ellipsis with integrals, and \dotso, for another ellipsis. –  Gonzalo Medina Apr 2 '11 at 18:52
    
@Gonzalo Medina Thanks, for sure but they are all translate back to the problem they are either ldots or cdots plus measures of spacing. In plain TeX you only get these and one has to fiddle the solution. This is why I was thinking of a programmatic solution. –  Yiannis Lazarides Apr 2 '11 at 18:56
3  
@Yiannis: You know about amsmath's automatic \dots, don't you? –  Hendrik Vogt Apr 2 '11 at 18:58
1  
I don't think everyone follows your inferred rules. I for one disagree with rules 2, 3, and 4 at least. My general philosophy is that if the omitted items are "obviously" in a list, I use \ldots; if the omitted items are between binary operators (including the invisible implicit multiplication) I use \cdots; else whichever one looks better. –  Willie Wong Apr 3 '11 at 0:15
3  
@Willie Wong As you said one needs to choose whichever looks better, but my grandmother had different ideas as to what clothes looked better than my mother or my wife. The rules were inferred based on papers mostly typeset in the 80's as books published earlier were influenced by the typesetting equipment available. I haven't looked at anything post 2000. Why don't you list some different opinions and perhaps reasons. –  Yiannis Lazarides Apr 3 '11 at 3:57
show 10 more comments

1 Answer

up vote 4 down vote accepted

On items 3 and 4 you show, the proper usage would be \cdots since they are implied products (and operations become center) that'w why you have an "exception" on item 4 (since sums aren't implied, but shown explicitly)

Here's the quick ruleset

  • A) Any comma-delimited listing (be in parentheses or not) becomes \ldot. Examples: Vectors, yor item 2

  • B) Any operator becomes \cdot. Examples: sums, products (even implied), your item 1

    • Item 3 is therefore \cdots according to rule B
    • Item 4 is \cdots according to rule B (and exceptions disappear)
    • Item 5 as you show is \cdots, but not because it being fractions, but because it being operator (+). If you were listing a vector coordinates where each entry is a fraction, you would use \ldots according to rule A

    • Item 6 is special: I recommend using \cdots (there's no comman) and it is compatible with matrices where you may use \vdots for vertical elisions or \ddots for diagonal, both of them being centered.

    • Item 7: Yes, subscripts and superscripts follow the same rules as if they were considered as expression by themselves

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.