[Tex/LaTex] Centering xymatrix in equation environment

equationsmatricesvertical alignment

The xymatrix diagram does not seem to vertically align when grouped in an equation environment. For example, this code produces the following image (which seems to place the xymatrix 2.5em lower than it should be). How can I remedy this without using \raisebox{2.5em}?

\[\boxed{
\begin{array}{ccc}
A & B & C \\
A & B & C \\
A & B & C \\
A & B & C \\
A & B & C \\
\end{array}
}
\quad 
\boxed{
\begin{array}{ccc}
A & B & C \\
A & B & C \\
A & B & C \\
A & B & C \\
A & B & C \\
\end{array}
}
\qquad\boxed{
\xymatrix@-1pc{
A & B & C \\
A & B & C \\
A & B & C \\
}}
\]

Example diagram

Best Answer

Use \vcenter to vertically center within math mode. For some strange reason is seems to require (at least sometimes) an inner \vbox. As in:

\documentclass{article}
\usepackage[all]{xy}
\begin{document}
 \begin{equation}
  x\,
   \vcenter{\vbox{
   \xymatrix@-1pc{
   A & B & C \\
   A & B & C \\
   A & B & C \\
   }
   }}
 \end{equation}
\end{document}

As an aside, your example doesn't compile for me because I don't know where the \boxed command is from. You should give a complete LaTeX (or TeX) file in your questions.

Related Question