一个可能的答案是:
\documentclass{article}
\usepackage{amsmath,amssymb,mathrsfs}
\usepackage{nicematrix}
\usepackage{tikz}
\newcommand*{\BB}[1][]{\mathscr{B}^{#1}}
\begin{document}
\[
\begin{NiceMatrix}[create-medium-nodes]
\phantom{0} & \alpha_1 & \alpha_2 & \cdots & \alpha_t & \phantom{0} \\
\phantom{0} & \BB \alpha_1 & \BB \alpha_2 & \cdots & \BB \alpha_t & \phantom{0} \\
\phantom{0} & \BB[2] \alpha_1 & \BB[2] \alpha_2 & \cdots & \BB[2] \alpha_t &\phantom{0} \\
\phantom{0} & \vdots & \vdots & \ddots & \vdots &\phantom{0} \\
\phantom{0} & \BB[k_1-1] \alpha_1 & \BB[k_2-1] \alpha_2 & \cdots & \BB[k_n-1] \alpha_t &\phantom{0} \\
\phantom{0} & \BB[k_1] \alpha_1 & \BB[k_2] \alpha_2 & \cdots & \BB[k_n] \alpha_t & \phantom{0} \\
\CodeAfter
\tikz[name suffix=-medium]{
\draw[cyan,dashed] (1-2.north west) rectangle (5-5.south east);
\draw[magenta!60] (2-1.north west) rectangle (6-6.south east);
}
\end{NiceMatrix}
\]
\end{document}
-------------------------补充回答-------------------------
\documentclass{article}
\usepackage{amsmath,amssymb,mathrsfs}
\usepackage{nicematrix}
\usepackage{tikz}
\newcommand*{\BB}[1][]{\mathscr{B}^{#1}}
\begin{document}
\[
\begin{NiceMatrix}[create-medium-nodes]
\phantom{1} & \alpha_1 & \alpha_2 & \cdots & \alpha_t & \phantom{1} \\
\phantom{1} & \BB \alpha_1 & \BB \alpha_2 & \cdots & \BB \alpha_t & \phantom{1} \\
\phantom{1} & \BB[2] \alpha_1 & \BB[2] \alpha_2 & \cdots & \BB[2] \alpha_t &\phantom{1} \\
\phantom{1} & \vdots & \vdots & \ddots & \vdots &\phantom{1} \\
\phantom{1} & \BB[k_1-1] \alpha_1 & \BB[k_2-1] \alpha_2 & \cdots & \BB[k_n-1] \alpha_t &\phantom{1} \\
\phantom{1} & \BB[k_1] \alpha_1 & \BB[k_2] \alpha_2 & \cdots & \BB[k_n] \alpha_t & \phantom{1} & \alpha_{t+1} & \cdots & \alpha_s \\
\CodeAfter
\tikz[name suffix=-medium]{
\draw[cyan,dashed] (1-2.north west) rectangle (5-5.south east);
\draw[magenta!60] (2-1.north west) rectangle (6-6.south east);
}
\end{NiceMatrix}
\]
\end{document}
问 在latex中,矩阵中怎么画这实线框和虚线框