A grid, not a paragraph
Everything amsmath gives you for multi-line maths is built on one TeX primitive, the alignment table. A row of an align is a row of that table, \\ ends a row, and every & steps to the next column, with the columns strictly alternating: material before an ampersand is right-aligned on it, material after is left-aligned. That is the entire mechanism, and it is where almost every rule on this page comes from. The reason &= is the idiom rather than =& is that the boundary between the two columns is the only place where two rows are guaranteed to meet — put the relation exactly there and every relation in the block stacks on one vertical rule.
Because it is a table, the block is typeset as a unit. The grid is as wide as its widest row, and amsmath then centres the grid, not the rows inside it. A derivation whose second line runs long therefore drags the anchor column leftward for every line, and the short lines look off-centre beside it. That is not a bug you can sand down: each row is positioned relative to its columns, not to the page, so hand-spacing an individual row only moves it out of its own column. If what you actually want is each line centred on its own, you do not want an aligned block at all — you want a centred stack, which is a different environment.
Two corollaries generate most of the error messages. A blank line inside the block is a paragraph end inside maths, so TeX answers ! Missing $ inserted. even though every dollar sign is present: the display was never left open, it was merely interrupted. And a \\ after the last row is not decoration — it opens a real empty row, which a numbered alignment will happily tag, and that is where a stray number with nothing beside it comes from. There is a third boundary worth knowing early: a single-row box may sit inside $…$, but the moment you add a second row the construct needs a display, because a line of text cannot host a table with a row separator in it.
\begin{aligned} f(x) &= (x+1)^2 \\ &= x^2 + 2x + 1 \end{aligned}
\begin{aligned} \int_0^1 x \, dx &= \left[ \frac{x^2}{2} \right]_0^1 \\ &= \frac{1}{2} \end{aligned}

