Maps To in LaTeX (\mapsto)

↦\mapsto
LaTeX command
\mapsto
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
↦U+21A6

Where it is used

Draws a barred arrow showing where a function sends an individual element, as in x ↦ x².

Use \mapsto for elements and \to for sets: f : \mathbb{R} \to \mathbb{R},\ x \mapsto x^2 states the domain, codomain, and rule together. Lambda calculus and functional programming papers use it for anonymous functions, and semantics write substitutions or environment updates as [x \mapsto v]. It differs from \to only by the small bar at its tail, so make sure it renders clearly at small sizes. For long expressions use \longmapsto. In commutative diagrams, element-level arrows are also drawn with a mapsto tail.

Also listed under: Functions & Mapping, Computer Science

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

f:R→R,x↦x2+1f : \mathbb{R} \to \mathbb{R}, \quad x \mapsto x^2 + 1
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Maps To: $\mapsto$

\[ f : \mathbb{R} \to \mathbb{R}, \quad x \mapsto x^2 + 1 \]
\end{document}

Related symbols

All Arrow Symbols →

Frequently asked questions

How do I write Maps To in LaTeX?
Type \mapsto in math mode, for example $f : \mathbb{R} \to \mathbb{R}, \quad x \mapsto x^2 + 1$. It works in plain LaTeX without loading any package.
Which package do I need for \mapsto?
None. \mapsto is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \mapsto in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\mapsto$ in running text. If you only need the glyph in text, paste the Unicode character ↦ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredWrite LaTeX using AI

Best AI LaTeX Editor, Overleaf Alternative

Octree helps researchers from 15+ universities write research papers faster using AI

  • Generate beautiful TikZ diagrams using AI
  • Upload image and convert it to LaTeX seamlessly
  • Get instant assistance with writing and formatting research papers