# Underbracing matrix

• Welcome to TeX.SE! Please provide your code as text to make it easier to look for solutions. Also: please specify what 'looks OK' is in this case. – Marijn Feb 3 '16 at 12:34
• include the \left(...\right) inside the \underbraceand remove  after \det – percusse Feb 3 '16 at 12:41
• Screen shots can be hard to read so it is much better to cut and paste your code into the gui (and highlight it using the {} button). This way people can read it more easily and they can copy and use it when they try to solve your problem. – Andrew Feb 3 '16 at 12:58

\documentclass{article}
\usepackage{amsmath}

\newcommand{\underbracedmatrix}[2]{%
\left(\;
\smash[b]{\underbrace{
\begin{matrix}#1\end{matrix}
}_{#2}}
\;\right)
\vphantom{\underbrace{\begin{matrix}#1\end{matrix}}_{#2}}
}

\begin{document}
$\Delta_n=\det \underbracedmatrix{ A & B \\ B & A & B \\ & B & \ddots & \ddots \\ & & \ddots & \ddots & B \\ & & & B & A }{n\times n}$
\end{document}


• Thank you! Now I will try to understand that :) My first time using TeX. – Andrii V. Feb 3 '16 at 12:46