
Рассмотрим следующую 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
или 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}