How can I have linebreaks in my long LaTeX equations?

ubutu picture ubutu · May 18, 2010 · Viewed 403.8k times · Source

My equation is very long. How do I get it to continue on the next line rather than go off the page?

Answer

Alessandro Cuttin picture Alessandro Cuttin · May 18, 2010

If your equation does not fit on a single line, then the multline environment probably is what you need:

\begin{multline}
    first part of the equation \\
    = second part of the equation
\end{multline}

If you also need some alignment respect to the first part, you can use split:

\begin{equation}
    \begin{split}
        first part &= second part #1 \\
        &= second part #2
    \end{split}
\end{equation}

Both environments require the amsmath package.

See also aligned as pointed out in an answer below.