MULTI-LINE EQUATIONS

Align multi-line equations in LaTeX with aligned

Examples checked with MathTexLab’s base and AMS math renderer · Display style

Use the aligned environment inside the equation editor when several mathematical rows should line up at an equals sign. It creates one mathematical expression with multiple rows, not a document with independently numbered equations.

Mark the alignment point

Place & immediately before the relation you want to align. Every row should use the same structure. The marker is structural: it is not a printed ampersand. Use \& only when you actually want that character in supported text.

Separate the rows

A pair of backslashes ends a row. In the example, the second line begins at the same relation position as the first. The calculation is written out explicitly; the editor does not expand brackets or verify the algebra.

Align multi-line equations in LaTeX with aligned example
\begin{aligned}(x+1)^2 &= x^2+2x+1 \\ (x-1)^2 &= x^2-2x+1\end{aligned}
Open example in editor

Choose the right environment

Use aligned for this bundled example. Do not wrap it in \begin{document} or assume that a full LaTeX document environment or extra package is available. Automatic equation numbering is not part of this workflow.

Keep exports readable

Multi-line expressions are taller than single-line expressions. Inspect the complete scrollable preview, then check the exported image in its destination. If a long row makes a slide unreadable, split at a meaningful equality instead of shrinking every character. Rows that merely wrap on the screen are not a substitute for explicit mathematical alignment.

Syntax reference

MathJax supported-command reference. The examples above are limited to the features described here; additional packages are not implied.