When typesetting a (square) matrix with arbitrary dimension but repeated entries (in particular null entries), I make use of the \cdots
, \vdots
and \ddots
commands. When the entries of the matrix are short enough, this works quite well. However, as soon as some entries are long, the dots get messed up and the structure of the matrix is much less readable (not speaking of the dots not joining up properly, but that is a minor problem here). Here is an example:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{bmatrix}
a_{11} & a_{12} & 0 & \cdots & \cdots & \cdots & \cdots & 0 \\
a_{21} & a_{22} & a_{23} & \ddots & && & \vdots \\
0 & a_{32} & a_{33} & a_{34} & \ddots & & & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & & \vdots \\
\vdots & & \ddots & \ddots & \ddots & \ddots & \ddots& \vdots\\
\vdots & & & \ddots & a_{76} & a_{77} & a_{78} & 0\\
\vdots & & & & \ddots & a_{87} & a_{88} & a_{89}\\
0 & \cdots & \cdots & \cdots & \cdots & 0 & a_{98} & a_{99} \\
\end{bmatrix}
\end{equation}
\begin{equation}
\begin{bmatrix}
a_{11} & a_{12} & 0 & \cdots & \cdots & \cdots & \cdots & 0 \\
a_{21} & a_{22} & a_{23} & \ddots & && & \vdots \\
0 & a_{32} & a_{33} & a_{34} & \ddots & & & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & & \vdots \\
\vdots & & \ddots & \ddots & \ddots & \ddots & \ddots& \vdots\\
\vdots & & & \ddots & a_{n-2n-3} & a_{n-2n-2} & a_{n-2n-1} & 0\\
\vdots & && & \ddots & a_{n-1n-2} & a_{n-1n-1} & a_{n-1n}\\
0 & \cdots & \cdots & \cdots & \cdots & 0 & a_{nn-1} & a_{nn} \\
\end{bmatrix}
\end{equation}
\begin{equation}
\begin{bmatrix}
A_{-n,0}^{-n} & A_{-n+1,-1}^{-n} & 0 & \cdots & \cdots & \cdots & \cdots & 0 \\
A_{-n,1}^{-n+1} & A_{-n+1,0}^{-n+1} & A_{-n+2,-1}^{-n+1} & \ddots & && & \vdots \\
0 & A_{-n+1,1}^{-n+2} & A_{-n+2,0}^{-n+2} & A_{-n+3,-1}^{-n+2} & \ddots & & & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & & \vdots \\
\vdots & & \ddots & \ddots & \ddots & \ddots & \ddots& \vdots\\
\vdots & & & \ddots & A_{n-3,1}^{n-2} & A_{n-2,0}^{n-2} & A_{n-1,-1}^{n-2} & 0\\
\vdots & && & \ddots & A_{n-2,1}^{n-1} & A_{n-1,0}^{n-1} & A_{n,-1}^{n-1}\\
0 & \cdots & \cdots & \cdots & \cdots & 0 & A_{n-1,1}^{n} & A_{n,0}^{n} \\
\end{bmatrix}
\end{equation}
\end{document}
In this example, matrix (1) is fine, things start to get ugly with matrix (2), and matrix (3) is even worse:
I guess if I was able to force the height of each row (and width of each column) to be equal to the maximum width of the columns, the matrix would like fine. Do you know how to do that?