# Subset arrows in xymatrix

Is it possible to make an arrow in xymatrix that is a subset symbol?

-

It's common to represent monomorphisms using an arrow having a subset symbol at the beginning, (as in amsmth's \hookrightarrow). The xy package offers the @{^{(}->} construct for such an arrow:

\documentclass{article}
\usepackage{amsmath}
\usepackage[all]{xy}

\begin{document}

$A\hookrightarrow b$

$\xymatrix@1{A\, \ar@{^{(}->}[r] & B}$

\end{document}

-
Another common picture of an injective morphism is the arrow \ar@{>->}[r] –  Phil Hirschhorn Apr 12 '11 at 0:34
@Gonzalo Medina, do you know if is possible to make the arrow shorter so the inclusion tail and arrow tip are not so close to the diagram entry? –  Sigur Apr 14 at 18:46

I personally use :

\documentclass{article}
\usepackage[all]{xy}

\begin{document}

$\xymatrix@1{A\, \ar@{}[r]|-*[@]{\subset} & B}$

\end{document}


It's very simple and I guess it can look weird if the space between entries is too big, but I feel it the best way, enlarged subset symbols are just awful.

Maybe with a little more skill in xy-pic constructions, you can arrange to slightly rescale the symbol depending on the space between entries. By hand, it's possible for sure, but I guess it would be possible to do that automatically too.

-

If you want an extensible subset symbol, you could use the couple of arrows

\ar@{^{(}-}[r]\ar@<1ex>@{-}[r]

-