答案1
欢迎使用 TeX.SX!您可以使用以下nicematrix
软件包:
\documentclass[border=10pt]{standalone}
\usepackage{nicematrix, tikz}
\begin{document}
\(\begin{bNiceArray}[first-row, first-col]{cc}[margin, cell-space-limits = 3.5pt]
& A & B \\
A & \Block[borders={bottom, tikz=densely dashed}]{1-2}{}
\Block[borders={right, tikz=densely dashed}]{2-1}{}
A & B \\
B & C & D \\
\end{bNiceArray}\)
\end{document}
答案2
使用该包nicematrix
,您可以为自定义线条样式(具有 Tikz 定义的特征)定义命令和字母。
\documentclass[border=10pt]{standalone}
\usepackage{nicematrix, tikz}
\begin{document}
\NiceMatrixOptions
{
custom-line =
{
letter = I ,
command = dashedline ,
tikz = densely dashed ,
total-width = \pgflinewidth % optional
}
}
\(\begin{bNiceArray}[first-row, first-col]{cIc}[margin, cell-space-limits = 3.5pt]
& A & B \\
A & A & B \\
\dashedline
B & C & D \\
\end{bNiceArray}\)
\end{document}
您需要多次编译。