11

When writing the TeX-codes we often use the 6-symbols \ldots command. It should be more comfortable to type merely three dots ... instead. Just the same as for TeX-parsing the minus symbols - or -- or ---. So I wonder, is it possible reprogram internal TeX understanding the triple ... into the \ldots-command. Of course the single/double dots . and .. should be of the standard meaning.

  • 9
    \dots is just five. ;-) – egreg May 27 '14 at 17:57
  • Redefining dots will have nasty effects (specially on tikz, pgffor and probably other packages). – JLDiaz May 27 '14 at 17:58
  • 1
    If it is about saving keystrokes, you can \let\dd=\ldots – JLDiaz May 27 '14 at 18:02
  • @JLDiaz: Save even another keystroke, since the = is optional (see \let\foo\bar vs \let\foo=\bar): \let\dd\ldots – Werner May 27 '14 at 18:07
  • 2
    unless you're using a font that has an ellipsis symbol the ligaturing mechanism (used for -- and ---) won't work. and even if that symbol is in the font, it's usually "narrower" (not as much space between the dots) than ideal for dots in math. – barbara beeton May 27 '14 at 18:17
  • It'a a pitty. Simple dots ... seems to be the only preferable solution. Otherwise the game is not worth the candle. What about ... ? –  May 27 '14 at 18:32
  • @maximav \... would only be a valid macro name if the catcode of . were changed, which probably would have undesirable side effects. Just stick with \dots. – jub0bs May 27 '14 at 18:44
  • \def...{\ldots} works for my LaTeX. But where reefs may come from? –  May 27 '14 at 18:49
  • 1
    @maximav \def\... redefines the macro \. not the macro \... (so breaks any letter with a dot accent) – David Carlisle May 27 '14 at 20:04
  • Sounds nice. But why A\ldots and A... gives exactly the same positioning the dots after A? Except for a space after the dots themselves. –  May 27 '14 at 21:16
  • I've checked again and \def...{\ldots\ignorespaces} works like a usual correct command. Now, is it possible to know an internal definition of . command (dot above a symbol)? Something like \mathchar"17D which makes a prime in math-mode. If such an independent definition of . exists I could seems correct my def ... including standard action of . By the way, its a pity that it is not possible to redefine \def. whilst we may do this for \def~ –  May 28 '14 at 05:14
  • Some tex editors have built-in features to replace triple dots by \ldots automatically. – TZakrevskiy Apr 22 '15 at 10:29

1 Answers1

14

It is pointless to define \def\...: if you want to redefine \. just use \renewcommand\.{\ldots} or some such. (so the use is just two characters \.) As noted in comments this will break any use of the dot accent. Using an alternative form for dot accent isn't really possible as inputenc uses \. in its definition of accented characters, so if you want to redefine \. without breaking the accent you would have to change the encoding definition for every encoding that includes characters with that accent.

By far the best course is to use the existing \ldots or \dots commands, or use utf8 encoding and use the ellipsis character (U+2026 ) directly.

David Carlisle
  • 757,742