2

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?

4

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}

enter image description here

The \DOTSB command is for amsmath.

| improve this answer | |
  • 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
1

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}

enter image description here

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.