# LaTeX - problems with xy-pic

1. May 29, 2012

### Aikon

Hi,

I am trying to show the reader what is the main diagonal of a matrix, so i wrote the code using the xy-pic package, this is the code:
Code (Text):

\begin{displaymath}
\left(
\xymatrix @=0.5pc
{
a \ar@{-}[dr] & b\\
c & d\\
}
\right)
\end{displaymath}

In the compiled file the parenthesis are taller than the matrix, and i couldn't found a solution, so i am asking help!

Thanks,

2. Jun 24, 2012

### Stefan_K

Hi Aikon,

the problem here is the baseline of the matrix, which is not at the center. You can fix that by \vcenter:

Code (Text):
\begin{displaymath}
\left(\vcenter{
\xymatrix @=0.5pc
{
a \ar@{-}[dr] & b\\
c & d\\
}}
\right)
\end{displaymath}

On LaTeX-Community.org, it has been made similarly here: Parentheses around a sigma sum with huge subscript. There just an additional \hbox has been used within \vcenter, which an be a good idea in some cases.

Stefan