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.
What have I tried
- Playing with
align
andflalign
- Reading "Aligning equations with amsmath"
- Reading problem using option fleqn in amsmath package, Use flalign or alignat or align or similar environment to align to the left, Text in flalign/align and How can I use an align environment flush left?
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 withfleqn
(fixed length [from the margin] equations). Remember thatalign
and the other environments withalign
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.