You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
@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.
Activity
jensmaurer commentedon Nov 27, 2018
See #2032 for some answers.
tkoeppe commentedon 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.
....\ldots. The closest we come to this is an omission ellipsis in example code, for which I made the\commentellipmacro.\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.jensmaurer commentedon Nov 27, 2018
Documented in the wiki at: https://github.com/cplusplus/draft/wiki/Specification-Style-Guidelines#Formatting
zygoloid commentedon Nov 27, 2018
In contexts involving both packs and ellipses, using
\dotsc/\ldotsis confusing and borderline unreadable; using\cdotsis much clearer.zygoloid commentedon Nov 27, 2018
For example, [temp.variadic]p8:
The choice to use
\cdotshere was intentional to avoid the ellipsis being confused with a pack expansion ellipsis.jensmaurer commentedon Nov 27, 2018
@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 commentedon 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 commentedon Nov 27, 2018
@Eelis: There should be no raw "..." in plain prose text. I'm preparing a patch.
tkoeppe commentedon 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.