How to Break Long Equations Across Multiple Lines in LaTeX
Long equations that overflow the page margins are one of the most common formatting issues in LaTeX documents. Rather than squeezing everything onto one line, LaTeX provides several environments to elegantly break equations across lines while maintaining proper alignment and numbering. Bibby AI visually highlights equations that overflow margins before you compile, helping you catch layout issues that Overleaf only shows after a full recompile.
Using multline for Simple Line Breaks
The multline environment is ideal when you simply need to break a long equation. The first line is left-aligned, the last line is right-aligned, and middle lines are centered:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline}
p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3 \\
- 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3
\end{multline}
\end{document}Using split Inside equation for Aligned Breaks
When you want alignment at a specific operator (usually =) and a single equation number, use split inside equation:
\begin{equation}
\begin{split}
H(X) &= -\sum_{i=1}^{n} p(x_i) \log p(x_i) \\
&= -p(x_1)\log p(x_1) - p(x_2)\log p(x_2) \\
&\quad - \cdots - p(x_n)\log p(x_n)
\end{split}
\end{equation}Using aligned for Inline Multi-line Expressions
The aligned environment works inside any math mode and gives you full alignment control, making it versatile for nested use:
\[
\left.\begin{aligned}
\nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \\
\nabla \cdot \mathbf{B} &= 0 \\
\nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\
\nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}
\end{aligned}\right\}
\text{Maxwell's equations}
\]💡 Tips
- •Choose multline for simple breaks, split for aligned breaks with one number, and align for multiple numbered equations.
- •Add \quad or \qquad at the start of continuation lines to visually indent them for readability.
- •Never use \\\\ to break lines in a bare equation environment — use multline or split instead.
- •Bibby AI highlights margin overflows in real time, so you know exactly when an equation needs splitting.
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing Free