I have drawn this matrix with tikz but as you can see the boxes are not sqares. How could I fix this? I defined
\usepackage{tikz}
\usetikzlibrary{arrows,matrix,positioning}
\newcommand\bigzero{\makebox(0,0){\text{\huge0}}}
followed by my matrix
\begin{equation}\label{eqn:mat}
\begin{tikzpicture}[baseline=(current bounding box.center)]
\matrix [matrix of math nodes,left delimiter=(,right delimiter=)] (m)
{
0&1\\
-1&0&&&&\bigzero\\
&&0&1\\
&&-1&0\\
&&&&\ddots\\
&\bigzero&&&&0&1\\
&&&&&-1&0\\
};
\draw (m-1-1.north west) -- (m-1-2.north east) -- (m-2-2.south east) -- (m-2-1.south west) -- (m-1-1.north west);
\draw (m-3-3.north west) -- (m-3-4.north east) -- (m-4-4.south east) -- (m-4-3.south west) -- (m-3-3.north west);
\draw (m-6-6.north west) -- (m-6-7.north east) -- (m-7-7.south east) -- (m-7-6.south west) -- (m-6-6.north west);
\end{tikzpicture}
\end{equation}

fitlike in the answer to your previous question. If you really need squares, you may loadshapes.geometricand use aregular polygon,regular polygon sides=4for the fit. Note that thearrowslibrary got superseded byarrows.meta. – Sep 09 '18 at 21:34