2

I would like to have a \hookrightarrow-like arrow in an \xymatrix environment. I am aware that the suggested code for this is \ar@{^{(}->}[r], but I find the arc at the arrow's source to be unproportionally large and not quite what I am looking for. This example illustrates the problem quite well:

\documentclass{article}
\usepackage[all,2cell]{xy}  
\UseAllTwocells
\SelectTips{eu}{10}

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

I have tried to create something with \newdir that resembles the \hookrightarrow more, but frankly I do not seem to properly comprehend the way this works.

It is important for me that the arrow tip works for arrows with any angle of orientation, not just left to right ones. Whatever I created with \newdir would result in a misplaced arc for some orientation of the arrow, and eventually I gave up to ask for help here.

I would be very grateful if someone could provide an arrow tip that satisfies all these requirements, thanks a lot in advance.

  • 2
    A very big defect of Xy-pic. – egreg Oct 31 '16 at 13:10
  • Any updates here? Does the problem still exists? – Bobyandbob Dec 14 '17 at 20:03
  • @Bobyandbob Unfortunately, I never got it to really look the way I wanted it to. – Jesko Hüttenhain Dec 14 '17 at 22:07
2

If you're not bound to \xymatrix, with tikz-cd it is very simple:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\[
\begin{tikzcd}
A\ar[r, hook] & B\ar[d, hook]\\
C\ar[u, hook] & D\ar[l, hook] 
\end{tikzcd}
\]
\[ A \hookrightarrow B \]
\end{document}

enter image description here

  • Thanks for the necromancy! I am long past this problem, but I appreciate the solution anyway =). – Jesko Hüttenhain Apr 21 at 17:32
  • @JeskoHüttenhain I was looking through the old questions searching for something to answer :) Thank you for accepting my answer! – CarLaTeX Apr 21 at 17:37
1

My proposal using the xy package as requested by the user. I hope it'll help. Obviously you can change the lengths of the rows (R) or columns (C) with the string @R=4em@C=4em.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[all]{xy}
\begin{document}

\xymatrix@R=4em@C=4em{\ar@{^{(}->}[r] 
A \, \ar[r] & \,B \ar@{^{(}->}[d] \\
B\,  \ar@{^{(}->}[u]& \ar@{^{(}->}[l] \,C}
\end{document}

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.