[Tex/LaTex] Alignment with IEEEeqnarray

equationshorizontal alignment

Let's say I wish to use IEEEeqnarray to typeset an equation like the following:
enter image description here

Obviously I can do this by manually inserting lots of spacing commands, but I would prefer to be able to do this by specifying the column alignment when the IEEEeqnarray environment is started. So I have been experimenting with various alignment options such as

\begin{IEEEeqnarray}{lCr}

but can I only achieve an equation typeset similar to
enter image description here

How can I do this through the allignment option?

Best Answer

Do you remember about ampersands?

\documentclass{article}
\usepackage{IEEEtrantools}


\begin{document}


\begin{IEEEeqnarray}{lCr}
  y&=&xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\
 && {}+gggggggggggggggggggggg
\end{IEEEeqnarray}

\end{document}

enter image description here

Please observe not only big C for proper spacing around =, but also {} for proper spacing around + in the second line.

Related Question