# matrix brace extend

How to extend the braces

Any hint would be appreciated.

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath

\newcommand\undermat[2]{% http://tex.stackexchange.com/a/102468/5764
\makebox[0pt][l]{$\smash{\underbrace{\phantom{% \begin{matrix}#2\end{matrix}}}_{\text{$#1$}}}$}#2}

\begin{document}

$\left( \begin{array}{rrr|rrr} 1& 0 & 0& -11& 6& -4\\ 0&1 &0 & 6& -3& 2\\ \undermat{I}{0 & 0 & 1} & \undermat{A^{-1}}{-4 & 2 &-1 }\\ \end{array} \right )$

\end{document}

• Could you be a bit more specific? You mention brackets and braces, and they are different things. – Werner Jun 14 '17 at 19:21
• You have braces to the left and below, do you want to extend one of those? Or the brackets around the matrix? – Huang_d Jun 14 '17 at 19:22

You can artificially make the last row as wide as needed, by adding a phantom digit in columns one and two.

I'd also reduce the space between the fences and the entries and add a phantom to I in order to vertically align the subscripts.

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath

\newcommand\undermat[2]{% http://tex.stackexchange.com/a/102468/5764
\makebox[0pt][l]{$\smash{\underbrace{\phantom{% \begin{matrix}#2\end{matrix}}}_{\text{$#1$}}}$}#2}

\begin{document}

$\left( \begin{array}{@{\,}rrr|rrr@{\,}} 1& 0 & 0& -11& 6& -4\\ 0&1 &0 & 6& -3& 2\\ \undermat{I\vphantom{A^{-1}}}{0 & 0 & 1} & \undermat{A^{-1}}{\hphantom{0}{-4} & {\hphantom{-}}{2} & -1 }\\ \end{array} \right )$

\end{document}


Added two \phantoms to the final \undermat, to make that row the same width as the prior rows of the matrix. Also, I had to group {-4}, so that the minus was not made binary by the \phantom.

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath

\newcommand\undermat[2]{% http://tex.stackexchange.com/a/102468/5764
\makebox[0pt][l]{$\smash{\underbrace{\phantom{% \begin{matrix}#2\end{matrix}}}_{\text{$#1$}}}$}#2}

\begin{document}

$\begin{array}{r@{}} \text{Nodes}~\left\{\begin{array}{@{}c@{}}\null\\\null\\\null\end{array}\right. \end{array} \left( \begin{array}{rrr|rrr} 1& 0 & 0& -11& 6& -4\\ 0&1 &0 & 6& -3& 2\\ \undermat{I}{0 & 0 & 1} & \undermat{A^{-1}}{\phantom{1}{-4} & \phantom{-}2 &-1 }\\ \end{array} \right )$

\end{document}