Arrows

Arrows are symbols used in math mode. They appear most often as relations — the “→” in a map f\colon A \to B, or implication “⇒” and “⇔” — and as the edges of commutative diagrams. The basic arrows are all part of standard LaTeX and need no extra package, but decorative ones such as two-headed (\twoheadrightarrow) and dashed arrows require amssymb. This page sorts out how to enter them, gathers the horizontal, double, maps-and-hooks, vertical-and-diagonal, and harpoon forms into lookup tables, and closes with the extensible arrows that carry text.

How arrows are entered

Arrows are symbols used inside math mode. Writing \to straight into the body (text mode) is an error, so you enter math mode first, as in $f\colon A \to B$. The command names are built from direction and shape — \leftarrow (leftward ←), \rightarrow (rightward →), \leftrightarrow (both ways ↔). A capitalized initial, as in \Rightarrow (⇒), gives the double-line form, and a long prefix, as in \longrightarrow (⟶), gives a long arrow.

latex
写像 $f\colon A \to B$ と、含意の連鎖。
\[
  P \implies Q, \qquad x \to 0, \qquad a_n \to L \;(n \to \infty)
\]

A few points are worth fixing in your mind. (1) \to is an alias for \rightarrow, and \gets is an alias for \leftarrow; the short \to/\gets are the usual choice for maps and limits. (2) \iff (⟺) is \Longleftrightarrow with a little extra space on each side, used for “if and only if.” (3) The basic arrows are standard LaTeX, but decorative ones such as \twoheadrightarrow (↠) and \rightarrowtail (↣) need \usepackage{amssymb}. Entries that require amssymb are marked in the tables.

Horizontal arrows (single and double)

The most common arrows are horizontal. There are the single-line \leftarrow/\rightarrow/\leftrightarrow, their lengthened forms \longleftarrow/\longrightarrow/\longleftrightarrow, and the double-line (implication) \Leftarrow/\Rightarrow/\Leftrightarrow with their long versions. These long arrows are a fixed length — distinct from the extensible arrows that carry text (covered below).

CommandGlyphMeaning / use
\leftarrowleftward arrow (same as \gets)
\getsalias for \leftarrow; “is assigned”
\rightarrowrightward arrow (same as \to); maps, etc.
\toalias for \rightarrow; f\colon A \to B
\leftrightarrowleft-right arrow
\longleftarrowlong leftward arrow
\longrightarrowlong rightward arrow
\longleftrightarrowlong left-right arrow
\Leftarrowdouble-line leftward arrow
\Rightarrowdouble-line rightward arrow; implies
\Leftrightarrowdouble-line left-right arrow; equivalence
\Longleftarrowlong double-line leftward arrow
\Longrightarrowlong double-line rightward arrow
\Longleftrightarrowlong double-line left-right arrow
\iffif and only if; \Longleftrightarrow with extra space

For implication, amsmath also offers \implies (like \Longrightarrow, with space on each side) and \impliedby (like \Longleftarrow), which match \iff in feel. In logical contexts these give cleaner spacing around the arrow.

Maps and hooked arrows

These arrows are specialized for element correspondences and inclusion maps. \mapsto (↦) denotes how an element maps — “x goes to f(x)” (e.g. x \mapsto x^2) — as opposed to \to, which goes from set to set. \hookrightarrow (↪) is a hooked arrow, the conventional notation for an inclusion (injective) map. These are all standard LaTeX.

CommandGlyphMeaning / use
\mapstoelement maps to; “x ↦ …”
\longmapstolong maps-to arrow
\hookleftarrowleft arrow with hook
\hookrightarrowright arrow with hook; inclusion / injection
latex
\[
  f\colon \mathbb{R} \to \mathbb{R}, \quad x \mapsto x^2,
  \qquad \mathbb{Z} \hookrightarrow \mathbb{Q}
\]

