答案1
您可以使用nicematrix
。此包将在矩阵的每个单元下创建一个节点,然后您可以使用 Tikz 绘制所需的内容。
\documentclass{article}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{fit}
\begin{document}
$\begin{vNiceMatrix}
\strut a & b & c \\
\strut d & e & f \\
\strut g & h & i
\CodeAfter
\begin{tikzpicture}
[inner xsep = 2mm , inner ysep = 0.1mm , outer sep = 3mm]
\node [draw, fit = (1-1) (1-3)] (L1) { } ;
\node [draw, fit = (3-1) (3-3)] (L3) { } ;
\draw [<->] (L1.west) -- (L3.west) ;
\end{tikzpicture}
\end{vNiceMatrix}
= -
\begin{vmatrix}
\strut g & h & i \\
\strut d & e & f \\
\strut a & b & c
\end{vmatrix}
$
\end{document}
答案2
实现这一目标的众多可能方法之一。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning,fit}
\begin{document}
\[\begin{tikzpicture}[mmat/.style={matrix of math nodes,
inner sep=0pt,nodes={inner sep=2pt},column sep=2pt,row sep=2pt,
left delimiter=|,right delimiter=|},node distance=1ex]
\matrix[mmat](mat1){ a & b & c\\
d & e & f \\ g & h & i\\
};
\node[right=of mat1](eq){$=-$};
\matrix[mmat,right=of eq](mat2){ g & h & i\\
d & e & f \\
a & b & c\\
};
\node[fit=(mat1-1-1)(mat1-1-3),draw,inner xsep=2ex,yshift=2pt](F1){};
\node[fit=(mat1-3-1)(mat1-3-3),draw,inner xsep=2ex,inner ysep=1pt,yshift=-2pt](F2){};
\draw[latex-latex] ([xshift=-1em]F1.west) -- ([xshift=-1em]F2.west);
\end{tikzpicture}
\]
\end{document}
答案3
另一种可能性是pstricks
:在标准环境中,将第一行和最后一行的末端定义为节点,并通过节点连接\ncbox
与相关参数连接,vmatrix
然后将左上角和左下角的节点连接起来\ncarc
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{pst-node}
\begin{document}
\[ \begin{vmatrix}
\Rnode{A}{a} & b & \Rnode{C}{c}\\
d & e & f \\
\Rnode{G}{g} & h & \Rnode{I}{i}
\end{vmatrix} =
- \begin{vmatrix}
g & h & i \\
d & e & f \\
a & b & c
\end{vmatrix}
\psset{linewidth=0.4pt, boxsize=1.33ex, nodesep=0.8em, linearc=0.05}
\ncbox{A}{C}
\ncbox{G}{I}
\ncarc[arrows=<->, arrowinset =0.12, offset=1.5em, nodesep=0, arcangle=15]{G}{A}
\]%
\end{document}