3

Why is the following code not compiling?

\[
    \xymatrix{
       A \ar[rd]^{g \circ f} \ar[r]^f & B \ar[d]^g\\
       C}
\]

I'm trying to get a commutative diagram with 3 objects (A, B and C) and 3 arrows (f, g and g ∘ f).

  • 4
    Welcome to TeX.SX! There's a missing & before the C: just think to a matrix, for the diagram nodes. I'd use _{g\circ f} so that the label goes under the diagonal arrow. – egreg Jun 6 '12 at 17:22
6

You're missing an & in the second row

\documentclass{article}
\usepackage[all,cmtip]{xy}
\begin{document}
\[
\xymatrix{
  A \ar[rd]_{g \circ f} \ar[r]^f & B \ar[d]^g\\
  & C}
\]
\end{document}

It's probably better to put the g\circ f label under the arrow.

enter image description here

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.