TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why is the following code not compiling?

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

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

share|improve this question
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

You're missing an & in the second row

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

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

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.