\documentclass{article}
\usepackage{amsmath,booktabs}
\begin{document}
[
\implies
\mathbf{B}^c=
\begin{bmatrix}
\begin{array}{@{}ccc|ccc|c@{}}
\mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I} & \mathbf{0} & \mathbf{0} & \mathbf{0} \
\mathbf{0} & \mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I} & \mathbf{0} & \mathbf{0}\
\mathbf{0} & \mathbf{0} & \mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I} & \mathbf{0}\
\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I}\
\end{array}
\end{bmatrix}
]
\end{document}
- 65,388
- 35
-
It would be helpful if you could put your MWE into once block that can be easily copy&pasted. – Matthias Arras Oct 06 '20 at 15:01
-
1no, that link does not help – user224189 Oct 06 '20 at 15:59
-
@user224189 -- Can you say specifically why that link doesn't help/ – barbara beeton Oct 07 '20 at 18:43
2 Answers
With {pNiceArray} of nicematrix:
\documentclass{article}
\usepackage{amsmath,booktabs}
\usepackage{nicematrix}
\begin{document}
[
\mathbf{B}^c=
\begin{bNiceArray}{ccc|ccc|c}[first-row]
\mathbf{u}_c^{\mathbf{N}} & \mathbf{u}_e^{\mathbf{N}} & \mathbf{u}_o^{\mathbf{N}}
& \mathbf{u}_c^{\mathbf{R}}&\mathbf{u}_e^{\mathbf{R}} & \mathbf{u}_o^{\mathbf{R}}
& \mathbf{u}_c^{\mathbf{OV}} \
\mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I} & \mathbf{0} & \mathbf{0} & \mathbf{0} \
\mathbf{0} & \mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I} & \mathbf{0} & \mathbf{0}\
\mathbf{0} & \mathbf{0} & \mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I} & \mathbf{0}\
\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{-I} & \mathbf{0} & \mathbf{0} & \mathbf{I}\
\end{bNiceArray}
]
\end{document}
- 40,250
Package blkarray can be your friend. An anexmple of it use (stolen from blkarray):
\documentclass{article}
\usepackage{blkarray}
\begin{document}
\[
\begin{blockarray}{ccccc}
& A & B & C & D\\
\begin{block}{c[cccc]}
A & 1 & 1 & 1 & 1\\
B & 1 & 0 & 0 & 1\\
C & 1 & 0 & 1 & 1\\
D & 1 & 1 & 1 & 0\\
\end{block}
\end{blockarray}
\]
\end{document}
You only need to replace cells' contents with your data and add missed columns in matrix.
- 296,517


