3 Answers
3

I would guess that the \DOTSB controls what kind of dots go before (or after?) this symbol. Doing

\show\mapsto

shows that that has the magic \DOTSB. So if defining your own macro, I would experiment with adding \DOTSB, \DOTSI, \DOTSX (those appear to be the options) before or after them. (Please report back on what happens!). I would guess that \dots "knows" about certain commands, but has to be told about any extra. \to seems to come in under the "known" commands, but, for example, it has to be told about \mapsto:

If this is possible, I didn't know about it. (Sorry, no time to check myself right now.) Very interesting!
–
Will RobertsonJul 30 '10 at 16:10

Just a quick note before going to sleep: it works! If I use \newcommand{\myto}{\DOTSB\to} then \myto will produce the correct alignment! Thanks, tomorrow I'll try and check what the other options do.
–
Juan A. NavarroJul 30 '10 at 22:31

Thanks, I already knew about these, but I'm actually trying to define a macro that will add \dots between some some relations/operators which are provided by the user. So I, as a package write, don't know in advance which of the semantic commands should be used. However, as the example in the question shows, amsmath somehow knows!
–
Juan A. NavarroJul 30 '10 at 22:27

The quick'n'easy answer is that it looks at the next token in the input stream and bases its decision on that. If it's something vertically raised such as a plus sign or an arrow, it uses \cdots, otherwise it uses \ldots.
–
Will RobertsonJul 30 '10 at 16:10