# How to align equations to the left?

I have this equation on Overleaf that aligns to the right instead of the left. I have followed instructions on other questions found here but it doesn't work.

{\setlength{\abovedisplayskip}{0pt}%
\begin{flalign}
-\frac{\tau}{2} \sum (x_n - \mu)^2 -b_0\tau -\frac{\lambda_0\tau}{2} (\mu - \mu_0)^2 \\
= -\frac{\tau}{2}\sum(x_n^2 + \mu^2 - 2x_n\mu) - b_0\tau - \frac{\lambda_0\tau}{2}(\mu^2 + \mu_0^2 - 2\mu\mu_0)\\
= -\frac{\tau}{2}(\sum x_n^2 + N\mu^2 - 2\mu\sum x_n) - b_0\tau - \frac{\lambda_0\tau}{2}(\mu^2 + \mu_0^2 - 2\mu\mu_0)
\end{flalign}%
}% How can I align to the left?

• Please make your given code snippet compilable ... Dec 23, 2018 at 17:17

i guess that you are looking for the following: \documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{equation}
\begin{split}
\MoveEqLeft
-\frac{\tau}{2}\sum (x_n-\mu)^2-b_0\tau
-\frac{\lambda_0\tau}{2}(\mu-\mu_0)^2 \\
& = - \frac{\tau}{2}\sum(x_n^2 + \mu^2 - 2x_n\mu) - b_0\tau -
\frac{\lambda_0\tau}{2}(\mu^2 + \mu_0^2 - 2\mu\mu_0)\\
& = -\frac{\tau}{2}\Bigl(\sum x_n^2 + N\mu^2 - 2\mu\sum x_n\Bigr) - b_0\tau -
\frac{\lambda_0\tau}{2}(\mu^2 + \mu_0^2 - 2\mu\mu_0))
\end{split}
\end{equation}
\end{document}

• @Mico, thank you very much. i consider your suggestion. Dec 23, 2018 at 17:38
• Sorry for not being sufficiently clear earlier about where the large parentheses should go. I've taken the liberty of providing an update.
– Mico
Dec 23, 2018 at 18:20
• @Mico, thank you very much. i should see, which parenthesis are in pair. Dec 23, 2018 at 18:47
• If there are more equalities in the same line and you'd like to them to break, to the next line, when there's no more space, how can you do that? Apr 11, 2021 at 21:31
• @Verónica, on the same way as are break other lines now. if this make you some problem, please ask new question where provide complete small document (MWE: Minimal Working Example) which demonstrate your problem. Apr 11, 2021 at 22:53
\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{flalign}
-& \frac{\tau}{2}\sum (x_n-\mu)^2-b_0\tau -\frac{\lambda_0\tau}{2}(\mu-\mu_0)^2 \notag \\
&= -\frac{\tau}{2}\sum(x_n^2 + \mu^2 - 2x_n\mu) - b_0\tau -
\frac{\lambda_0\tau}{2}(\mu^2 + \mu_0^2 - 2\mu\mu_0)                                   \\
&= -\frac{\tau}{2}\Bigl(\sum x_n^2 + N\mu^2 - 2\mu\sum x_n\Bigr) - b_0\tau -
\frac{\lambda_0\tau}{2}(\mu^2 + \mu_0^2 - 2\mu\mu_0)) \notag
\end{flalign}

\end{document} 