Ugly matrices to fix
The package nicematrix
has a feature dedicated to that problem. In an environment {NiceMatrixBlock}
, all the matrices created by nicematrix
(with {bNiceMatrix}
but this environment will create the same result as {bmatrix}
would do) will have the same width of columns. Two compilations are necessary.
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tensor}
\usepackage{nicematrix}
\begin{document}
\begin{NiceMatrixBlock}[auto-columns-width]
\begin{align}
\gamma^0 &=
\begin{bNiceMatrix}
0 & \tensor{\sigma}{_2} \\[1em]
\tensor{\sigma}{_2} & 0
\end{bNiceMatrix},
\\
\gamma^1 &=
\begin{bNiceMatrix}
-\, i \tensor{\sigma}{_3} & 0 \\[1em]
0 & -\, i \tensor{\sigma}{_3}
\end{bNiceMatrix},
\\
\gamma^2 &=
\begin{bNiceMatrix}
0 & \tensor{\sigma}{_2} \\[1em]
-\, \tensor{\sigma}{_2} & 0
\end{bNiceMatrix},
\\
\gamma^3 &=
\begin{bNiceMatrix}
i \tensor{\sigma}{_1} & 0 \\[1em]
0 & i \tensor{\sigma}{_1}
\end{bNiceMatrix}.
\end{align}
\end{NiceMatrixBlock}
\end{document}
A simple code with eqparbox
: I define an \eqmathbox
command, which ensures that all math boxes sharing the same tag (M
by default) have the width of the largets natural width of their contents. It suffices to use this command with the widest element in each column (two compilations may be required).
Unrelated: needless to load amsmath
when you load mathtools
: the latter package does it for you.
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tensor}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$#2$}}
\begin{document}
\begin{align}
\gamma^0 &=
\begin{bmatrix}
0 & \eqmathbox{\tensor{\sigma}{_2}} \\[1em]
\eqmathbox{\tensor{\sigma}{_2} }& 0
\end{bmatrix},
\\[0.5ex]
\gamma^1 &=
\begin{bmatrix}
\eqmathbox{-i\tensor{\sigma}{_3}} & 0 \\[1em]
0 & \eqmathbox{-i\tensor{\sigma}{_3}}
\end{bmatrix},
\\[0.5ex]
\gamma^2 &=
\begin{bmatrix}
0 & \eqmathbox{\tensor{\sigma}{_2}} \\[1em]
\eqmathbox{-\tensor{\sigma}{_2}} & 0
\end{bmatrix},
\\[0.5ex]
\gamma^3 &=
\begin{bmatrix}
\eqmathbox{i\tensor{\sigma}{_1}} & 0 \\[1em]
0 & \eqmathbox{i\tensor{\sigma}{_1}}
\end{bmatrix}.
\end{align}
\end{document}
Post suggested by Schrödinger's cat's takes care of 'minus' for such spacings, but your matrices have lots of other factors which will need too many if conditions. Best way I found was to add phantom characters and produce the output. I am sure there will be a way to automate this, but if you just want it for three equations, adding phantom
manually would serve the purpose.
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tensor}
\begin{document}
\begin{align}
\gamma^0 &=
\begin{bmatrix}
0 & \phantom{-}\tensor{\sigma}{_2}\phantom{3} \\[1em]
\phantom{-}\tensor{\sigma}{_2}\phantom{3} & 0
\end{bmatrix},
\\
\gamma^1 &=
\begin{bmatrix}
-\, i \tensor{\sigma}{_3} & 0 \\[1em]
0 & -\, i \tensor{\sigma}{_3}
\end{bmatrix},
\\
\gamma^2 &=
\begin{bmatrix}
0 & \phantom{-}\tensor{\sigma}{_2}\phantom{3} \\[1em]
-\, \tensor{\sigma}{_2}\phantom{3} & \phantom{-}0\phantom{3}
\end{bmatrix},
\\
\gamma^3 &=
\begin{bmatrix}
\phantom{- }i \tensor{\sigma}{_1} & \phantom{-} 0 \phantom{3} \\[1em]
0 & \phantom{-1}i\tensor{\sigma}{_1}
\end{bmatrix}.
\end{align}
\end{document}