给一个比较愚蠢的方法,与 nicematrix 无关,仅仅作为一种方法。用 tikz 的 matrix 库实现
\documentclass[tikz,border=1cm]{standalone}
\usetikzlibrary{matrix,calc}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,
left delimiter=(,
right delimiter=),
inner sep=1pt, column sep=8pt,
row sep=8pt,
]
{
A_{11} & A_{12} & \dots & A_{1s} \\
A_{21} & A_{22} & \dots & A_{2s} \\
\vdots & \vdots & \ddots & \vdots \\
A_{r1} & A_{r2} & \dots & A_{rs} \\
};
\foreach \x/\y in {1/1,2/2,4/s}
{
\node[align=center] at ($(m-1-\x.north)+(0,0.27)$) {\scalebox{0.8}{$n_{\y}$}\\[-1ex]
\scalebox{0.65}{\rotatebox{90}{$\bigg\}$}}
};
}
\foreach \x/\y in {1/1,2/2,4/r}
{
\node[align=center] at ($(m-\x-4)+(1,0)$) {\scalebox{0.9}{$\big\}$}\,\scalebox{0.8}{$m_{\y}$}
};
}
\node at ($(m-1-3.north)+(0.03,0.35)$){$\cdots$};
\node at ($(m-3-4)+(0.85,0)$){$\vdots$};
\end{tikzpicture}
\end{document}
可以看到,一些元素的间距处理比较麻烦而且效果不完美,用 nicematrix 处理更好。
问 如何进一步调整下面nicematrix代码的「行高和行宽」以及「大括号的长度和位置」使其匀称美观?