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.
Asked
Active
Viewed 1.0k times
8
Werner
- 603,163
-
A separate question: On my machine the math-mode of the question is not rendered. Did I make some basic formatting mistakes? – Giovanni De Gaetano Apr 10 '17 at 16:25
-
1See Why doesn't maths render as maths? – Werner Apr 10 '17 at 16:38
-
The table 166, Werner mentioned, refers to "Comprehensive LaTeX symbols" – samcarter_is_at_topanswers.xyz Apr 10 '17 at 17:01
4 Answers
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}
-
Thanks! It solves the problem, but I decided to accept the other answer for its simplicity. – Giovanni De Gaetano Apr 10 '17 at 16:50
-
1Doesn't work for me for some reason: produces a short hookrightarrow... – mathreader Apr 24 '18 at 08:00
-
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.
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
\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}
Bernard
- 271,350



