Just refer the manual in texdoc nicematrix and a little bit in texdoc tikz:
\documentclass{article}
\usepackage{fourier}
\usepackage{nicematrix,tikz}
\usepackage{lipsum}
\usetikzlibrary{arrows.meta}
\begin{document}
\lipsum[2][1-3]
\[
\renewcommand{\arraystretch}{1.5}%
\begin{pNiceArray}{ccc;ccc}[margin] % new feature `;' in nicematrix v7.7
\CodeBefore%
\tikz{%
\draw[-Stealth] ([xshift=-1cm,yshift=.05cm]1.5|-2) node[above] {$(-2)$} |- ([xshift=-.5cm]1.5|-2.5);
\draw[-Stealth] ([xshift=-1.75cm,yshift=.05cm]1.5|-2) node[above] {$(-1)$} |- ([xshift=-.5cm]1.5|-3.5);
}
\Body
1 & 2 & 3 & 1 & 0 & 0 \\
2 & 1 & 2 & 0 & 1 & 0 \\
3 & 2 & 1 & 0 & 0 & 1 \\
\end{pNiceArray}
\]
\lipsum[2][1-3]
\end{document}
如图,

代码如下,
\documentclass{article}
\usepackage{amsmath, tikz, nicematrix, arydshln}
\usetikzlibrary{tikzmark}
\tikzset{> = latex}
\begin{document}
\[
\renewcommand{\arraystretch}{1.5}
\begin{pNiceArray}{ccc|[tikz = dashed]ccc}
1 & 2 & 3 & 1 & 0 & 0\\
\tikzmarknode{row2}{2} & 1 & 2 & 0 & 1 & 0\\
\tikzmarknode{row3}{2} & 3 & 4 & 0 & 0 & 1
\CodeAfter
\tikz{%
\draw [<-] ([xshift = -1em]row2.west) --++ (-.5,0) --++ (0,.5)
coordinate (row2destination)
node [above] {$(-2)$};
\draw [<-] ([xshift = -1em]row3.west) --++ (-1.5,0) -|
([xshift = -1cm]row2destination)
node [above] {$(-1)$};
}
\end{pNiceArray}
\to
\]
\end{document}给个用tikz的笨办法
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\[
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,
nodes={minimum width=6.5mm, minimum height=6.5mm, anchor=center},
left delimiter=(,
right delimiter=)
]{
1 & 2 & 3 & 1 & 0 & 0 \\
2 & 1 & 2 & 0 & 1 & 0 \\
1 & 3 & 4 & 0 & 0 & 1 \\
};
\draw[dashed]
([shift={(0,0.4)}]m-1-3.east) -- ([shift={(0,-0.45)}]m-3-3.east);
\node[inner sep =1pt](a) at([shift={(-2.1,0)}]m-1-1){$(-1)$};
\node[inner sep =1pt](b) at([shift={(-1.3,0)}]m-1-1){$(-2)$};
\draw[-latex,line width=0.4pt] (a)|-(-2.4,-0.65);
\draw[-latex,line width=0.4pt] (b)|-(-2.4,0);
\node at (2.8,0){$\longrightarrow$};
\end{tikzpicture}
\]
\end{document}
IMHO, coordinate like
([xshift=-1cm,yshift=.05cm]1.5|-2)is not accurate, u can use thetikzmarklib.@u79794 Yes, I know, but wht OP was after is more lower
-2and-1?I just tweaked the position by
([xshift=-1cm,yshift=.05cm]1.5|-2), for the sake of this is a specific requirement in this specific matrix, I think that is okay for me...I have thought of something like
first-col, but not so proper here seemly...Yes,
tikzmarkis another approach, imho. But with better built-in cell support, maybe you can also refercreate-medium-nodesin the manual? but... that is also not good in this case for some negetive node indexes like(-2)-1.....