I want to typeset a matrix which consists of several submatrices. As they consist of some longer formulae I'd like to assign each a name. I tried to use \underbace
and \overbrace
. However now the braces and the letter appears inside the matrix and I'd like to have it above or below the matrix. What would you suggest here?
\documentclass{article}
\usepackage{amsmath}
\usepackage{xfrac}
\begin{document}
\begin{gather*}
H_{8kl}=
\begin{pmatrix}
\overbrace{\sfrac{1}{2} (A+B)\otimes E + \sfrac{1}{2} (A-B)\otimes G}^{K} &
\overbrace{\sfrac{1}{2} (A+B)\otimes F + \sfrac{1}{2} (A-B)\otimes H}^{L}\\
\underbrace{\sfrac{1}{2} (C+D)\otimes E + \sfrac{1}{2} (C-D)\otimes G}_{M} &
\underbrace{\sfrac{1}{2} (C+D)\otimes F + \sfrac{1}{2} (C-D)\otimes H}_{M}
\end{pmatrix}
\end{gather*}
\end{document}
Best Answer
I
\smash
ed the over and undersets, so that the matrix would not know of them. However, I had to compensate with a leading rule to accound for the vertical space that was smashed (the three4ex
expressions in the\rule
can be changed in size to increase or decrease the gap above/below the expression).Struts had to be added outside the over- and under-sets so as to get the parens to set to the right vertical size and also inside the over- and under-sets to get the braces to stand off from the expression appropriately.