How I can make a matrix inside a matrix as shown in this picture?
Indeed, I want to treat every block as a separate matrix. For example, I want to add braces over and under the second matrix by \underbrace{}
or \overbrace{}
commands as you see in the picture below:
Best Answer
This is a TikZ approach.
Step 1
First I found that
fit
library is useful in calculating the bounding box. In the next figure, the brown box does not includebbbbbb_3
because I did not pass(A-2-3)
tofit=
.Step 2
Since the brown box is actually a node, I would like to give that node a special shape: A shape of left parenthesis. The code is basically copy from
tikzlibrarymatrix.code.tex
.Step 2.5
Same task for another shape
Step 3
Remember that everything is node here, so it can be
fit=
hierarchically.Step 4
And then we need to put texts on, so I have to move the
text
anchor to a suitable place. (In fact I redefine it.) Notice that in this case, bounding box calculation ignores our text. (Which is always true. But usually our text lies completely inside the border because we want so.)Result