答案1
nicematrix
这是和的可能性tikz
。
\documentclass{article}
\usepackage{nicematrix, tikz}
\begin{document}
\[
\NiceMatrixOptions{cell-space-limits = 2pt}
\begin{pNiceMatrix}[first-col]
\color{red}\Delta_1 & \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1^2}\\
\color{green}\Delta_2 & \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1^2}\\
\color{blue}\Delta_3 & \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1^2}
\CodeAfter
\tikz{
\draw[red, shorten >=-3mm] (1-|2) -- (2-|2) -- (2-|1);
\draw[green, shorten >=-3mm] (1-|3) -- (3-|3) -- (3-|1);
\draw[blue, shorten >=-3mm] (1-|4) -- (4-|4) -- (4-|1);
}
\end{pNiceMatrix}
\]
\end{document}