1

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{\Epi}[1]{\overset{\twoheadrightarrow}{#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.

1 Answer 1

2

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{\Epi}[1]{\overset{\twoheadrightarrow}{#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} 

enter image description here

11
  • 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, 2021 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, 2021 at 19:30
  • Of course, you may define new commands with accents. I did not want to do it in your place.
    – Bernard
    Feb 9, 2021 at 19:31
  • I didn't remember \rightarrowtail. It's quite fine.
    – Bernard
    Feb 9, 2021 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, 2021 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .