# Align a running list of expressions to the left

The following code:

\documentclass[12pt, a4paper, twoside, titlepage]{article}

\usepackage{amsmath}
\begin{document}

\begin{flalign}
J(1)=\\
\sum\limits_{i=1}^{m} (h_\Theta(x^i)-y^i)^2=&&\\
\sum\limits_{i=1}^{3} (\Theta_1(x^i)-y^i)^2=&&\\
\frac{1}{3}((1-1)^2+(2-2)^2+(3-3)^2)=&&\\
\frac{1}{3}(0+0+0)=0
\end{flalign}

\end{document}


Gives the following equation alignment: Aligning by the = is great when developing two sides of an equation. However, when developing an expresion line-by-line, I prefer that the expressions will be aligned to the left: I assume that after seeing my handwriting skills, my need for Latex is self-explanatory.

# My question

How do I align a running numbered list of expressions, similar to the one listed above, in which the expressions are aligned to the left?

• flalign (full length align) has nothing to do with fleqn (fixed length [from the margin] equations). Remember that align and the other environments with align in their name make columns in pair, the first right aligned and the second left aligned. So you just need & in front of each line. – egreg Mar 20 '17 at 7:49

\documentclass[12pt, a4paper, twoside, titlepage]{article}

\usepackage{amsmath}
\begin{document}

\begin{align}
&J(1)=\\
&\sum\limits_{i=1}^{m} (h_\Theta(x^i)-y^i)^2=\\
&\sum\limits_{i=1}^{3} (\Theta_1(x^i)-y^i)^2=\\
&\frac{1}{3}((1-1)^2+(2-2)^2+(3-3)^2)=\\
&\frac{1}{3}(0+0+0)=0
\end{align}

\end{document} • I changed flalign into align, because the former does nothing different in this case. – egreg Mar 20 '17 at 7:45