1

I used the cmtip option in xypic, but this doesn't change the tips of the \xtwocells, and I have a lot of 2-cells. I am using cmtip because I want the tips in the diagrams to match the ones of the in-line arrows $A\to B$. It seems that the cmtip option is not compatible with the 2cell option. So how to change the tips of the 2-cells?

If this leads to also put any symbol (which can be oriented properly) in the place of the 2-cell. I would also like to know about that.

Here is a simple example. A square with a cell inside.

\documentclass{article}% 
\usepackage[all,2cell,cmtip]{xy}
\UseAllTwocells
\begin{document}
\[
\vcenter{\hbox{\xymatrix@!0@=15mm{
tl\ar[r]^-{t}\ar[d]_-{l}\xtwocell[rd]{}<>{2}&tr\ar[d]^-{r}\\
bl\ar[r]_-{b}&br
}}}
\]
\end{document}

lax square

2 Answers 2

1
\documentclass[12pt,a4paper]{article}

\usepackage{amssymb,amsmath}

\usepackage[all,cmtip]{xy}

\begin{document}

$$\xymatrix{
tl\ar[r]^t \ar[d]_l &tr\ar[d]^r\ar@{=>}[ld]^2\\
bl\ar[r]_b &br
}$$

\end{document}
3
  • Avoid using $$ in LaTeX, \[....\] is better.
    – CarLaTeX
    Commented Feb 7, 2017 at 7:09
  • 1
    See Why is \[\] preferable to $$?
    – Werner
    Commented Feb 7, 2017 at 7:24
  • Thanks for your answer, but unfortunately if I compile it as you wrote, it doesn't change the tip of the 2-cell. From your code I was not expecting this behaviour. Also, the 2cell is way too long, I prefer the shorter one as in the example I gave. Commented Feb 7, 2017 at 9:35
0

Is a solution with tikz-cd Ok for you?

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

\begin{document} 
    \[
    \begin{tikzcd}
        tl\ar{r}{t} \ar{d}[swap]{l} &tr \arrow[Rightarrow]{ld}{2}\arrow{d}{r} \\
        bl\ar{r}[swap]{b} &br
    \end{tikzcd}
    \] 
\end{document}

enter image description here

3
  • Not really, I have a long document with many many diagrams that include 2cells, some of them quite complicated. But thanks. Commented Jan 22, 2017 at 11:16
  • @RamónAbudAlcalá Sorry, I can't help you with xymatrix. Perhaps if you add to your question one of your complex diagram someone else can understand better your problem and solve it.
    – CarLaTeX
    Commented Jan 22, 2017 at 11:45
  • 1
    well the question is not about any particular diagram, is about the possibility to change the tips of the 2-cells of xy-pic. So that my document has a uniform look. Commented Jan 22, 2017 at 11:48

You must log in to answer this question.

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