4

I already have this matrix:

\[
    \left[
    \begin{array}{ccc}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1 \\
    \end{array}
    \right]
\]

But I would like to annotate it, i.e. add some description below it (everything in red).. How can I do that please?

enter image description here

2 Answers2

5

mathtools has \underbracket (see here: \overbrace and \underbrace with square bracket).

\documentclass{article}
\usepackage{xcolor}
\usepackage{mathtools}

\begin{document}
\[
    \textcolor{red}{\underbracket{\textcolor{black}{\left[
    \begin{array}{ccc}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1 \\
    \end{array}
    \right]}}_{\text{some text here}}}
\]
\end{document}

enter image description here

CarLaTeX
  • 62,716
5

You have the \underbracket command from mathtools. I simplified your code using the bmatrix environment from amsmath (which is loaded by mathtools):

\documentclass{article}
\usepackage{mathtools} 

\begin{document}

\[
    \underbracket[0.6pt]{\begin{bmatrix}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1 \
    \end{bmatrix}}_\text{some text here}
\]

\end{document} 

enter image description here

Bernard
  • 271,350