[Tex/LaTex] hooked arrows with XY-matrix

arrowsxy-pic

The naive way to draw an hooked arrow in a diagram with XY-matrix is \ar@{^{(}->}. But it comes out that the hook is bigger respect the one of \hookrightarrow.

How can I fix this difference?

many thanks.

Best Answer

The hooked arrow in xy is one of the ugly parts of this package. It just looks wrong. You could write this issue to the maintainer (if still active) or you switch to the more modern and much easier (to read) tikz-cd. In my MWE I am showing both in order to show the difference between their hooked arrows:

% arara: pdflatex

\documentclass{article}
\usepackage[all,cmtip]{xy}
\usepackage{tikz-cd}

\begin{document}    
\[\xymatrix{A\ar@{^{(}->}[r]& B}\]
\[\begin{tikzcd}        
    A \arrow[hook]{r} & B   
\end{tikzcd}\]
\end{document}

enter image description here

The latter is equal to the 'normal' \hookrightarrow.