I want to make horizontal and vertical curly braces to show up simultaneously just outside a matrix, but it only works when I use one or the other, instead of both.
I use \left.\right\}
for vertical braces, and \underbrace{}_{}
for horizontal ones.
Here's my attempt:
\begin{align*}
\underset{m\times n}{0}=
\underbrace{\left.
\begin{bmatrix}
0 & 0 & \dots & 0\\
0 & 0 & \dots & 0\\
\dots & \dots & \dots & \dots\\
0 & 0 & \dots & 0
\end{bmatrix}
\right\}\text{$m$ rows}}_\text{$n$ columns}
\end{align*}
Obviously, the "n columns" one is too long: I want it to cover from the first element to the last, not all the way to the end of the vertical brace. How can I fix it?