\rightarrow right arrow (→) in LaTeX

Command\rightarrow
Modemath
Packagenone, part of LaTeX
Unicode→ U+2192
KindArrows
Also calledto, arrow

\rightarrow typesets the symbol “right arrow” (→). It is an arrow.

Try it

f ⁣:A→Bf \colon A \rightarrow B

Open this formula in the editor The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.

Example

\documentclass{article}
\begin{document}
\( f \colon A \rightarrow B \)
\end{document}

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023.

How to use it

\rightarrow works only in math mode. In running text, put it between $...$ or \(...\). Outside math mode LaTeX stops with Missing $ inserted. The command is part of LaTeX; you need no package.

\to is a shorter name for the same arrow.

About arrows

Arrow names are built from parts: left, right, up or down for the direction, a capital first letter for a double line, and long for a longer shaft. Arrows are spaced like relation symbols. An arrow with text above it is \xrightarrow{text} from amsmath.

More arrows

All arrows