106

What is best method to insert an ellipsis in a (Xe)TeX document?

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}

\begin{document}
a...b a ... b %or

a\ldots b a \ldots  b %or

a…b a … b  

$a...b  a ... b$ %or

$a\ldots b  a \ldots  b $ %or

$a…b  a … b  $
\end{document} 

Their results seem to be similar.

enter image description here

5
  • 7
    Search for ellipsis and you will find a lot of discussion about this topic. Eg: tex.stackexchange.com/questions/29840/consistent-typography or tex.stackexchange.com/questions/30218/… Commented Sep 21, 2012 at 6:09
  • @Reza: In the addendum you're provided to your original question, you purport to show that ... and \ldots produce rather similar output (but with the dots apparently raised noticeably above the baseline). Which document class and which specialized packages did you load to create this output? Please consider posting a MWE (minimum working example) that generates the output you show.
    – Mico
    Commented Sep 21, 2012 at 22:03
  • @Mico I added a MWE to the question Commented May 1, 2013 at 6:20
  • Please note that (at least in german typography) there is a difference between a…b and a … b. In the first case the ellipsis shows that there is a part of a word missing and the latter case shows that one or more words, i.e. a part of the sentence (is), are missing …
    – Tobi
    Commented May 1, 2013 at 7:39
  • Oh sure :-) But it won’t harm to hav this information as a comment :-
    – Tobi
    Commented May 1, 2013 at 20:13

3 Answers 3

105

Remark -- The answer given below addressed the original version of the posting, which asked if there's an advantage to using \ldots over ... (three consecutive dots). At some later stage (May 2013?), the posting was changed to ask a different question, viz., what the best method is for inserting a text ellipsis in a (Xe)TeX document. The OP also provided a new answer at the time.


You asked:

Is there any advantage in using \ldots instead of ...?

Yes! If you type ... you'll get some rather-closely spaced dots. In contrast, with \ldots the dots are correctly spaced for a typographic ellipsis.

The following MWE illustrates some of the visual differences of what's outpot by ... and \ldots. The differences are readily apparent in both text mode and math mode.

\documentclass{article}
\begin{document}
yes and no ... yes and no \ldots\ yes and no ...

$\{x_1,x_2,...,x_n\}$ vs.\ $\{x_1,x_2,\ldots,x_n\}$
\end{document}

enter image description here

Naturally, if your language is not English -- for which \ldots was designed initially -- you'll want to make sure that the ellipis created by \ldots conforms to your language's typographic conventions. @egreg's comment suggests that this may well be a concern for the French case. For such situations, you may want to use the commands provided by a specialized package such as ellipsis or csquotes rather than the "standard" \ldots command.

Addendum prompted by a follow-up question by @moose: In LaTeX, there's also the command \dots. This raises the question, what is the difference between \ldots and \dots? The simple answer is: There's no difference in LaTeX. (I'm not sure if this applies to Plain TeX as well; I don't have the TeXbook at hand today...) The definitions of these two commands (from latex.ltx) are as follows:

\DeclareRobustCommand{\dots}{%
   \ifmmode\mathellipsis\else\textellipsis\fi}
\let\ldots\dots

The \textellipsis instruction, in turn, is defined in the LaTeX kernel as follows:

\DeclareTextCommandDefault{\textellipsis}{%
    .\kern\fontdimen3\font
    .\kern\fontdimen3\font
    .\kern\fontdimen3\font}

Interestingly, there's no kern inserted ahead of the first . ("dot").

8
  • 17
    The correctess of the spacing between the dots depends on the typographic tradition; for instance in France they should be spaced much less than what \ldots provides.
    – egreg
    Commented Sep 21, 2012 at 8:03
  • 15
    @egreg I guess the point is that with ... you get 'whatever', whereas with appropriate set up \ldots will give the correct spacing.
    – Joseph Wright
    Commented Sep 21, 2012 at 11:44
  • 2
    @Mico could you please also explain the difference to \dots? Commented Sep 23, 2012 at 16:42
  • 1
    @moose: A good question. Please see the new addendum.
    – Mico
    Commented Sep 23, 2012 at 17:05
  • 4
    @moose -- if you use the amsmath package, you could indeed always use \dots and let the package decide which ellipsis form is most appropriate in a given situation. Please read the package's user guide to learn more about this.
    – Mico
    Commented Oct 20, 2012 at 2:39
36

I suggest using \ldots in combination with the package ellipsis, because that gives you better control over spacing than .... Using \ldots alone (without ellipsis) is better than ... because it gives you more flexibility. For example, you may redefine the spacing by redefining \ldots. On the other hand, ellipsis makes it easy to fine tune spacing, and takes care of other spacing problems, for example to combine ellipsis with full stop (....).

If you want to fine tune ellipsis, you easily change the distance between the dots by the command:

\renewcommand{\ellipsisgap}{0.1em} %  or another value

By adding the option [xspace], i.e.

\usepackage[xspace]{ellipsis}

terminating the \ldots-command by \ is not necessary (but even xspace makes errors, as documented in the manual). If you use ellipsis, remember to load it after hyperref.

The package csquotes has the commands

\textelp{}
\textelp{<text>}
\textelp*{<text>}

that fill similar functions as ellipsis and give you the tools for automatically handle exception from the rules. Therefore, they are better solutions than ....

I recommend using \ldots with ellipsis (or substitutes), which give best control over spacing, more flexibility and typographical consistency in more situations.

5
  • 3
    How does this answer the question?
    – user10274
    Commented Sep 21, 2012 at 13:24
  • @Sveinnung Your answer doesn't address the advantage issue.
    – user10274
    Commented Sep 21, 2012 at 17:10
  • Thanks. You actually explained an advantage, unfortunately I can just accept one answer :( Thanks again Commented Sep 22, 2012 at 2:51
  • @Sveinung Much better.
    – user10274
    Commented Sep 22, 2012 at 5:20
  • This doesn't seem to work well with \nonfrenchspacing.
    – Toothrot
    Commented Aug 7, 2017 at 9:36
9

You can achieve advantages of both (readability and good appearance) using Unicode Character 'HORIZONTAL ELLIPSIS' (U+2026)

If you have installed AutoHotKey use following script to convert ... to automatically:

::...::…

In Windows, it can be inserted with Alt+0133.

In MacOS, it can be inserted with ⌥ Opt+; (on an English language keyboard).

In Linux, it can be inserted with AltGr+.

5
  • 2
    This is definitely the nicest answer; it feels much saner than using some seemingly random thing, such as the stretchability of inter-word spacing, as the spacing between the dots.
    – morbusg
    Commented May 1, 2013 at 6:23
  • With a german Mac keyboard use opt+. (dot) to get the ellipsis
    – Tobi
    Commented May 1, 2013 at 7:37
  • 11
    This is definitely not the right way to do it. \ldots is the right way to do it.
    – N. Virgo
    Commented Jul 3, 2015 at 14:13
  • 3
    Ditto @Nathaniel. \ldots should definitely be preferred over a unicode character.
    – Will
    Commented Oct 14, 2015 at 16:57
  • 3
    the spacing of the dots depends heavily on the design of the font. many fonts have the dots too close together for decent math typesetting. Commented Nov 9, 2015 at 16:00

You must log in to answer this question.

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