To make injectivity or surjectivity even more explicit, amssymb offers \rightarrowtail (↣, injection) and \twoheadrightarrow (↠, surjection) — see the table in the next section. Take care not to repurpose a plain arrow for inclusion, and not to confuse \hookrightarrow with \rightarrowtail.

Vertical and diagonal arrows

Vertical and diagonal arrows serve as the vertical edges of commutative diagrams, indicate the direction of a limit, or show increase/decrease. Vertical comes in single-line \uparrow/\downarrow/\updownarrow and double-line \Uparrow/\Downarrow/\Updownarrow; diagonal covers the four directions \nearrow (NE ↗), \searrow (SE ↘), \swarrow (SW ↙), \nwarrow (NW ↖). All are standard LaTeX. Note that \uparrow and friends also work as delimiters with \left … \right.

CommandGlyphMeaning / use
\uparrowupward arrow
\downarrowdownward arrow
\updownarrowup-down arrow
\Uparrowdouble-line upward arrow
\Downarrowdouble-line downward arrow
\Updownarrowdouble-line up-down arrow
\nearrownortheast arrow
\searrowsoutheast arrow
\swarrowsouthwest arrow
\nwarrownorthwest arrow

Harpoons and amssymb arrows

Harpoons are arrows barbed on one side only. Perhaps surprisingly, the single harpoons \rightharpoonup, \leftharpoondown, and the stacked \rightleftharpoons (⇌) are standard LaTeX (defined in the kernel’s math-font setup) — no amssymb required. \rightleftharpoons is well known as the arrow for a reversible reaction in chemistry.

CommandGlyphNotes
\rightharpoonuprightward, barb up (standard)
\rightharpoondownrightward, barb down (standard)
\leftharpoonupleftward, barb up (standard)
\leftharpoondownleftward, barb down (standard)
\rightleftharpoonsreversible-reaction arrow (standard)

By contrast, the decorative arrows — two-headed (surjection), tailed (injection), squiggly, and paired — live in amssymb. Load it with \usepackage{amssymb} in the preamble. Here are the common ones (all require amssymb).

CommandGlyphMeaning / use (amssymb)
\twoheadrightarrowtwo-headed right arrow; surjection
\twoheadleftarrowtwo-headed left arrow
\rightarrowtailright arrow with tail; injection
\leftarrowtailleft arrow with tail
\rightrightarrowstwo right arrows side by side
\leftleftarrowstwo left arrows side by side
\rightleftarrowsright-over-left paired arrows
\rightsquigarrowsquiggly right arrow
\leftrightsquigarrowsquiggly left-right arrow
\curvearrowrightclockwise curved arrow
\nrightarrownegated (slashed) right arrow
\nRightarrownegated double-line right arrow

Extensible labeled arrows

Extensible arrows carry text above (and below) and stretch to fit its width. Unlike the fixed-length \longrightarrow, they grow or shrink with the label. The basics are amsmath’s \xrightarrow{…} and \xleftarrow{…}, with the text on top written in { }. They are common in commutative diagrams and when annotating a map.

latex
\usepackage{amsmath}   % \xrightarrow, \xleftarrow
% \usepackage{mathtools} % \xLeftarrow, \xhookrightarrow, \xmapsto なども
\[
  A \xrightarrow{\;f\;} B \xrightarrow{\;g\;} C,
  \qquad x \xrightarrow[n\to\infty]{} L
\]

Adding the **optional argument [ ]**, as in \xrightarrow[below]{above}, places text underneath as well. amsmath defines only the right and left forms, so for double-line or hooked extensible versions (\xLeftarrow, \xRightarrow, \xhookrightarrow, \xmapsto, …) load **mathtools** (which pulls in amsmath for you). If a fixed length is fine, the \longrightarrow family from the earlier sections is enough.

In short: standard LaTeX for arrows used as relations and maps (\to, \Rightarrow, \mapsto, the harpoons); amssymb for decorative shapes such as two-headed and squiggly arrows; and amsmath/mathtools \x… when you need a labeled, stretching arrow. For building the diagrams themselves, see the “Commutative diagrams” page.