I have a seemingly simple block matrix that I want to set with as few dependencies as possible. I already have amsmath and friends loaded. The only thing I'm intent on avoiding is blkarray.
Here is what I want to make:
Here is a failed attempt of mine, which produces the most heinous spacing imaginable with lines that don't meet to make corners.
\begin{equation}
\begin{pmatrix}[ccc]
J_1 & \begin{array}{|cc}0 & 0\\ 0 & 0\end{array} & \begin{array}{cc}0 & 0\\ 0 & 0\end{array}\\ \cline{1-2}
\begin{array}{cc|}0&0\\0&0\end{array} & J_2 & \begin{array}{|cc}0&0\\0&0\end{array}\\ \cline{2-3}
\begin{array}{cc}0 & 0\\ 0 & 0\end{array} & \begin{array}{cc|}0 & 0\\ 0 & 0\end{array} & J_3
\end{pmatrix}
\end{equation}
Which is ugly as all get-out:
NB: I have modified pmatrix so it takes column specs as an optional argument. Just pretend it is an array.
My difficulty seems to stem from the fact that I want 2x2 blocks, while most others I've seen seem to skate by using either multirow or multicolumn, but not both.
Edit: This isn't nearly as ugly, but the vertical lines only cover half the distance of the multirow:
\begin{equation}
\begin{array}{cccccc}
\multicolumn{2}{c|}{\multirow{2}{*}{$J_1$}} & 0 & 0 & 0 & 0\\
& & 0 & 0 & 0 & 0\\ \cline{1-4}
0 & 0 & \multicolumn{2}{|c|}{\multirow{2}{*}{$J_1$}} & 0 & 0\\
0 & 0 & & & 0 & 0\\ \cline{3-6}
0 & 0 & 0 & 0 & \multicolumn{2}{|c}{\multirow{2}{*}{$J_1$}} \\
0 & 0 & 0 & 0 & & \\
\end{array}
\end{equation}