
Split a long equation and align each lines of it in LaTeX
Using amsmath
package and multline
environment splits a long equation but the second line of splitted equation is placed to the right. On the other hand, split
(not requiring amsmath
package) with &
align a splitted equation.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
f(x) = x + 2x + 3x \\
+ 4x
\end{multline*}
\begin{equation}
\begin{split}
f(x) = x + 2x + 3x \\
&+ 4x
\end{split}
\end{equation}
\begin{equation}
\begin{split}
f(x) = x &+ 2x + 3x \\
&+ 4x
\end{split}
\end{equation}
\begin{equation}
\begin{split}
f(x) = & x + 2x + 3x \\
&+ 4x
\end{split}
\end{equation}
\begin{equation}
\begin{split}
f(x) &= x + 2x + 3x \\
&+ 4x
\end{split}
\end{equation}
\end{document}

The indentation of the first equation using multline
is not so good. In the above example, the third pattern (labeled with (2)) may look better than others.
\begin{equation}
\begin{split}
f(x) = x &+ 2x + 3x \\
&+ 4x
\end{split}
\end{equation}

Comments
Powered by Markdown