I want to typeset something like this:
I couldn't find a way to achieve this using array
or blkarray
. Any help?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityYou 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.
\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}
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}
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.
\overbrace
s to have the same height, just put them in an own row of your array
and leave the braces empty.
overbrace
ist your friend, I think.array
, as well.