Here's a method that doesn't involve TikZ (not a complete truth -- see pre-requisite) :p
Pre-requisite: You need a picture (preferably in vector format) of the hook arrow. One way is to use TikZ, of course. Another is to draw it in Inkscape or similar software. The point is that your main .tex
file using this command would not need TikZ explicitly, nor the use of XeTeX or LuaTeX. I drew my arrow with TikZ, the code for which I supply at the very end of this answer.
On to the code proper:
- I used the
\includegraphics
command from the graphicx
package to include the image of the hook arrow in,
- enclosed that in a
\scalerel
command from the \scalerel
package (written by Steven in the other answer) to ensure it scales well when used in-line,
- and then I enclose the entire thing in a
\mathrel
for proper spacing when in math mode, just like for the normal \rightarrow
etc.
- Finally I wrapped the entire thing in a macro called
\hookrightstealtharrow
as requested.
Code:
\documentclass{article}
\usepackage{scalerel,graphicx}
\usepackage[nopar]{lipsum} % for dummy text only
\newcommand\hookrightstealtharrow{%
\mathrel{%
\scalerel*{\includegraphics{arrow}}{x}}}
\begin{document}
\textbf{Exhibit A: Comparison with original hooked arrow} \par\medskip
\verb!Normal \hookrightarrow:! $x \hookrightarrow y$ \par
\verb!\hookrightarrow with stealth:! $x \hookrightstealtharrow y$ \par
\bigskip
\textbf{Exhibit B: Showing in-line use} \par\medskip
\lipsum[28]
$x \hookrightstealtharrow y$,
$A_{x \hookrightstealtharrow y} B$,
$C^{x \hookrightstealtharrow y} D$
\lipsum[13]
\bigskip
\textbf{Exhibit C: In various font sizes} \par\medskip
\small $x \hookrightstealtharrow y$\par
\normalsize $x \hookrightstealtharrow y$\par
\large $x \hookrightstealtharrow y$\par
\huge $x \hookrightstealtharrow y$
\end{document}



ps. Sorry for the different sizes of the exhibits. Had to zoom in on them so the image is clearer. So I took individual screenshots. Also, note there's no TikZ :p
Drawing the arrow
You can do this however you like, but I did it with TikZ, see here:
\documentclass[border=1.5pt,tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\tikz[baseline=-.2ex] \draw[{Hooks[right]}-{stealth},] (0,0)--(1.5em,0);
\end{document}

I compiled the above with pdfLaTeX to generate a .pdf file of this image, then placed it in the same directory as the main .tex
file.