1

My question is the following: for exercise I was drawing the 2nd figure of this question using xy package and I have found some difficulties that I have marked with the red rectangles:

enter image description here

  1. How can I increase the distance between $\pi_1(U,p)$ and the arc of the hook-arrow that it is different by xy package?
  2. How can I obtain the same arc of the hook-arrow?
  3. How can I obtain the same tip of the image? If I use cmtip option I will obtain the tip of tikz-cd.

I attach my MWE:

\documentclass[a4paper,12pt]{article}
\usepackage[all]{xy}
\usepackage{newtxtext,newtxmath}
\begin{document}
\xymatrix@R=4pc@C=2pc{
& A \ar[dr] \ar@{^{(}->}[d]&\\
\pi_1(U\cap V,p)\ar[ur] \ar[dr] &  \pi_1(U,p)*\pi_1(V,p) \ar[r] & \pi_1(X,p).\\
& \pi_1(V,p) \ar[ur] \ar@{_{(}->}[u]&
}
\end{document}

w

4
  • 1
    Hvis is one of the reasons why I nowadays recommend tikz-CD where this is not an issue
    – daleif
    Aug 8, 2020 at 14:39
  • @daleif With all the sincerity I also like old packages like xy.
    – Sebastiano
    Aug 8, 2020 at 15:16
  • 1
    The hook arrow in xy has been suboptimal since always. Tikz-CD just looks better by default
    – daleif
    Aug 8, 2020 at 16:03
  • @daleif Seeing the picture the hook arrrow it is different of tikz-cd...for the hook arrow it is true. +1.
    – Sebastiano
    Aug 8, 2020 at 16:07

1 Answer 1

2

Major edit: tikz-cd

I agree with the commenter, that tikz-cd is more capable a package than xymatrix. If one were to attempt the same thing using tikz-cd, this would be the code:

\documentclass[a4paper,12pt]{article}

\usepackage{newtxtext,newtxmath}

\usepackage{tikz-cd}
\usetikzlibrary{arrows,arrows.meta}
\tikzcdset{
    ,row sep=normal
    ,column sep=normal,
    ,/tikz/baseline=0pt
    ,arrow style=tikz
    ,diagrams={>=stealth}
    % ,diagrams={>=stealth'}
    % ,arrows={-Latex}
}

\begin{document}

\begin{tikzcd}
                                                            &  & A \arrow[rrdd, "k_*"] \arrow[dd, hook]             &  &               \\
                                                            &  &                                                    &  &               \\
{\pi_1(U\cap V,p)} \arrow[rruu, "i_*"] \arrow[rrdd, "j_*"'] &  & {\pi_1(U,p)*\pi_1(V,p)} \arrow[rr]                 &  & {\pi_1(X,p).} \\
                                                            &  &                                                    &  &               \\
                                                            &  & {\pi_1(V,p)} \arrow[uu, hook'] \arrow[rruu, "l_*"'] &  &              
\end{tikzcd}

\end{document}

And this the output:

tikz-cd diagram

Arrow tips

You can change the arrow tips by exchanging ,diagrams={>=stealth} with ,diagrams={>=stealth'} or ,arrows={-Latex} to just name a few possibilities. Try it out and play with it, it's really fun.

xymatrix

You have to set the entry default margin @M=dimen as specified on page 10 of the manual: https://ctan.org/pkg/xymatrix

\documentclass[a4paper,12pt]{article}
\usepackage[all]{xy}
\usepackage{newtxtext,newtxmath}

\begin{document}

\begin{displaymath}
\xymatrix@M=.75pc@C=2pc{
& A \ar[dr] \ar@{^{(}->}[d] & \\
\pi_1(U\cap V,p)\ar[ur] \ar[dr] &  \pi_1(U,p)*\pi_1(V,p) \ar[r] & \pi_1(X,p).\\
& \pi_1(V,p) \ar[ur] \ar@{_{(}->}[u]&
}
\end{displaymath}

\end{document}

@M=dimen

You could also change the entry height @H=dimen set entry default height:

\documentclass[a4paper,12pt]{article}
\usepackage[all]{xy}
\usepackage{newtxtext,newtxmath}

\begin{document}

\begin{displaymath}
\xymatrix@H=1.5pc@C=2pc{
& A \ar[dr] \ar@{^{(}->}[d] & \\
\pi_1(U\cap V,p)\ar[ur] \ar[dr] &  \pi_1(U,p)*\pi_1(V,p) \ar[r] & \pi_1(X,p).\\
& \pi_1(V,p) \ar[ur] \ar@{_{(}->}[u]&
}
\end{displaymath}

\end{document}

Entry height

7
  • You were great for my first problem. I've read the manual so many times but I don't understand some parameters. For example, I couldn't find anything to change the vector tips and to better bend the tail of the two vectors. Many of my problems come from not understanding English very well.
    – Sebastiano
    Aug 8, 2020 at 15:20
  • 1
    @Sebastiano, have a look at the edit, maybe this brings you closer to the result you desire. Aug 8, 2020 at 17:49
  • 1
    I understand you completely. I'm not sure, what you wish can be done with xymatrix. Don't you agree that the tikz-cd solution looks a lot better? Aug 8, 2020 at 18:49
  • 1
    Of course I totally agree with you and dailef.
    – Sebastiano
    Aug 8, 2020 at 18:58
  • 1
    @daleif, have a look at page 6 (bottom half): ctan.org/pkg/tikz-cd Aug 8, 2020 at 20:10

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .