用tabularray宏包可以方便实现:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{%
  cells  = {c, m},
  row{1} = {mode = math},
  column{1} = {mode = math},
  hline{2,Z} = {2-Z}{0.15em},
  vline{2,Z} = {2-Z}{0.15em},
  hline{3} = {2-Z}{0.08em},
  vline{Y} = {2-Z}{0.08em},
  }
     &x_1 & x_2 & x_3 & x_4 & x_5 &   \\
 z   & 8  & 9   & 0   & 0   & 0   & 5 \\
 x_3 & 2  & 2   & 1   & 0   & 0   & 1 \\
 x_4 & 3  & -1  & 0   & 1   & 0   & 2 \\
 x_5 & 0  &  3  & 0   & 0   & 1   & 3 \\
\end{tblr}
\end{document}结果:
关于tabularray宏包使用细节,请参阅其使用说明书或tabularray表格排版宏包视频教程。
感谢“寄存器”老师给的回复,但是用到了latex3。无奈我还是工作在老的latex2e里面。
这两天我又查了查,发现了一个blkarray宏包,完美地解决了我的问题,输出的效果
和使用latex3的tabularray是一样的。