8

The usual \rightarrow has its long version \longrightarrow, exactly as \mapsto has its long version \longmapsto. I was wondering if there exists a basic command for a long \hookrightarrowas well. The stupid try \longhookrightarrrow sadly doesn't work.

Werner
  • 603,163

4 Answers4

14

I use \lhook\joinrel\xrightarrow to produce flexible arrows.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[ A \lhook\joinrel\xrightarrow{f\circ g} B \]
\end{document}

enter image description here

gernot
  • 49,614
Sigur
  • 37,330
11

No need for external packages:

\documentclass{article}

\newcommand{\hooklongrightarrow}{\lhook\joinrel\longrightarrow}
\newcommand{\hooklongleftarrow}{\longleftarrow\joinrel\rhook}

\begin{document}

$A\hooklongrightarrow B$

$A\hooklongleftarrow B$

\end{document}

The definition of \hookrightarrow is \lhook\joinrel\rightarrow, so it's very easy to complement it.

enter image description here

A comment. Beginners tend to overuse long arrows; stick with the short version: it's as clear and takes less space.

egreg
  • 1,121,712
4

enter image description here

\documentclass{article}
\usepackage[new]{old-arrows}
\begin{document}
$x\hookrightarrow y$
$x\longhookrightarrow y$

$x\varhookrightarrow y$
$x\varlonghookrightarrow y$
\end{document}

How to find these glyphs: Open The Comprehensive LaTeX Symbol List and search for hook ...

gernot
  • 49,614
3

Here's a solution:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{amsmath}

\newcommand\hooklongrightarrow{\mathrel{\lhook\mkern -3.5mu\relbar\mkern -4.5mu → }}
\begin{document}
\setlength\arraycolsep{0pt}
\[ \begin{array}{@{\vrule width 0.1pt}l@{\vrule width 0.1pt}}
  \hooklongrightarrow\\
   ―――→
  \end{array}\]%

\end{document} 

enter image description here

Bernard
  • 271,350