# How can I get another align to this equation?

This is my code to align this equation

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{5}
(a+b)^{4} &=C_{4}^{0} a^{4}&&+C_{4}^{1} a^{3} b&&+C_{4}^{2} a^{2} b^{2}&&+C_{4}^{3} a b^{3}&&+C_{4}^{4} b^{4} \\
&=a^{4}&&+4 a^{3} b&&+6 a^{2} b^{2}&&+4 a b^{3}&&+b^{4}
\end{alignat*}
\end{document}


I feel, this is not a nice align. How can I get a nice align?

• In general, equal sign only must aligned, not for + and minus, etc. and all... Jul 22, 2022 at 4:10
• What do you mean with "nice align"? The output of your code is the same like in your picture. Jul 22, 2022 at 4:40

You could employ an array environment to get a "nice align", as you put it:
\documentclass[12pt,a4paper]{article}
$\renewcommand\arraystretch{1.33} \setlength\arraycolsep{0pt} \begin{array}{ *{5}{RC} R } (a+b)^4 &=& C_4^0 a^4 &+& C_4^1 a^3 b &+& C_4^2 a^2 b^2 &+& C_4^3 a b^3 &+& C_4^4 b^4 \\ &=& a^4 &+& 4 a^3 b &+& 6 a^2 b^2 &+& 4 a b^3 &+& b^4 \end{array}$