3

I haven't been able to find detailed instructions on how to use \compositemap from the 2cell feature of xypic, and I want to make (relatively simple) pasting diagrams. In particular, I want to typeset the whiskering operation, where we have a diagonal double arrow between vertices of a commutative square.

Also, is there a way to reverse the direction of the double arrow in 2cells in xypic, in LyX?

enter image description here

Heeelp!

4
  • Would you be willing to use a more modern package? Dec 3, 2014 at 18:37
  • Hmmm.. Ideally, I would like to stay with xypic - unless of course, I have no choice.
    – Exterior
    Dec 3, 2014 at 18:38
  • Do you have a picture, a link to an image, or even a hand-drawn image of the diagram you are trying to produce? Could you please add it to your question? Dec 3, 2014 at 18:41
  • Certainly! Just a second.
    – Exterior
    Dec 3, 2014 at 18:52

3 Answers 3

4

I would recommend tikz-cd, too. But here's a version for Xy-pic.

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

\begin{document}
\[
\begin{gathered}
\xymatrix@C+3em@R+3em{
  V_1 \ar[r]^{\rho_1(g)} \ar[d]_{\phi} &
  V_1 \ar[r]^{\rho_1(g')} \ar[d]^{\phi} &
  V_1 \ar[d]^{\phi} \\
  V_2 \ar[r]_{\rho_2(g)} \ar@{=>}[ur]^{\phi(g)} &
  V_2 \ar[r]_{\rho_2(g')} \ar@{=>}[ur]^{\phi(g')} &
  V_2
}
\end{gathered}
=
\begin{gathered}
\xymatrix@C+3em@R+3em{
  V_1 \ar[r]^{\rho_1(g'g)} \ar[d]_{\phi} &
  V_1 \ar[d]^{\phi} \\
  V_2 \ar[r]_{\rho_2(g'g)} \ar@{=>}[ur]^{\phi(g'g)} &
  V_2
}
\end{gathered}
\]
\end{document}

enter image description here

Here's one with shortened arrows

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,cmtip,2cell]{xy}

\newdir{S}{{}*!/-4em/@{=}}
\newdir{>S}{!/-4em/@{}*@{=>}}

\begin{document}
\[
\begin{gathered}
\xymatrix@C+3em@R+3em{
  V_1 \ar[r]^{\rho_1(g)} \ar[d]_{\phi} &
  V_1 \ar[r]^{\rho_1(g')} \ar[d]^{\phi} &
  V_1 \ar[d]^{\phi} \\
  V_2 \ar[r]_{\rho_2(g)} \ar@2{S->S}[ur]^{\phi(g)} &
  V_2 \ar[r]_{\rho_2(g')} \ar@2{S->S}[ur]^{\phi(g')} &
  V_2
}
\end{gathered}
=
\begin{gathered}
\xymatrix@C+3em@R+3em{
  V_1 \ar[r]^{\rho_1(g'g)} \ar[d]_{\phi} &
  V_1 \ar[d]^{\phi} \\
  V_2 \ar[r]_{\rho_2(g'g)} \ar@2{S->S}[ur]^{\phi(g'g)} &
  V_2
}
\end{gathered}
\]
\end{document}

enter image description here

4
  • Thanks. Could you perhaps explain how to use the "compositemap" command
    – Exterior
    Dec 3, 2014 at 21:45
  • @Exterior No, I know nothing about \compositemap and the manual is cryptic as usual. I added a version with shortened center arrows anyway.
    – egreg
    Dec 3, 2014 at 21:52
  • I have a related problem with a similar diagram. Should I make a separate question or edit this one?
    – Exterior
    Dec 4, 2014 at 11:12
  • Don't edit this one
    – egreg
    Dec 4, 2014 at 11:15
4

I know that you specifically asked for a xy-pic solution, however, here's a possibility using the more modern and powerful tikz-cd package:

enter image description here

The code:

% Although you specifically asked for a xy solution, here's a possibility using the more modern and powerfult tikz-cd package:

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

\begin{document}

\begin{tikzcd}[column sep=large,row sep=large]
V_{1}
  \arrow[r,"\rho_{1}(g)"]
  \arrow[d,swap,"\phi"] & 
V_{1}
  \arrow[r,"\rho_{1}(g')"]
  \arrow[d,swap,"\phi"] & 
V_{1} 
  \arrow[d,swap,"\phi"] & 
V_{1} 
  \arrow[r,"\rho_{1}(g'g)"]
  \arrow[d,swap,"\phi"] & 
V_{1} 
  \arrow[d,swap,"\phi"]
\\ 
V_{2}
  \arrow[r,swap,"\rho_{2}(g)"]
  \arrow[ur,Rightarrow,"\phi(g)"] & 
V_{2}
  \arrow[r,swap,"\rho_{2}(g')"]
  \arrow[ur,Rightarrow,"\phi(g')"] & 
V_{2} 
  \arrow[ur, phantom, "{=}", midway] & 
V_{2} 
  \arrow[r,swap,"\rho_{2}(g'g)"]
  \arrow[ur,Rightarrow,"\phi(g'g)"] & 
V_{2}
\end{tikzcd}

\end{document}
1
  • Thanks a lot! I'll wait for a bit to see if someone provides an answer using xypic. If nothing appears, I'll accept this one.
    – Exterior
    Dec 3, 2014 at 19:09
0

This is how I would do it, and its different from the other examples:

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

\begin{document}
\[
\vcenter{\hbox{
\xymatrix@!0@=20mm{
V_1\ar[r]^{\rho_1(g)}\ar[d]_{\phi}\xtwocell[rd]{}<>{^\phi(g)\quad}&
V_1\ar[r]^{\rho_1(g')}\ar[d]_{\phi}\xtwocell[rd]{}<>{^\phi(g')\quad\ }&
V_1\ar[d]^{\phi}\\
V_2\ar[r]_{\rho_2(g)}&
V_2\ar[r]_{\rho_2(g')}&
V_2
}
}}
=
\vcenter{\hbox{
\xymatrix@!0@=20mm{
V_1\ar[r]^{\rho_1(g'g)}\ar[d]_{\phi}\xtwocell[rd]{}<>{^\phi(g'g)\qquad}&
V_1\ar[d]^{\phi}\\
V_2\ar[r]_{\rho_2(g'g)}&
V_2
}
}}
\]
\end{document}

You can also write \drtwocell<\omit>{^\phi(g)\quad} instead of \xtwocell[rd]{}<>{^\phi(g)\quad} but the advantage of the second one is that it can take any direction, and the first although its is simpler you have only \··twocell. As for reversing the arrows in a two cell the ^ symbol in there does the job. The white space \quad is the workaround of adjusting the label position that otherwise would overlap with the 2-cell. And the \vcenter{\hbox{...}} changes the origin of the xymatrix to be the center of the box.

You must log in to answer this question.

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