I'm trying to create an environment for matrices that are divided in four sections, such as the following:
Ideally, I'd like to make it so that it can be used like the following:
M =
\left(
\begin{croosmatrix}
\begin{matrix}
a & b & c & d \\
e & f & g & h \\
i & j & k & l
\end{matrix}
& B \\
C & D \\
\end{crossmatrix}
\right)
I already know how to achieve such result manually, as decribed in Dividing line in a matrix. Something like the following:
M =
\left(
\begin{array}{c|c}
\begin{matrix}
a & b & c & d \\
e & f & g & h \\
i & j & k & l
\end{matrix}
& B \\
\hline
C & D \\
\end{array}
\right)
My question is, how could I make it an environment? In other words, is there a way to programmatically place an \hile
between each like on an array? Is it possible to create an environment for such a thing?
nicematrix
, which supports blocks and lines and much more.