2

I want to typeset something like this:

enter image description here

I couldn't find a way to achieve this using array or blkarray. Any help?

Atom
  • 665

2 Answers2

5

You can do this with the nicematrix package. Note that you must compile twice to get the result.

Note also that \OverBrace is a relatively new addition to nicematrix, so if you're using an old installation you'll have to update.

enter image description here

\documentclass{article}
\usepackage{nicematrix}
\begin{document}

[ m\begin{BNiceArray}{cccc|cc}[right-margin=.4em] 1 & 2 & 3 & 4 & 5 & 6 \ 11 & 12 & 13 & 14 & 15 & 16 \ \CodeAfter \SubMatrix[{1-3}{2-6}] \OverBrace[shorten,yshift=3pt]{1-1}{2-2}{n} \OverBrace[shorten,yshift=3pt]{1-3}{2-4}{r} \OverBrace[shorten,yshift=3pt]{1-5}{2-6}{s} \end{BNiceArray}n ]

\end{document}

Sandy G
  • 42,558
2

Maybe something like this is what you are looking for:

\begin{array}{c}
  & n & & r & & s & \\
  m\,\big\lbrace & \overbrace{A} & \big[ & \overbrace{P} & \big\vert & \overbrace{Q} & \big] & \big\rbrace\,n
\end{array}

enter image description here

I think it could be made prettier (e.g. fixing some space widths and resizing the variables), but I think the overall idea should be clear.

TiMauzi
  • 841