13

Similarly, is there any difference between \rightarrow and \to? From what I could see, they are just aliases.

  • Indeed they are the same – User Dec 14 '15 at 14:47
14

fontmath.ltx (generated by fontdef.dtx) defines

\DeclareMathSymbol{\leftarrow}{\mathrel}{symbols}{"20}
  \let\gets=\leftarrow
\DeclareMathSymbol{\rightarrow}{\mathrel}{symbols}{"21}
  \let\to=\rightarrow

so they print exactly the same glyph in the LaTeX format.

EDIT As clemens points out, there is a semantic difference. I use \to and \gets when dealing with functions, like in

$f\colon A \to B$

On the other hand, if I had to define some symbol containing an arrow to the right, I would never use \to but rather \rightarrow.

  • 1
    Maybe worth mentioning that the difference is semantics: one name describes the symbol the other the function – clemens Dec 14 '15 at 14:59
  • Yes. You can also see that with the \showcommand. See <tex.stackexchange.com/questions/11907/how-do-i-use-show> – Denis Dec 14 '15 at 15:01
  • @clemens Good point, thanks. Feel free to edit if you've got a better explanation. – campa Dec 14 '15 at 15:08
  • 3
    I wish \to and \gets were documented in the LaTeX manual. I started using plain TeX and then AMSTeX, where the commands are documented. The first versions of LaTeX loaded a slightly modified plain.tex file, so it was quite easy to port plain TeX files. In particular it kept \to and \gets, which never found their way in the manual. – egreg Dec 14 '15 at 16:15
  • 1
    The term "plain LaTeX format" is a bit confusing, as there is the "Plain TeX format". (The latter is described in great detail in the TeXbook.) Better to omit the modifier "plain" when referring to LaTeX. Thus, do write "in the basic LaTeX format" or, if you want to be more specific, "in the file fontmath.ltx" -- as you have, in fact, done already in your answer. – Mico Dec 14 '15 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.