I am used to writing block matrices using the array
environment, when these matrices are decomposed in four blocks, controlling vertical spacing and using \hfill
, etc.. Now I wanted to draw a matrix decomposed in nine blocks, but the vertical lines made by the array
environment broke up. How can I fix it without completely changing the approach? (say, I'm not interested in solutions using tikz
, at least for now).
Here's a MWE (done in Overleaf):
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\begin{document}
\[ \left(
\begin{array}{c|c}
\mbox{\large $0$} & \mbox{\large ${\rm Id}_n$} \\[.7ex] \hline \\[-1.5ex]
\mbox{\large $-{\rm Id}_n$} & \mbox{\large $0$}\\
\end{array}
\right) \qquad \left(
\begin{array}{c|c|c}
\mbox{\large $0$} & \mbox{\large $0$} & \mbox{\large $0$} \\[.7ex] \hline \\[-1.5ex]
\mbox{\large $0$} & \mbox{\large $0$} & \mbox{\large ${\rm Id}_n$} \\[.7ex] \hline \\[-1.5ex]
\mbox{\large $0$} & \mbox{\large $-{\rm Id}_n$} & \mbox{\large $0$}\\
\end{array}
\right). \]
\end{document}
Thanks!