The following code instructs LaTeX to typeset two different expressions for the square of the absolute value of a certain sum. I have three alignments - one of them is "almost" correct and two of them are correct.
The "=" are aligned properly. Though, the spaces to the right of the two equal signs are different. (This should shift the other alignments, but it doesn't.) I think the space to the right of the second equal sign is too little. How do I correct that?
I would like the first "+" in lines 2, 4, and 6 to be aligned. It seems that if LaTeX did not put an unreasonable amount of space after the "3" in line 2, these plus signs would have been aligned. In the aligned[t] environment, I have two alignments. It seems that since I have "3 &&+" to begin coding for line 2, the second "&" artificially put in the extra space.
The third alignment is to align cos(2a + b + c) in line 2, the first "+" in line 3, cos(a - b) in line 4, and the first "+" in line 5. This is correct. (I wanted to say that to help those looking at the code.)
\begin{align*}
\MoveEqLeft[3] \vert xy + xz + yz \vert^{2} \\
&= \begin{aligned}[t] 3 &&+ \bigl[&\cos(2a + b + c) + \cos(a + 2b + c) + \cos(a + b + 2c) \\
&&& + \cos(a - b) + \cos(a - c) + \cos(b - c)\bigr] \\
&&+ \bigl[&\cos(a - b) + \cos(a - c) + \cos(b - c) \\
&&&- \bigl(\cos(2a + b + c) + \cos(a + 2b + c) + \cos(a + b + 2c)\bigr) \bigr] \\
\end{aligned} \\
&= 3 + 2\bigl(\cos(a - b) + \cos(a - c) + \cos(b - c)\bigr) .
\end{align*}
\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.:)