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:
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.