答案1
这个解决方案需要两个步骤:(1)两个矩阵的构造和(2)矩阵的布局和线条的绘制。
第一步我使用了包nicematrix
。第二步使用了tikzpicture
。
为了方便起见,我使用数组定义了两个命令,以便能够在不干扰 tikz 布局的情况下更改它们。
\documentclass[12pt,a4paper]{article}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\newcommand{\matrixA}{%
$\begin{bNiceMatrix}
a_{11}^{1} &a_{12}^{1} & \Cdots &a_{1m}^{1}\\
\Vdots &\Ddots & & \\
& & &\\
a_{nm}^{1} & & & a_{nm}^{1}\\
\end{bNiceMatrix}$
}
\newcommand{\matrixB}{%
$\begin{bNiceMatrix}
a_{11}^{m} &a_{12}^{m} & \Cdots &a_{1m}^{m}\\
\Vdots &\Ddots & & \\
& & &\\
a_{nm}^{m} & & & a_{nm}^{m}\\
\end{bNiceMatrix}$
}
\begin{tikzpicture}
\node[inner sep=0pt] (matA) {\matrixA};
\node[inner sep=0pt, above right = 10pt and 10pt of matA, scale=0.8] (matB) {\matrixB};
\node[left= 0pt of matA] {$A=$};
\draw[blue,shorten >=3mm, shorten <=4mm, dotted] (matA.north west)-- (matB.north west);
\draw[blue,shorten >=3mm, shorten <=2mm, dotted] (matA.north east)-- (matB.north east);
\draw[blue,shorten >=3mm, shorten <=2mm, dotted] (matA.south east)-- (matB.south east);
\end{tikzpicture}
\end{document}