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}