# A symbol like \hookleftarrow without the arrow?

There are square hooks (e.g. \lsqhook), but that's not quite what I want. I'd like a version of \hookleftarrow without the arrow. Is it possible to modify the \hookleftarrow, or \hookrightarrow symbols to get what I want?

The definition of \hookleftarrow is

\leftarrow\joinrel\rhook


and \longleftarrow is \leftarrow\joinrel\relbar. Ehi! We can use \relbar!

\documentclass{article}
\usepackage{amsmath}% generally recommended

\newcommand{\hookleftline}{\DOTSB\relbar\joinrel\rhook}
\newcommand{\hookrightline}{\DOTSB\lhook\joinrel\relbar}

\begin{document}

$A\hookleftline B$

$A\hookrightline B$

\end{document}


The \DOTSB command is for amsmath.

• Ah! I can look at the documentation of amsmath to see how a symbol is defined, and then tweak that! – user89 Feb 7 '18 at 15:31
• @user89 That's always the starting point – egreg Feb 7 '18 at 15:36

One possibility is to "build your own".

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\newcommand{\Hook}{%
\raisebox{1.5pt}{\rotatebox{90}{\reflectbox{\resizebox{3pt}{\height}{$\mathsf{J}$}}}}}
\newcommand{\PicHook}{%
\begin{picture}(9,6)
\put(0,3){\line(1,0){7}}
\put(8,6){\oval(2,2)[r]}
\end{picture}}
\begin{document}
$\hookleftarrow$~\Hook~$A\Hook B$

$\hookleftarrow$~\PicHook~$A\PicHook B$

\end{document}


This is a "minimal" version in the sense that it does not require extra fonts, but it certainly not the most beautiful symbol on this planet.