[Tex/LaTex] draw diagrams with \xymatrix

matricesxy-pic

I'm using \xymatrix to draw a diagram and I need some of the arrows to be
named with a matrix over it. To draw the matrices over arrows, I'm using the \arrow command but, unfortunately, it puts very large matrices and collapses the diagram. The usual size-changing commands, such as \scriptstyle…, do not work.
could somebody give a hint? Thanks in advance.

Best Answer

The smallmatrix environments are the right thing to use here, since they by default are small enough to fit into a line of text. You can use \begin{smallmatrix}...\end{smallmatrix} in place of \begin{matrix}...\end{matrix} to get something that's small enough.

Then, if you use the mathtools package, you can add delimiters: psmallmatrix is like pmatrix (a matrix delimited by parentheses, but smaller), bsmallmatrix uses brackets like bmatrix, and so on.

Here's how this looks with arrows in a commutative diagram:

\documentclass{article}
\usepackage{mathtools}
\usepackage[all]{xy}
\begin{document}
\[\xymatrix{
A \ar[r]^{\begin{psmallmatrix}1 & 0\\0 & 1\end{psmallmatrix}}
  \ar[d]_{\begin{psmallmatrix}1 & -1\\-1 & 1\end{psmallmatrix}}
& B\ar[d]^{\begin{psmallmatrix}c & 0\\d & e\end{psmallmatrix}} \\
C\ar[r]_{\begin{bsmallmatrix}a & 0\\0 & b\end{bsmallmatrix}} & D
}\]
\end{document}

enter image description here