
パッケージを使用した次の 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}
ここで、2 つの\cline
s が中括弧と交差しているのがわかります。これらをトリミングする最適な方法は何ですか? コマンド\cmidrule
はbooktabs
ほぼこれを実行しますが、2 本の垂直線との相互作用が悪くなります。
また、同等のものと比較すると、bmatrix
中括弧が通常よりもマトリックスの要素にいくらか近いように見えます。
答え1
\aboverulesep
booktabs ルールの padding をローカルに削除すると、垂直線との相互作用は発生しません。これは、 (default:0.605mm
または0.4ex
) および\belowrulesep{<width>}
(default:0.984mm
または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}