2

I'm trying to recreate example 2 from the xypic reference manual (http://mirrors.ctan.org/macros/generic/diagrams/xypic/doc/xyrefer.pdf p.43 )

\diagram
A\ruppertwocell^f{\alpha}
\rlowertwocell_h{\beta}
\rto_(.35)g & B\\
\enddiagram

enter image description here

I got the first example working in the following manner with inspiration from Natural transformation arrow

\documentclass{article}
\usepackage[all,cmtip,2cell]{xy}
\UseTwocells
\xyoption{2cell}
\begin{document}
$$
\xymatrix@C+2pc{
A \rtwocell<6>^{f}_{g}{\;\;\;\alpha} & B}
$$

\end{document}

But just pasting the second example gives me

! Undefined control sequence.
l.15 \diagram

and changing \diagram to \xymatrix@C+2pc{... as above gives me:

...
(/usr/share/texlive/texmf-dist/tex/generic/xypic/xy2cell.tex
 Xy-pic option: Two-cell feature v.3.7 not reloaded) (./test2cells.aux)
<xymatrix 2x1 20> <xymatrix
! Undefined control sequence.
<argument> ...atall@ \everyentry@ A\ruppertwocell 
                                                  ^f{\alpha } \rlowertwocell...
l.19 \rto_(.35)g & B}
                     $$

What is the proper way to get this to work in xy-pic? Should I really be using the diagrams package?

  • 2
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. A suggestion: Do us a favour and change your username to something more telling than "user1234". – Reinstate Monica - M. Schröder Nov 20 '16 at 20:43
  • Welcome to TeX.SX! Note that the part of the xy manual which you reference includes "Bug: This document still uses version 2-style commmands, as described in appendix B." looking at Appendix B, xyoption{v2} should be used although this only shifts the error. – Dai Bowen Nov 20 '16 at 20:50
2

The documentation says (just above that second diagram: "Bug: This document still uses version 2-style commmands, as described in appendix B."

To use version 2 commands like \diagram, include \xyoption{v2} or give the package option v2. And to use the half cells, use \UseAllTwoCells instead of just \UseTwocells. And please don't use $$ in LaTeX.

\documentclass{article}
\usepackage[all,v2,cmtip,2cell]{xy}
\UseAllTwocells
\begin{document}

\[
\xymatrix@C+2pc{
A \rtwocell<6>^{f}_{g}{\;\;\;\alpha} & B}
\]

\diagram
A\ruppertwocell^f{\alpha}
\rlowertwocell_h{\beta}
\rto_(.35)g & B\\
\enddiagram

\end{document}

Without the v2, the second diagram can be given as

\xymatrix@C+2pc{
A\ruppertwocell^f{\alpha}
\rlowertwocell_h{\beta}
\ar[r]_(.35)g & B}

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.