Skip to content

When to use \ldots v. \cdots v. ...? #2529

Closed

Description

@burblebee

In #2450, @zygoloid claims that \cdots should be used when listing n number of arguments (as in C<A1, A2, ..., An>), since

These are ... mathematical ellipses rather than code ellipses, so they should be either \ldots or \cdots; we tend to use \cdots in contexts such as this where there could otherwise be confusion with actual ellipses and parameter packs.

But this is confusing given the existing uses of \ldots, \cdots, and ...in the standard. Perhaps many of the uses of...should actually be\cdots`? Once clarified, please update the answer in our Q & A. Also consider adding examples of each to the example codeblock in the example Latex code in our quidelines.

Activity

  1. jensmaurer commented on Nov 27, 2018

    @jensmaurer
    Member

    See #2032 for some answers.

  2. tkoeppe commented on Nov 27, 2018

    @tkoeppe
    Contributor

    I'm not sure this is all that confusing, it's always been pretty obvious which kind of ellipsis is used for what.

    • Pack expansion in code uses code ....
    • A textual ellipsis in body text to mark a trailing-off thought is not something we should really have in the standard, but if we did, it'd use (text-mode) \ldots. The closest we come to this is an omission ellipsis in example code, for which I made the \commentellip macro.
    • In maths/symbolic contexts, the ellipsis matches the operator that's being folded: the comma uses \dotsc ("c" for "comma") from AmsMath (or, less desirably but equivalently, \ldots), and other binary operators like + and - use \dotsb ("b" for "binary operator") from AmsMath (or, less desirably but equivalently, \cdots). I would strongly suggest AmsMath's consistent family of ellipses rather than the lower-level LaTeX builtins.
    • Diagonal and vertical ellipses exist, too, for various matrix and table situations.
  3. jensmaurer commented on Nov 27, 2018

    @jensmaurer
    Member
  4. zygoloid commented on Nov 27, 2018

    @zygoloid
    Member

    the comma uses \dotsc ("c" for "comma") from AmsMath

    In contexts involving both packs and ellipses, using \dotsc / \ldots is confusing and borderline unreadable; using \cdots is much clearer.

  5. zygoloid commented on Nov 27, 2018

    @zygoloid
    Member

    For example, [temp.variadic]p8:

    The instantiation of a pack expansion that is neither a sizeof... expression nor a fold-expression produces a list of elements E1, E2, · · · , EN, where N is the number of elements in the pack expansion parameters.

    The choice to use \cdots here was intentional to avoid the ellipsis being confused with a pack expansion ellipsis.

  6. jensmaurer commented on Nov 27, 2018

    @jensmaurer
    Member

    @zygoloid, thanks. I've added this corner of the cases to the wiki page. Is there any reason to keep this issue open, then?

  7. Eelis commented on Nov 27, 2018

    @Eelis
    Contributor

    The guidance in the wiki leaves me with one question: what about ellipses outside of math/code? I recently replaced a bunch of those in my fork of the document because cxxdraft-htmlgen's sentence splitting can get confused by them.

    So for me, it would be great if such raw ellipses outside math/code were also systematically replaced with some command, because it would be one less patch to maintain.

  8. jensmaurer commented on Nov 27, 2018

    @jensmaurer
    Member

    @Eelis: There should be no raw "..." in plain prose text. I'm preparing a patch.

  9. tkoeppe commented on Nov 27, 2018

    @tkoeppe
    Contributor

    @zygoloid: OK, fair enough, but I'd say that's a corner case that represents a lose-lose-lose situation. I'm sympathetic to your chosen solution, but I'd say that it doesn't affect the general rules I outlined above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions