4

I would like to have an arrow with "1-1" above it and/or "onto" below it, with the arrow being normal size. I get what I want with "1-1" using \stackrel:

\documentclass[12pt]{article}

\begin{document}
\(

\stackrel{1-1}{\longrightarrow}\\

\stackrel{\stackrel{1-1}{\longrightarrow}}{onto}
\)

\end{document}

I would like to position "onto" similarly below the arrow. But using a nested stackrel makes the arrow to small and too high. What should I do?

Ruby
  • 939

1 Answers1

5

Package amsmath provides extensible arrows with options for text above and below:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
  A \xrightarrow[\text{onto}]{\text{1--1}} B
\]
\end{document}

Result

PS: I am not sure, what 1-1 is supposed to mean. As mathematical expression it looks too trivial to me, thus I have interpreted it as text.

Heiko Oberdiek
  • 271,626
  • 1-1 is a common short name for being injective (there is a one to one relationship between the elements). Onto is short for surjective (hitting all elements in the target set). – daleif Oct 25 '15 at 06:35
  • 1
    @daleif Thanks. Then the dash seems to be the correct one. – Heiko Oberdiek Oct 25 '15 at 07:45