
考慮使用該套件的以下 MWE blkarray
:
\documentclass[11pt]{article}
\usepackage{lmodern}
\usepackage{blkarray}
\begin{document}
\[
\begin{blockarray}{[ccc|ccc|cc]c}
\mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} \\
\mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\
& \mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\ \cline{1-8}
& & & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} & p \\
& & & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\
& & & & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\\cline{1-8}
& & & & &
& \mathsf{x} & \mathsf{x} & q \\
& & & & &
& & \mathsf{x} \\
\end{blockarray}
\]
\end{document}
可以看到兩個\cline
s 與大括號相交。修剪這些的最佳方法是什麼?\cmidrule
from 的命令大致booktabs
執行此操作,但與兩條垂直線有負向交互作用。
另外,與等效的相比,bmatrix
在我看來,大括號比平常更接近矩陣的元素。
答案1
如果您在本機上刪除 booktabs 規則的填充,則不會與垂直線發生交互,這取決於\aboverulesep
(default: 0.605mm
or 0.4ex
) 和\belowrulesep{<width>}
(default: 0.984mm
or 0.65ex
) 的值:
\documentclass[11pt]{article}
\usepackage{lmodern}
\usepackage{blkarray, bigstrut}
\usepackage{booktabs}
\begin{document}
\[ \setlength\aboverulesep{0pt}\setlength\belowrulesep{0pt}
\setlength\cmidrulewidth{0.5pt}
\begin{blockarray}{[ccc|ccc|cc]c}
\bigstrut[t]\mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} \\
\mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\
& \mathsf{x} & \mathsf{x} & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\
\cmidrule(lr){1-8}
& & & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} & p \\
& & & \mathsf{x} & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\
& & & & \mathsf{x} &
\mathsf{x} & \mathsf{x} & \mathsf{x} \\%\cline{1-8}
\cmidrule(lr){1-8} & & & & && \mathsf{x} & \mathsf{x} & q \\
& & & & & & & \mathsf{x}\bigstrut[b] \\
\end{blockarray}
\]
\end{document}