[Tex/LaTex] Oversized parentheses around xymatrix

xy-pic

This must have been asked somewhere here before, but I cannot seem to find it.

I am using \left( and \right) around an xymatrix, but the parenthesis are far too big;
enter image description here

with the following code;

 \begin{equation*}
            \left(\xymatrix{ A \ar[r] \ar[d]    & B  \ar[d] \\
                      X     \ar[r]_f    &   Y}\right)
        \end{equation*} 

Best Answer

This is caused because the \xymatrix{ } sets the first line of the matrix on the baseline, the lower line goes beyond the baseline resulting in a large depth. The \left and \right macros are always centered on the baseline, and therefore are extended upwards as far the matrix goes down. Use the \vcenter macro to push the matrix up.

\documentclass{article}

\usepackage{amsmath}
\usepackage{xypic}

\begin{document}
\begin{equation*}
    \left(
    \vcenter{\xymatrix{ A \ar[r] \ar[d] & B \ar[d] \\ X \ar[r]_f & Y}}
    \right)
\end{equation*} 
\end{document}
Related Question