[Tex/LaTex] How to left justify equations in IEEEeqnarray environment

equationshorizontal alignmentieeetran

I have an document that use both IEEEeqnarray and normal equation environment. The equation is set to be left justified with

\usepackage[fleqn]{amsmath}

However IEEEeqnarray is centered. How to make it left justified ?

Best Answer

The IEEEtrantools package which provides the IEEEeqnarray environment currently does not allow for the fleqn class/package option. You can, however, simulate the effect of this option by means of an adequate user-defined glue type:

\documentclass[fleqn]{article}

\usepackage{amsmath}
\usepackage{IEEEtrantools}

\IEEEeqnarraydefcolsep{0}{\leftmargini} % any number other than 0 also allowed as glue type

\begin{document}

\noindent
Text\hfill{}Text
\begin{equation}
  x=1
\end{equation}
Text\hfill{}Text
\begin{IEEEeqnarray}{0rCl}
  x&=&1
\end{IEEEeqnarray}
Text\hfill{}Text

\end{document}

IEEEeqnarray with \leftmargini indent

This also works if the amsmath package is not present.

Note that the amsmath package defines a switch \if@fleqn. Using this switch you could redefine the IEEEeqnarray environment to automatically include the 0 glue type whenever the fleqn option is specified.

Related Question