Similar question: How can I make a similar matrix with even column spacing?
The following code is simple to write/read/maintain, but looks terrible.
\documentclass{article}\usepackage{amsmath}\usepackage{mathtools}\begin{document}\begin{equation*} \begin{bmatrix*}[r] 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{bmatrix*} \end{equation*}\end{document}
This is because the negative sign adds extra space between the first and second columns, but not between the second and third.
One could naively put a \phantom{-}
in each column, but this isn't right either.
\begin{equation*} \begin{bmatrix*}[r] \phantom{-}1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & \phantom{-}1 \end{bmatrix*}\end{equation*}
This is because we don't need extra space to the left of each column, but an even amount of space between each column.
\begin{gather*} \begin{bmatrix*}[r] 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{bmatrix*} \\ \begin{bmatrix*}[r] 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & \phantom{-}1 \end{bmatrix*} \end{gather*}
Much better. (The second one, compared to the original above it.)
However, in larger matrices, this can easily become hard to read and quite a hassle to maintain. Is there some simple way to tell it to put an equal amount of space (say, between the right hand sides) of columns 1&2, 2&3, 3&4, ... ?
Ideally, I'd like the body of my matrices to contain nothing other than the content:
1 & 0 & 0 \\0 & -1 & 0 \\0 & 0 & 1