不知道是不是这样子!还有MWE为啥下载不了?
`
\documentclass[UTF8]{ctexart}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\[\begin{pNiceArray}{>{\strut}ccccc}%
[create-extra-nodes,margin, % extra-margin=1pt,
code-after={\tikz\draw[dashed,name suffix=-large,blend mode=multiply]
($(1-1.north west)+(3pt,0pt)$)
|- (2-2.north west)
|- (3-3.north west)
|- (4-4.north west)
|- ($(4-5.south east)-(3pt,0pt)$);}]
1 & -1 & 2 & 2 & 1 \\
0 & 1 & -1 & -1 & 1 \\
0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 & 3 \\
0 & 0 & 0 & 0 & 0
\end{pNiceArray}\]
\end{document}
`
documentclass{article}
usepackage{amsmath}
usepackage{calc}
newlength{aw} %定义元素的宽度
newlength{ah} %定义元素的高度
newlength{ad} %定义元素的深度
newcommand{lu}[1]{%
settowidth{aw}{$#1$} %设置元素的宽度
settoheight{ah}{$#1$} %设置元素的高度
settodepth{ad}{$#1$} %设置元素的深度
rule[-ad-0.2ex]{0.5pt}{2ah}%
rule[-ad-0.2ex]{aw+0.2ex}{0.5pt}%
hspace{-aw}#1%
}
begin{document}
[
begin{pmatrix}
&lu{a_{1j_1}}&hdotsfor{3} \
&&lu{dfrac{int_1^2 f(x)dx}{a_{2j_2}}}&hdotsfor{2}\
&&&ddots&\
&&&&lu{agggggggg_{rj_r}}cdots\
&
end{pmatrix}
]
end{document}
之前试过的一个自适应元素的标记矩阵
好,谢谢你