\documentclass{article}
\usepackage{amsmath}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\begin{document}
\begin{equation}
\begin{bmatrix}[cc|c|c]
0 & -I & I & 0\\
0 & 0 & -I & I \\
\end{bmatrix}
\end{equation}
\end{document}
答案1
您无法仅使用 来获取这些矩阵bmatrix
,而需要使用较低级别的array
:
\documentclass{article}
\usepackage{amsmath,booktabs}
\begin{document}
\[
\mathbf{L}=
\begin{bmatrix}
\begin{array}{@{}cc@{}}
\mathbf{I} & \mathbf{0} \\
\mathbf{0} & \mathbf{I} \\
\midrule[\arrayrulewidth]
\mathbf{0} & \mathbf{I} \\
\midrule[\arrayrulewidth]
\mathbf{0} & \mathbf{I}
\end{array}
\end{bmatrix}
\implies
\mathbf{L}^+=
\begin{bmatrix}
\begin{array}{@{}cc|c|c@{}}
\mathbf{I} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\
\mathbf{0} & \mathbf{I} & \mathbf{0} & \mathbf{0}
\end{array}
\end{bmatrix}
\]
\end{document}