# Vertical alignment of array inside array

\left[\begin{array}{c|c|c}
{\left(\begin{array}{cc}
1 & 2 \\
3 & 4
\end{array}\right)} & 5 ;6 & x \\
\left(\begin{array}{cc}
7 & 8 \\
9 & \alpha
\end{array}\right) & \beta ;\gamma & \\
\left(\begin{array}{cc}
\eta & \gamma \\
1 &  2
\end{array}\right) & 3 ;4 &  y
\end{array}\right]


Expected:

• Why would you expect that? x and y are clearly put to the first and third rows, exactly as 5;6 and 3;4. Commented Jun 24 at 13:04
• @SergeiGolovan Of course the question is how to modify the code to achieve the second image. You don't want the OP to just post the image without their attempt, do you? Commented Jun 24 at 15:22

Here is a solution with {bNiceArray} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

$\begin{bNiceArray}{c|c|c}[cell-space-limits=2pt] \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} & 5;6 & \Block{2-1}{x}\\ \begin{pmatrix} 7 & 8 \\ 9 & \alpha \end{pmatrix} & 5;6 & \Block{2-1}{y}\\ \begin{pmatrix} \eta & \gamma \\ 1 & 2 \end{pmatrix} & 3;4 \\ \end{bNiceArray}$

\end{document}


The command \Block provided by nicematrix puts its content in the center of the rectangle of cells involved in the block. Here, there are two blocks which are overlapping.