This is my code to align this equation

            (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} 

enter image description here

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

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

1 Answer 1


You could employ an array environment to get a "nice align", as you put it:

enter image description here

\newcolumntype{C}{>{{}}c<{{}}} % col. type for relational and binary operators

\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 


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .