Горизонтальные длины клина внутри blkarray

Горизонтальные длины клина внутри blkarray

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

где две \clines можно увидеть пересекающимися с фигурными скобками. Какой лучший способ их обрезать? Команда \cmidrulefrom 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} 

введите описание изображения здесь

Связанный контент