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: الدوال والتعيين, علوم الحاسوب

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 رموز الأسهم →

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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث