# Overset arrows similar to \vec for monomorphism, epimorphism and isomorphism

I want to define 3 commands similar to \vec. The first, \Mono, must place over the argument an arrow just like in \vec, but with another arrowhead in the beginning of the arrow, and also pointing rightwards. This is to represent injections or monomorphisms.

The second,\Epi, must place over the argument an arrow just like in \vec, but with two arrowheads in the end of the arrow, both pointing rightwards. This is to represent surjections or epimorphisms.

The third, \Iso, must place over the argument an arrow just like in \vec, but with another arrowhead in the beginning of the arrow, but pointing leftwards. This is to represent bijections or isomorphisms.

My first attempt was to define the following commands

\newcommand{\Mono}[1]{\overset{\rightarrowtail}{#1}}
\newcommand{\Iso}[1]{\overset{\leftrightarrow}{#1}}


But these commands create too much space between the letter in the argument and the arrows above them, and the arrows themselves are too big. Ideally, I would like to know how \vec is defined and also to have commands that behave well in superscripts etc.

I don't know exactly how you defined \rightrightarrow, but my main point is to show the layout will be better if you do that with the accents package, as it takes into account the italic angle of the maths variables, so I replaced it with \hookrightarrow, which is a standard way to denote an injective homomorphism.

Here is a comparison of both ways:

\documentclass{article}
\usepackage{mathtools}
\usepackage{accents}
\usepackage{amssymb}
\newcommand{\Mono}[1]{\overset{\hookrightarrow}{#1}}
\newcommand{\Iso}[1]{\overset{\leftrightarrow}{#1}}

\begin{document}

$\begin{matrix}\Mono{f}: A \rightarrow B &\quad & \accentset{\hookrightarrow}{f}: A \rightarrow B \\% \Epi{f}: A \rightarrow B & & \accentset{\twoheadrightarrow}{f}: A \rightarrow B \\ \Iso{f}: A \rightarrow B & & \accentset{\leftrightarrow}{f}: A \rightarrow B \end{matrix}$%

\end{document}


• Thanks for the answer, I will test this, but I still rather define a command instead of using this whole package just for this. Feb 9 at 19:29
• I changed \rightrightarrow to \rightarrowtail, I just didn't remember I used this command at the time I asked the question... Feb 9 at 19:30
• Of course, you may define new commands with accents. I did not want to do it in your place. Feb 9 at 19:31
• I didn't remember \rightarrowtail. It's quite fine. Feb 9 at 19:33
• Oh, that's not what I meant. I mean, instead of defining a command using \accentset from thr package accents, I would prefer to define some kind of command (like \accentset, possibly) explicitly, directly. Feb 9 at 19:34