Five environments, two questions
Two questions locate the right environment. First: what should line up? Nothing in common (a centred stack), one relation per row, a fixed number of columns you have chosen yourself, both margins, or one equation that simply does not fit on a line? Second: does it need an equation number? Only the first family — align, gather, alignat, flalign, multline — are structures: they open and close a display themselves, they move the equation counter, they accept \tag and \intertext, and TeX is allowed to break them across a page. Everything else — aligned, gathered, alignedat, split, cases, array — is a box: a maths object with rows inside, no counter, no page break, no intertext.
That distinction is where the perennial confusion lives. aligned is to align what a fraction is to a displayed equation: the same layout machinery, demoted to something you can nest. Drop it inside \[…\] and you get an unnumbered centred block; put it inside equation and the parent supplies the one tag; set it beside a delimiter and it lines up with that delimiter. Put align inside equation instead and amsmath refuses — ! Package amsmath Error: Erroneous nesting of equation structures. Two structures cannot share one number, and amsmath will not guess which one you meant.
Boxes also restyle their contents, which is the difference people experience as "my fractions shrank". A display sets its maths in display style; a box sits inside something else and inherits text style, so the cells of gathered, aligned and cases print \frac at the small size and \sum with its bounds to the side. Nothing is broken — the cell simply is not a display. The repair is per cell (\dfrac, \limits, \displaystyle at the head of a cell) rather than per block, which is why the same source looks confident in align and cramped inside aligned.
\begin{gathered} a^2 + b^2 = c^2 \\ d = \sqrt{a^2 + b^2} \end{gathered}
\dfrac per cell and gets its row gap from \\[4pt].\begin{gathered} \frac{1}{1+x} \\ \int_0^1 f(x) \, dx \end{gathered} \qquad \begin{gathered} \dfrac{1}{1+x} \\[4pt] \int_0^1 f(x) \, dx \end{gathered}
Ampersand grammar: how many, and which side
One & per row is the everyday case, and which side of the relation you put it on is a layout decision, not a habit. &= makes the relation the first token of the left-aligned column: the signs stack, and the left-hand sides butt up against them from unequal distances — right for a chain of reasoning, where the left sides differ. =& instead pushes the relation to the right edge of the right-aligned column, so the signs still stack but everything after them starts at one vertical rule on every row — the layout for columns of numbers, tables of values, and any block where the right-hand side carries the information. Neither is wrong, and a block that mixes them will look wobbling even though it compiles.
A second pair of columns is how two derivations share one display. The convention is a doubled && — the first tab closes the pair you were working in, the second opens the next — and the empty cell between them is where the gutter between the halves lives. u &= \sin x && dv &= e^x\,dx then reads as two chains locked to the same rows: each half has its own anchor, and both halves are aligned against one another across every row. The count must be identical in every row. A row with more cells than the preamble can hold is an outright error, ! Extra alignment tab has been changed to \cr., and a row with fewer prints a hole at the right without a word.
The anchor itself need not be an equals sign. Any relation works, because all the alignment uses is the column boundary: \le, \ge, \equiv, \sim, \subseteq, \coloneqq, \to, \approx — and a block that mixes \le and = in one column is standard in estimates, where one line is an inequality and the next is an evaluation. Two details make the mixed case read well: keep the relation as the first token after the tab so the symbols occupy the same width class, and when you want something to line up under a term rather than at a sign, leave the anchor cell empty or pad it with \phantom{{}={}}, which reserves exactly the width of the relation you did not type.
\begin{aligned} u &= \sin x & dv &= e^x \, dx \\ du &= \cos x \, dx & v &= e^x \end{aligned}
& and no relation: the anchors then line up the left edges, which is what a list of definitions wants and a chain of equalities does not.\begin{aligned} (a+b)^2 &= a^2 + 2ab + b^2 \\ &\le 2a^2 + 2b^2 \\ &= 2\bigl(a^2 + b^2\bigr) \end{aligned}
alignat: you count the columns, you buy the gutters
alignat is the environment where amsmath stops guessing on your behalf. Its mandatory argument is the number of alignment pairs, so alignat{2} builds four columns and each row carries at most 2n − 1 = 3 ampersands. Get the arithmetic wrong in either direction and the failure is characteristic: one tab too many and TeX reports the extra alignment tab; one too few and the row simply stops early while the columns after it stay where the earlier rows placed them. The reason to choose it over align is precisely that rigidity — align adds column pairs as rows demand them and pads between pairs by amsmath's rule, whereas alignat fixes the geometry once, at \begin, so five rows of a system can be made to share a third column at a distance you decided.
With that control comes the thing that surprises everyone the first time: alignat inserts no horizontal space between columns at all. Where align pads, alignat butts the right-aligned cell of one pair directly against the left-aligned cell of the next, so two chains side by side print as one long run-on formula until you supply the air yourself. Put it at the end of the right-aligned cell — x &= 1 + 2 \quad & y &= 3 + 4 — because spacing typed there is content inside a column and survives; a space after the last cell of a row is not content, and does not.
alignedat is the box form, same arithmetic, no numbering, which is what you want for two systems that must line up under each other while sharing one equation number. alignat* is the unnumbered structure, and both take per-row \tag exactly as align does. The opposite demand is served by flalign, which stretches its pairs to the edges of the display so an equation sits flush left and its condition flush right on one line — at the price of a trailing && on every row, without which it centres like align and the effect vanishes without an error.
\begin{alignedat}{2} \nabla\cdot\mathbf{E} &= \rho/\varepsilon_0 \quad& \nabla\times\mathbf{B} &= \mu_0\bigl(\mathbf{J}+\varepsilon_0\partial_t\mathbf{E}\bigr) \\ \nabla\cdot\mathbf{B} &= 0 \quad& \nabla\times\mathbf{E} &= -\partial_t\mathbf{B} \end{alignedat}
alignat{n} wants 2n cells per row, hence 2n − 1 tabs — and the chain form x&=y&&=z is legal at {2} because the doubled tab stands on an empty cell.% ============================================================
% Four ways to put two chains side by side, and what each one
% actually controls. Compile with pdflatex: none of these
% structures exists in a browser-side renderer (see the lesson).
% ============================================================
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\begin{document}
\section{align: amsmath counts the columns and pads between them}
One row may carry one ampersand, the next three; the grid grows as needed
and the inter-column glue is amsmath's decision, not yours.
\begin{align}
u &= \sin x & dv &= e^x\,dx \\
du &= \cos x\,dx & v &= e^x
\end{align}
\section{alignat: you declare the pair count, you type the gutter}
Two pairs means four columns means at most $2\cdot 2 - 1 = 3$ ampersands
per row. A fourth one is a hard error:
\begin{center}
\ttfamily ! Extra alignment tab has been changed to \string\cr.
\end{center}
Note the \verb|\quad| at the END of the right-aligned cell: alignat
supplies no horizontal space whatsoever, so the gutter is content.
\begin{alignat}{2}
u &= \sin x \quad& dv &= e^x\,dx \\
du &= \cos x\,dx \quad& v &= e^x
\end{alignat}
Same environment, chain form: the second pair's left cell stays empty and
the whole thing is ONE equation with two anchors.
\begin{alignat}{2}
\int u\,dv &= uv &&- \int v\,du \\
&= e^x\sin x &&- \int e^x\cos x\,dx
\end{alignat}
\section{flalign: the pairs are pushed to the margins}
Every row needs the trailing \verb|&&|; without it the block centres
exactly like align and the margin effect silently disappears.
\begin{flalign}
f(x) &= x^3 - 3x && \\
f'(x) &= 3x^2 - 3 &&
\end{flalign}
\section{multline: one equation, nothing to align}
First row flush left, last flush right, middle rows centred. No ampersand
is used here at all -- if you find yourself typing one, you want align.
\begin{multline}
(a+b+c+d)^2 = a^2 + b^2 + c^2 + d^2 \\
+ 2ab + 2ac + 2ad + 2bc + 2bd + 2cd
\end{multline}
\section{The box version of the same arithmetic}
\begin{equation}
\begin{alignedat}{2}
x &= 1 + 2 \quad& y &= 3 + 4 \\
z &= 6 \quad& w &= 11
\end{alignedat}
\end{equation}
Four columns, one tag: \texttt{alignedat} is a box, so the enclosing
\texttt{equation} is what owns the number.
\end{document}
split: one number, and the boxes inside it
split answers a question align cannot: how do you give a three-line derivation a single number? It is a box with exactly one alignment point per row, and it is meant to be the whole body of an equation. The one-anchor rule is the difference that bites: a second & in a split row is ignored rather than diagnosed, so a two-column layout copied happily from aligned comes out with its right half missing. The parent's tag is centred vertically against the whole block; load amsmath with the tbtags option and it sits level with the last row instead, which is the convention in a fair number of books and thesis classes.
Inside any row you may nest as many boxes as the layout needs, and two combinations carry most of the weight. aligned inside cases gives you the brace of a piecewise definition with real column alignment inside a branch — the form for a vector-valued or multi-line case — and needs no delimiter arithmetic because a box carries no delimiters of its own. A cases block as the right-hand cell of an aligned row is the mirror image: a function definition and the steps that evaluate it sharing one display.
Two mechanics keep nesting well-behaved. First, a box is an ordinary maths atom to its parent, so the parent decides the style: cells are text style, tall fractions need \dfrac, and a \left/\right pair must open and close inside a single cell — a delimiter straddling a & or a row break is not recoverable, and the fix is fixed-size \bigl … \bigr. Second, vertical alignment between siblings is opt-in: a box centres itself against whatever stands beside it, so a four-row derivation next to one short equation looks as if it is drifting upward. aligned and gathered take [t] or [b] on the \begin line for exactly this; split does not, which is why rewriting split as aligned[t] is sometimes the real answer to a tag that will not move.
\begin{split} (x+1)^3 &= (x+1)(x+1)^2 \\ &= x^3 + 3x^2 + 3x + 1 \end{split}
& will not buy you a second column inside split: switch to aligned (and accept that the parent must then supply the numbering), or to alignedat when the column count is the point.\begin{cases} \begin{aligned} x &= t/2 \\ y &= 1-t \end{aligned} & 0 \le t \le 2 \\ \begin{aligned} x &= 1 \\ y &= t-2 \end{aligned} & t \gt 2 \end{cases}
Which rows get a number, and what they are called
In a structure, one number per row is the default. align, gather and alignat advance the equation counter as they lay rows out; the starred forms never advance it; \notag (identical to \nonumber) at the end of a row removes that row's tag without disturbing its neighbours. \tag{…} overwrites the printed string outright and \tag*{…} drops the surrounding parentheses — and either one inside a starred environment is a hard stop, ! Package amsmath Error: \tag not allowed here., because there is no tag machinery present to intervene in. A \label belongs on a row that carries a number: what amsmath stores is whatever that row's numbering step left behind, so a label attached to a suppressed row has no number of its own to remember and resolves to something adjacent.
Everything about the format of the number is a counter question, not an alignment question, and it is worth naming the three levers so you look in the right file: \numberwithin{equation}{section} from amsmath gives (2.3)-style numbers and resets the count at every section; \renewcommand{\theequation}{…} rewrites the printed form by hand and does not reset anything; and the subequations wrapper spends one parent number on an entire group and letters the rows inside it, which is the standard shape for a set of relations cited together as (3.1) and individually as (3.1a)–(3.1d). The two-pass machinery behind all of that, including the ?? on the first compile and what \label literally stores, is the subject of the cross-referencing lesson.
The judgement call is yours, and it is typographic rather than technical. Number what the prose cites and nothing else: five rows of algebraic working under a single tag read as one argument, while five tags give the reader five things to check and turn your "from (4)" into a reference that breaks the next time somebody edits the middle line. If you cannot decide, the safe default is working in align* and the result in equation. mathtools takes that further with showonlyrefs, which prints only the tags that are actually referenced — worth enabling late in drafting, because it needs one more compile pass to settle and it moves numbers around when a reference disappears.
\begin{aligned} 2x+3 &= 7 \\ 2x &= 4 \notag \\ x &= 2 \tag{2.1} \end{aligned}
\notag and \tag at the end of the row, before its \\: they belong to the row, and after the tab they belong to the next one.% In a real document, replace aligned with align*:
\begin{align*}
\int x e^x \, dx &= x e^x - \int e^x \, dx \
&= x e^x - e^x + C
\end{align*}
% With an equation number:
\begin{align}
\nabla \cdot \mathbf{E} &= \rho/\varepsilon_0 \label{eq:gauss} \
\nabla \cdot \mathbf{B} &= 0 \label{eq:nomonopole}
\end{align}
Referring to them: from \eqref{eq:gauss} and \eqref{eq:nomonopole} …
Words between the rows
The reflex when a derivation needs a "therefore" is to type it as a row of its own: \\ \text{therefore} \\. It compiles, and it looks wrong, because that row has become part of the grid — the words land in the right-aligned column and hug the anchor from the left, at the mercy of column widths set by the algebra around them. The deeper problem is structural: the block is still one box, so the sentence cannot break across a page any more than the equations can, and the reader who comes back to the middle of the derivation finds no seam.
\intertext{…} is amsmath's answer, and it exists only in the top-level structures — align, gather, alignat, flalign and their star forms, never aligned or split, because a box has no display width to set flush text across. It is typeset flush left over the whole width, leaves the alignment of the surrounding rows untouched, and consumes no tag. Three rules come with it. It must sit between the \\ that closes one row and the material that opens the next. It is for a phrase, not a paragraph: the honest advice is that anything longer should close the display, be written as ordinary text, and open a new display — even though that means a second equation number, which is the point, because the number is what tells the reader a new statement began. And \intertext* is the variant that forbids a page break at that spot, for the case where the phrase belongs to the line below it. mathtools adds \shortintertext, which sets the same flush-left line with far less vertical space and no tag — the right tool for a bare "hence", the wrong one for a clause with a comma in it.
Row spacing is the neighbouring question, and it has three levers that people mix. The extra space between rows of align, gather, alignat and split is the length \jot, 6pt by default: \setlength{\jot}{9pt} changes it document-wide, and \\[8pt] on a single row overrides it locally — the only per-row vertical control these environments offer. array ignores \jot entirely and responds to \arraystretch and \\[…] instead, so a spacing fix learned in a table does nothing in a derivation and vice versa. \vspace inside maths is the fourth candidate and not a lever at all: it is a text-mode skip, and inside a display it either does nothing or throws.
\begin{aligned} f(x) &= x^3 - 3x \\ \text{so } f^{\prime}(x) = 3x^2 - 3 \\ x &= \pm 1 \end{aligned}
\intertext is not implemented: close the block, set the prose, open a new block.\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{mathtools} % \shortintertext
% Extra space between the rows of align / gather / alignat / split.
% Default 6pt. It does NOT govern array, which uses \arraystretch.
\setlength{\jot}{8pt}
\begin{document}
\section{(A) A sentence as a row: compiles, and reads wrong}
\begin{align}
f(x) &= x^3 - 3x \\
\text{so} \\ % <- lands inside the right-aligned column
f'(x) &= 3x^2 - 3
\end{align}
Nothing warns you. The words hug the anchor from the left, they inherit
column widths set by the algebra, and the block stays one unbreakable unit.
\section{(B) \intertext: the amsmath answer}
\begin{align}
f(x) &= x^3 - 3x \\
\intertext{differentiating term by term,}
f'(x) &= 3x^2 - 3 \\
\shortintertext{and solving $f'(x)=0$ gives} % mathtools: tighter, no tag
x &= \pm 1 \label{eq:crit}
\end{align}
Both forms must sit between the \verb|\\| that closes one row and the next
row. Both exist only in the top-level structures: \verb|\intertext| inside
\verb|aligned| or \verb|split| is an error, because a box has no display
width to set flush text across. \verb|\intertext*| is the variant that
forbids a page break at that point.
\section{(C) Longer than a phrase: close the display}
Differentiating term by term gives \( f'(x) = 3x^{2} - 3 \). Setting
\( f'(x) = 0 \) we obtain
\begin{equation}
x = \pm 1 .
\end{equation}
Two displays and two numbers -- which is precisely the information the
reader needs about where the argument turned.
\section{Row spacing, three levers}
\begin{align}
a &= b \\
c &= d \\[12pt] % one local override, beats \jot
e &= f
\end{align}
\begin{equation}
\begin{aligned}
\sum_{k=1}^{n} k &= \frac{n(n+1)}{2} \\[6pt]
\sum_{k=1}^{n} k^2 &= \frac{n(n+1)(2n+1)}{6}
\end{aligned}
\end{equation}
Inside a box the row gap comes from \verb|\\[...]| and from the enclosing
style; \verb|array| answers to \verb|\arraystretch| instead of \verb|\jot|,
which is why a spacing fix copied from a table does nothing in a derivation
-- and \verb|\vspace| inside maths is not a lever at all.
\end{document}
Too wide, too tall, or not for this renderer
Width is what alignment pays for. Each extra pair of columns adds its own content plus amsmath's padding, and a display never wraps: pdfTeX logs Overfull \hbox (12.4pt too wide) detected at line 47 and sets the remainder into the margin. Work the options in a fixed order. Break the chain into two displays joined by a sentence — the common case and the one readers thank you for. Break a single expression at a binary operator and carry the remainder on the next row with &\quad + \dots, keeping the operator at the start of the row so the addition visibly continues; never break immediately after =, never inside a fraction, never between a function name and its argument. Absorb a long factor into a named macro, or move it into the sentence around the maths. Only then consider the layout tools: multline, which spends the full width on one unanchored equation with its first row flush left and last flush right, and — as a genuine last resort — a narrower font, which is the one fix a referee notices.
Height fails differently, and the symptom looks like a bug: a display that does not fit in the remaining space is not split, it is moved, and the page ends early with a band of white where it would have gone. Multi-row blocks are unbreakable by default. \allowdisplaybreaks changes that with an integer argument — 0 never (the default), 1 and 2 allow breaks but dislike them, 3 stops worrying, 4 makes a display break about as cheap as an ordinary text line — and the register underneath is \interdisplaylinepenalty. The switch is global, so per-block control comes from the row separators instead: \\* forbids a break after that row, and a \pagebreak[3] placed immediately before a \\ marks a good place for one. Use the permission narrowly anyway: a chain broken across a page boundary loses the shared column that made it readable, and a seam that can be a sentence should be one.
Last, the limits of this page rather than of LaTeX. Browser maths renderers implement the box forms and not the structures: aligned, gathered, alignedat, split, cases and array yes; top-level align, gather, alignat, multline, flalign and equation no, and neither \intertext, \shortintertext, \lefteqn nor mathtools' \MoveEqLeft. That is why every formula shown on this page is a box and every numbered example is a source listing: your pdflatex output is the same document, and forgetting the difference is the fastest route to a formula that compiles on your machine and arrives as raw source on someone's phone. None of which is a reason to write aligned in your own document where align is the honest choice.
\begin{aligned} (a+b+c)^2 &= a^2 + b^2 + c^2 \\ &\quad + 2ab + 2bc + 2ca \end{aligned}
grep -c "Overfull" file.log counts the lines where LaTeX gave up on fitting your block, and a derivation with a nonzero count is one display too wide, not one font size too big.\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
% \usepackage[tbtags]{amsmath} % put the tag on the LAST row of a split
% block instead of centring it vertically
% Global switch, 0..4: 0 never (default), 1-2 reluctantly, 3-4 freely.
% The register underneath it is \interdisplaylinepenalty.
\allowdisplaybreaks[2]
\begin{document}
\section{A chain taller than the space left on the page}
Without permission TeX does not split the block: it moves the whole thing
and ends the page early, leaving a band of white behind.
\begin{align}
\int_0^1 x e^x\,dx
&= \bigl[x e^x\bigr]_0^1 - \int_0^1 e^x\,dx \notag \\
&= e - \bigl[e^x\bigr]_0^1 \notag \\[4pt]
&= 1 \label{eq:parts}
\end{align}
\section{Per-row control beats the global switch}
\begin{align}
(a+b+c+d)^2
&= a^2+b^2+c^2+d^2 \pagebreak[3] \\ % invite a break HERE
&\quad + 2ab+2ac+2ad \notag \\* % \\* = never break after this row
&\quad + 2bc+2bd+2cd \notag \\
&= \sum_{i} a_i^2 + 2\sum_{i\lt j} a_i a_j \tag{$*$}
\end{align}
A \verb|\pagebreak| is best placed immediately before the \verb|\\| where
it should take effect. Still, a derivation broken across a page boundary
loses the shared column that made it readable: if the seam can be a
sentence, make it a sentence.
\section{When the block is too wide rather than too tall}
An alignment never wraps. pdfTeX logs
\begin{center}
\ttfamily Overfull \hbox (12.4pt too wide) detected at line 47
\end{center}
and sets the remainder into the margin. Fixes, in the order that keeps the
typography intact:
\begin{enumerate}
\item break the chain into two displays and join them in prose;
\item break at a binary operator and carry it with \verb|&\quad + ...|;
\item absorb a long factor into a \verb|\newcommand| semantic macro;
\item move the tail into the sentence around the display;
\item use \verb|multline| when there is nothing to align;
\item only then touch fonts or column glue.
\end{enumerate}
\[
\underbrace{R_{\mu\nu}-\tfrac12 R\,g_{\mu\nu}}_{\text{curvature}}
= \kappa\, T_{\mu\nu},
\qquad \text{where } \kappa = 8\pi G/c^{4}
\]
One long factor folded into an \verb|\underbrace| label plus a
\verb|\text| condition -- instead of a fourth alignment column that no
single row of the block can pay for.
\end{document}
Lesson cheat sheet
One key line of code from each section — jump to it or copy it straight from here.
\begin{aligned} f(x) &= (x+1)^2 \\ &= x^2 + 2x + 1 \end{aligned}
\begin{gathered} a^2 + b^2 = c^2 \\ d = \sqrt{a^2 + b^2} \end{gathered}
\begin{aligned} u &= \sin x & dv &= e^x \, dx \\ du &= \cos x \, dx & v &= e^x \end{aligned}
\documentclass[11pt,a4paper]{article}
\begin{split} (x+1)^3 &= (x+1)(x+1)^2 \\ &= x^3 + 3x^2 + 3x + 1 \end{split}
\begin{align*}
Common mistakes
! Misplaced alignment tab character &.— an&where no alignment is open: in running text (where it wants\&), on a line whose display was never entered, or in a document that never loadedamsmath, in which case the next message is usuallyEnvironment align undefined.! Extra alignment tab has been changed to \cr.— one cell more than the preamble holds. The classic forms are a fourth&in analignat{2}row, and a&&pasted intosplit, which has exactly one anchor per row.- A blank line inside the block:
! Missing $ inserted.with no dollar sign missing anywhere. The empty line is a paragraph end in the middle of maths. Close the display, write the sentence, open the next one — which is also better typography. - Using
\text{…}as a row to insert prose. No error at all, which is why it survives review: the words land in the right-aligned column, hug the anchor from the left, and cannot break across the page.\intertextexists for exactly this. ! Package amsmath Error: Erroneous nesting of equation structures.—aligninsideequation, or twosplitblocks in one parent. Only one structure may own the tag; the things you nest inside it must be boxes.- Ending the last row with
\\. In a numbered alignment that opens an empty row and prints a second tag beside nothing; incasesorarrayit adds a blank row that widens the delimiter for no reason.
Questions about this lesson
What is the difference between align and aligned in LaTeX?
\label and \intertext, and may break across a page. aligned is a maths box with rows inside: it must sit in an existing display (or in $…$ while still one row), never numbers anything, and inherits the surrounding style, which is why its fractions print small. Everything else about them — the ampersand grammar, the alternating columns — is identical. Browser renderers implement only aligned, which is why copied align blocks come out as raw source on web pages.Why does alignat need a different number of ampersands than align?
\cr". align grows its column pairs as rows demand them, so the same row that errors in alignat is accepted there. The second difference is money: alignat supplies no horizontal glue between columns, so you must type \quad where the two halves should separate.How do I number only one line of a multi-line equation in LaTeX?
\begin{equation} and put the rows in \begin{split}: one counter step, one tag, centred against the block (load amsmath with the tbtags option to hang it on the last row instead). If the rows are separate statements that mostly do not deserve names, use align and type \notag (or \nonumber) at the end of each row you want silent, or \tag{3.7} to replace a number outright. Put \label only on rows that carry a number, and remember that \tag is an error inside the starred align*.How do I put a sentence between two lines of an aligned derivation in LaTeX?
\intertext{text} between the row-ending \ and the next row, in a top-level environment such as align or gather. It is set flush left across the display width, keeps the rows around it aligned, and consumes no equation number. \intertext* forbids a page break at that point, and mathtools adds \shortintertext for a tighter line with no tag. A row of \text{...} is not the same thing: it sits inside an alignment column, right-aligned against the anchor. None of the three exist in the box forms (aligned, split, gathered) or in browser renderers — there, close the block, write the sentence, open a new block.Why does my long equation jump to a new page and leave the previous one half empty?
\allowdisplaybreaks[1] to [4] grants permission with decreasing reluctance (the underlying register is \interdisplaylinepenalty), \* on a specific row forbids a break there, and \pagebreak[3] placed immediately before a \ invites one. The switch is global, so do the per-row control by hand — and usually just split the derivation into two displays with a sentence between them, since a chain that breaks mid-column loses the alignment that made it readable.How do I increase the vertical space between lines in align, gather or cases?
\jot, 6pt by default: \setlength{\jot}{9pt} in the preamble changes it everywhere, and \[8pt] on one row overrides it locally. cases, aligned, gathered and array do not obey \jot the same way — their rows come apart through \[...] and the array-related levers \arraystretch or \baselineskip inside the environment. Never use \vspace between maths rows: it is a text-mode skip and does nothing useful inside a display.Live playground: edit the LaTeX, see it render
The preview updates as you type — break it on purpose to see how errors look.
Keep reading
Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.