TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

Suppose I have the following TeX code for a diagram using xymatrix:

C\ar[r] & D &\\
B\ar[u] &   & \\
A\ar[u] &   &}

This creates a diagram with the equation label lining up with the first row, so it looks something like "C -> D (1)". How do I get it to line up with the B so that the equation label is aligned with the vertical center of the diagram?

share|improve this question
up vote 5 down vote accepted

The simplest trick for having an \xymatrix centered with respect to the equation number is to enclose it into a gathered environment.

C\ar[r] & D &\\
B\ar[u] &   & \\
A\ar[u] &   &}

Don't use align for single equations (or, in general, single objects): the spacing comes out wrong.

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.