# Cannot draw diagram

I'm trying to draw a diagram but I get the following error message:

! Xy-pic error: in entry "1,1": No [ld] (is "2,0") from here.

The code is:

\xymatrix{A\times B \ar[ld]_p \ar[rd]_q\\
&A &B}


With the code

\xymatrix{& C \ar@/_/[ld]_f \ar[d]_{(f,g)} \ar@/^/[rd]^g\\
& A\times B \ar[ld]_p \ar[rd]^q\\
A && B}


here's the error I got:

! Xy-pic error: in entry "1,2": No [rd] (is "2,3") from here.

-
If you want a triangle, then add & before the first A; the second row should be A && B. In your code the first arrow wants to go left, but you're in the leftmost column, so the error. This should be thought of as a three column matrix. –  egreg Jun 19 '12 at 14:13
Oh, I see. Why do I need two && on the second row? –  justow Jun 19 '12 at 14:17
I don't really understand the error messages from xypic. They are not really helpful for someone who has just started using the package. –  justow Jun 19 '12 at 14:44
If the bent arrows from C should point to A and B, there should be [ldd] and [rdd]: you want to go down two rows. Wouldn't it be better to add this to the other very similar question? –  egreg Jun 19 '12 at 14:44
Oh, right, forgot that I actually have 3 rows as well. I'm not sure how to move this question to the previous one I posted. Feel free to move it if you want. Thanks egreg! –  justow Jun 19 '12 at 14:50

Let's see the triangle as a two row, three column matrix:

* & A \times B & *

A &      *     & B


where * denotes an empty cell. Now it's easy to complete it with arrows:

\xymatrix{
& A\times B \ar[ld]_{p} \ar[rd]^{q} \\
A && B
}


You may want to reduce the distance between columns with something like

\xymatrix@C-6pt{
& A\times B \ar[ld]_{p} \ar[rd]^{q} \\
A && B
}


For the second diagram you have to go down by two rows from the "C" node:

\xymatrix{& C \ar@/_/[ldd]_f \ar[d]_{(f,g)} \ar@/^/[rdd]^g\\
& A\times B \ar[ld]_p \ar[rd]^q\\
A && B}

-