# Matrix inside a matrix with aligning rows

How is it possible to make such a construction in LaTeX?

It's simple with blkarray:

\documentclass[12pt]{report}
\usepackage{blkarray}
\usepackage{amsmath}
\renewcommand{\arraystretch}{1.4}
\begin{document}
$\begin{blockarray}{rrccc} & von: & N & K & E \\ \begin{block}{rr(ccc)} N & & 0 & 0 & 0,4 \\ nach: K & A= & 0,75 & 0 & 0 \\ E & & 0 & 0,8 & 0,8 \\ \end{block} \end{blockarray}$
\end{document}


• Thank you very much! That is exactly what I was looking for. Feb 18, 2017 at 10:04

With {NiceArray} of nicematrix.

\documentclass[12pt]{report}
\usepackage{nicematrix}

\begin{document}

\renewcommand{\arraystretch}{1.4}
$\begin{NiceArray}{rrccc} & \text{von:\enskip} & N & K & E \\ N & & 0 & 0 & 0.4 \\ \text{nach:\enskip} K & A= & 0.75 & 0 & 0 \\ E & & 0 & 0.8 & 0.8 \\ \CodeAfter \SubMatrix({2-3}{4-5}) \end{NiceArray}$

\end{document}