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

Sebastiano
  • 54,118

1 Answers1

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

phil-elkabat
  • 2,055
  • 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 08 '20 at 15:20
  • 1
    @Sebastiano, have a look at the edit, maybe this brings you closer to the result you desire. – phil-elkabat Aug 08 '20 at 17:49
  • ☹️ I didn't want to use tikz-cd because I wanted to take an old package that I like so much xy and see if there are any strategies to get the result of the image. – Sebastiano Aug 08 '20 at 18:43
  • 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? – phil-elkabat Aug 08 '20 at 18:49
  • 1
    Of course I totally agree with you and dailef. – Sebastiano Aug 08 '20 at 18:58
  • Just wondering as I've never seen them before, what does =normal mean? – daleif Aug 08 '20 at 19:41
  • 1
    @daleif, have a look at page 6 (bottom half): https://ctan.org/pkg/tikz-cd – phil-elkabat Aug 08 '20 at 20:10