# How should I use alignat with more than two columns?

I want to use alignat with these equations. I tried

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{4}
\sqrt{75} &{}={} \sqrt{3\cdot 25} &{}={} \sqrt{3\cdot 5^2} &{}={} 5\sqrt{3},\\
\sqrt{147} &{}={} \sqrt{3\cdot 49} &{}={} \sqrt{3\cdot 7^2} &{}={} 7\sqrt{3},\\
\sqrt{300} &{}={} \sqrt{3\cdot 100} &{}={} \sqrt{3\cdot 10^2}  &{}={} 10\sqrt{3}.
\end{alignat*}
\end{document}


I got

How can I make it line up more correctly?

I just converted 2 columns from & separators to &&, in order to force left alignment of those columns.

And, as Mico generously added, all occurrences of {}={} can be replaced with =.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{4}
\sqrt{75} &= \sqrt{3\cdot 25} &&= \sqrt{3\cdot 5^2} &&= 5\sqrt{3},\\
\sqrt{147} &= \sqrt{3\cdot 49} &&= \sqrt{3\cdot 7^2} &&= 7\sqrt{3},\\
\sqrt{300} &= \sqrt{3\cdot 100} &&= \sqrt{3\cdot 10^2}  &&= 10\sqrt{3}.
\end{alignat*}
\end{document}


• +1. One may replace all instances of {}={} with =, though. – Mico Sep 28 at 2:17