How can i force latex to print out square matrix as a square matrix with equal width and height in math-mode?
I also read amsmath documentation, but don't found any useful help on it.
For example please for this matrix:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\left[
\begin{matrix}
\times & \times & \times &&&&&&&\\
\times & \times & & \times & \times & & & &\\
\times & & \times & & \times & & & & \\
& \times & & \times & & \times &&& \\
& \times & \times & & \times & \times & \times & &&\\
&&& \times & \times & \times && \times & \times\\
&&&& \times && \times & \times & \\
&&&&& \times & \times & \times & \times \\
&&&&& \times && \times & \times
\end{matrix}
\right]
\]
\end{document}
result is:
that is a rectangle not an square!
Best Answer
If you are willing to live under the constraint that all matrix elements occupy the same width (though your question implies that such a constraint may actually be a desirable requirement), then this
\sqmatrix[alignment]{content}
macro will do the "squaring" automatically.Inter-element spacing (default 0pt) may be specified with
\setstacktabbedgap{length}
.