Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
burblebee opened this issue Nov 27, 2018 · 9 comments
Closed

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

burblebee opened this issue Nov 27, 2018 · 9 comments

Comments

@burblebee
Copy link
Contributor

burblebee commented Nov 27, 2018

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.

@jensmaurer
Copy link
Member

jensmaurer commented Nov 27, 2018

See #2032 for some answers.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 27, 2018

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.

@jensmaurer
Copy link
Member

@zygoloid
Copy link
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.

@zygoloid zygoloid reopened this Nov 27, 2018
@zygoloid
Copy link
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.

@jensmaurer
Copy link
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?

@Eelis
Copy link
Contributor

Eelis commented Nov 27, 2018

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.

@jensmaurer
Copy link
Member

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

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 27, 2018

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants