[Tex/LaTex] How to stop centering effect when using split equation

alignequationsmath-mode

For example, the following code produces the equations below:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
  \begin{split}
    Helloworld & = A \\
               & = B
  \end{split}
\]
\end{document}

enter image description here

I would like to know if it is possible to align left after using split equation

Best Answer

amsmath provides the flalign environment. It is designed for placing two sets of aligned equations, the first block flush on the left margin, the second flush on the right, e.g.

\begin{flalign*}
  x & = A & y &= B
\end{flalign*}

produces

|x = A                                       y = B|

The first and third & here provide aligment points for the two blocks, the middle & separates the blocks. The use of flalign* supresses equation numbers.

Placing your split in the first block, or simply before the first &, will thus make it align with the left margin.

Sample output

\documentclass{article}

\usepackage{amsmath}

\begin{document}

Text before
\begin{flalign*}
  \begin{split}
    \textit{Helloworld} & = A \\
               & = B
  \end{split}&
\end{flalign*}
and after.
\begin{flalign*}
  x & = A & y &= B \\
  z & = C & u &= U
\end{flalign*}
Further text.

\end{document}