[Tex/LaTex] Getting block matrices to be the same size

blockmatrices

I want to produce equations with block matrices

\documentclass[a4paper,12pt,titlepage]{article}
\usepackage[fleqn]{amsmath}
\usepackage[pdftex]{graphicx}
\usepackage{blkarray}
\usepackage{mathtools}
\usepackage{multirow}
\newcommand{\rdots}{\hspace{.2ex}\raisebox{1ex}{\rotatebox{-12}{$\ddots$}}}


\begin{document}


\resizebox{0.9\textwidth}{!}{\begin{minipage}{\textwidth}
\begin{align}
 \begin{blockarray}{(cccc|cccc)}
  1 &  & 0 & \cdots & \BAmulticolumn{4}{c}{\multirow{4}{*}{\huge$0$}}\\
   & \rdots &  &  & & & &\\
  0 &  &  1 &  & & & &\\
  \vdots &  &  & \rdots & & & &\\
  \cline{1-8}
& & &  & 1 &  &  & \cdots \\
\BAmulticolumn{4}{c|}{\multirow{4}{*}{\huge$0$}} & & \rdots  &  \\
& & & & 0 &  & 1 &  \\
& & & & \vdots &  &  &\rdots \\
 \end{blockarray}+
 \begin{blockarray}{(cccc|cccc)}
  \BAmulticolumn{4}{c|}{\multirow{4}{*}{\huge$0$}} &  \BAmulticolumn{4}{c}{\multirow{4}{*}{\huge$S-T$}}  \\
    &     &   &   &    &   &   &   & \\
   &     &   &   &    &   &   &   & \\
     &     &   &   &    &   &   &   & \\
  \cline{1-8}
  \BAmulticolumn{4}{c|}{\multirow{4}{*}{\huge$T-S$}} & \BAmulticolumn{4}{c}{\multirow{4}{*}{\huge$0$}}   \\
   &     &   &   &    &   &   &   & \\
   &     &   &   &    &   &   &   & \\
   &     &   &   &    &   &   &   & \\
 \end{blockarray}
\end{align}
\end{minipage}}

\end{document}

My code produces the correct matrices, but they are not the same size:
enter image description here

the one on the lefthand size (with the S-T) is smaller! I don't get why, can anyone help?

Best Answer

Here's a slightly simpler approach, omitting the unsightly internal rules in the matrices, and using a scalebox to shrink the identity matrix instead of trying to grow the other parts. The other trick used here is to insert an invisible vertical rule to control the spacing.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\newcommand{\IM}{\scalebox{0.7}{\(\begin{matrix}1&0&\cdots\\0&1\\\vdots&&\ddots\end{matrix}\)}}
\newcommand{\BigO}{\vrule width 0pt height 17pt depth 15pt 0}
\[
    \left( \begin{matrix} \IM & \BigO \\ \BigO & \IM \end{matrix} \right)
    +
    \left( \begin{matrix} \BigO & S-T \\ T-S & \BigO \end{matrix} \right)
\]
\end{document}

enter image description here