# How to build two lines aligned maps

I would like to write a map between two objects, with a map below which specify where any single object is sent. To be more precise. I want to write $A \rightarrow B$, and right below it $\alpha \mapsto \beta$. I tried with the command $\underset$ but the maps below gets too smaller, and it's not aligned to the map above. What is the right command?

I apologize if this question has been already asked. To me it looks elementary, nevertheless I couldn't find it nor here nor googling around. Thank you very much for your time!

-
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). – Claudio Fiandrino Jan 23 '13 at 16:54
@ClaudioFiandrino, Thank you for your suggestion, I'll stick to it for future questions! – Giovanni De Gaetano Jan 23 '13 at 16:55

Something like this or variants like aligned if you want it to be part of a larger expression.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
A&\rightarrow B\\
a&\mapsto b
\end{align*}

\end{document}

-
rats, ya beat me. but you might want to mention commutative diagram packages like xypic or tikz for more complicated diagrams. – barbara beeton Jan 23 '13 at 17:02
@barbarabeeton and not forgetting amscd ? – David Carlisle Jan 23 '13 at 17:05
amscd is intentionally limited. it only handles strictly horizontal or vertical arrows, so if anything slanted is needed, forget it. better to start with something more functional. – barbara beeton Jan 23 '13 at 17:12

amsmath and mathtools offers extensible arrows. (If I get the question correctly)

\documentclass{article}
\usepackage{mathtools}

\begin{document}
$A \xrightarrow[\alpha \mapsto \beta]{} B$
\end{document}


-