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?

4
  • overbrace ist your friend, I think.
    – TiMauzi
    Apr 1, 2022 at 10:56
  • @TiMauzi I couldn't bring it to put brace over different columns of matrices.
    – Atom
    Apr 1, 2022 at 10:58
  • @Atom How about you just put the overbrace on top of the topmost row's values in your matrix? Meaning, you just put the overbrace IN the array, as well.
    – TiMauzi
    Apr 1, 2022 at 11:05

2 Answers 2

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}
1
  • Wow, that seems to be one impressively thoughtful package. The more you know...
    – TiMauzi
    Apr 1, 2022 at 23:37
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.

3
  • That's a nice possibility!
    – Atom
    Apr 1, 2022 at 12:18
  • @Atom If you prefer all the \overbraces to have the same height, just put them in an own row of your array and leave the braces empty.
    – TiMauzi
    Apr 1, 2022 at 13:33
  • 1
    Somewhat related: tex.stackexchange.com/questions/59517/… Apr 1, 2022 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .