答案1
这是使用该包对矩阵的相当忠实的再现nicematrix
。
实线是使用该包\CodeAfter
在单元格中创建的节点之间插入 tikz 命令(带有)的功能绘制的。
需要编译两次。
\documentclass[12pt,a4paper]{article}
\usepackage{tikz} % needed <<<<<<<
\usepackage{nicematrix} % needed <<<<<<<
\begin{document}
\setcounter{MaxMatrixCols}{20}
\[\tilde{A'} = \begin{pNiceMatrix}[first-row, cell-space-limits=5pt]
& & &j_{1} & & & &j_{2} & &\cdots & &j_{r-1}& &\cdots & &j_{r} & & & &\\
0 &- &0 &1 &* &\Cdots &* &0 &* &\Cdots &* &0 &* &\Cdots &* &0 &* &\Cdots &* &b'_{1} \\
& & & & & & & & & &\Vdots &\Vdots &\Vdots & &\Vdots &\Vdots &\Vdots & &\Vdots & \\[-10pt]
& &0 & & & &0 &1 &* & & & & & & & & & & &b'_{2} \\
& & & & & & & & & & & & & & & & & & & \\[-10pt]
& & & & & &0 & & & & & & & & & & & & &b'_{3} \\
& & & & & & & & & &* &0 & & & & & & & &\Vdots \\
& & & & & & & & & &0 &1 &* &\Cdots &* &0 & & & &b'_{r-1}\\
& & & & & & & & & & & & & & & & & & & \\[-10pt]
& & & & & & & & & &0 & & & &0 &1 &* &\Cdots &* &b'_{r} \\
& & & & & & & & & & & & & & & & & & & \\[-10pt]
& & & & & & & & & & & & & &0 & & & &0 &b'_{r+1}\\
& & & & & & & & & & & & & & & & & & &\Vdots \\
0 & & & & & & & & & & & & & & & & & &0 &b'_{n} \\
\CodeAfter
\tikz \draw (2-|1.5) -- (13-|1.5);
\tikz \draw (3-|4) -- (3-|7);
\tikz \draw (5-|8) -- (5-|9);
\tikz \draw (7.5-|10) -- (7.5-|11);
\tikz \draw (9-|12) -- (9-|15);
\tikz \draw (11-|16) -- (11-|19);
\tikz \draw (13.5-|2) -- (13.5-|19);
\tikz \draw (2-|3.5) -- (2.5-|3.5);
\tikz \draw (4-|7.5) -- (4.5-|7.5);
\tikz \draw (8-|11.5) -- (8.5-|11.5);
\tikz \draw (10-|15.5) -- (10.5-|15.5);
\tikz \draw (12-|19.5) -- (13-|19.5);
\end{pNiceMatrix}\]
\end{document}
答案2
这是另一个解决方案nicematrix
。
\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usepackage{nicematrix}
\begin{document}
\setcounter{MaxMatrixCols}{20}
\[
\renewcommand{\arraystretch}{1.4}
\widetilde{A'}=
\begin{pNiceMatrix}[nullify-dots,first-row]
& &j_1& & & &j_2& &\cdots & &j_{r-1}& &\cdots& &j_r & & & &\\
0&0&1 &*&\Cdots&*&0 &*&\hspace*{1cm}& * &0 &* &\Cdots&* &0 &* &\Cdots&* &b_1' \\
&0& & & &0&1 &*& &\Vdots&\Vdots&\Vdots& &\Vdots&\Vdots&\Vdots& &\Vdots&b_2' \\
& & & & &0& & & & & & & & & & & & &b_3' \\
& & & & & & & & &* &0 & & & & & & & &\Vdots \\
& & & & & & & & &0 &1 &* &\Cdots&* &0 & & & &b_{r-1}' \\
& & & & & & & & &0 & & & &0 &1 &* &\Cdots&* &b_r' \\
& & & & & & & & & & & & &0 & & & &0 &b_{r+1}' \\
& & & & & & & & & & & & & & & & & &\Vdots \\
0& & & & & & & & & & & & & & & & &0 &b_n'
\CodeAfter
\begin{tikzpicture} [shorten < = 1mm, shorten > = 1mm]
\draw (3-6) -- ++(1cm,0) ;
\draw (2-6) -- (3-6) ;
\draw (2-2) -- (2-6) ;
\draw (1-2) -- (2-2) ;
\draw (1-1) -- (1-2) ;
\draw (1-1) -- (last-1) ;
\draw (last-1) -- (last-18) ;
\draw (last-18) -- (7-18) ;
\draw (7-18) -- (7-14) ;
\draw (7-14) -- (6-14) ;
\draw (6-14) -- (6-10) ;
\draw (6-10) -- (5-10) ;
\draw (5-10) -- ++(-1cm,0) ;
%
\draw [dashed] (1-8) -- (1-10) ;
\end{tikzpicture}
\end{pNiceMatrix}
\]
\end{document}
与往常一样nicematrix
,您需要进行多次编译。