gather vs gathered in LaTeX — Which One You Actually Want

They look like the same environment with a suffix, and the documentation tends to describe them in terms of “inner” and “outer” mode, which doesn’t help much when you just want your equations to line up. Here’s the short version:

gather stands on its own and numbers every line. gathered lives inside something else and has no numbers of its own. That single difference explains everything else.

Both need amsmath.

gather — several equations, several numbers

Use it where you’d use equation, in the flow of your text. Each line gets centered and numbered separately:

\begin{gather}
  E = mc^2 \\
  F = ma
\end{gather}

That produces two equations with two numbers. You can suppress one with \notag, label them individually, and use gather* if you want none of them numbered.

What you cannot do is put it inside another math environment. gather expects to be at the top level, and nesting it will get you a math delimiter error.

gathered — one block, one number

gathered is a building block. It has to sit inside a math environment, and it borrows that environment’s numbering:

\begin{equation}
  \begin{gathered}
    E = mc^2 \\
    F = ma
  \end{gathered}
\end{equation}

Same two lines, but now one number for the pair, placed beside the block as a whole. That’s usually the reason people reach for it: two or three lines that belong together conceptually and shouldn’t be numbered separately.

Used on its own, outside math mode, it will fail — typically with a missing-$ complaint, since TeX hits math content where it expected text.

The thing only gathered can do

Because it’s a box rather than a full-width display, gathered takes an optional vertical alignment argument — [t], [c], or [b] — and can be placed next to other material.

\[
  \left\{
  \begin{gathered}[t]
    x + y = 1 \\
    x - y = 3
  \end{gathered}
  \right.
\]

Two gathered blocks can also sit side by side in one display, aligned at their tops or bottoms. gather can do none of this — it always occupies the full width.

You might want gather* instead

A common detour: someone wants a few unnumbered equations stacked up, reaches for gathered, and then has to wrap it in \[ ... \] to make it work. That detour exists because gather* was the answer all along.

Reach for gathered when you need the block to share a number with its parent, or when it has to sit inside something else. If you just want no numbers, the starred form is simpler.

The same pattern, everywhere

Once you see it, amsmath gets much easier to remember. The -ed suffix always means “the inner version of this”:

  • gather / gathered — centered lines
  • align / aligned — lines aligned at &
  • alignat / alignedat — same, with manual column spacing

And split is the special case: an inner environment like aligned, but designed specifically to break a single equation across lines under one number.

Deciding in one step

Ask how many equation numbers you want.

  • One per line → gather
  • None → gather*
  • One for the whole block → equation + gathered
  • It needs to fit inside a brace, a cell, or beside something else → gathered

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *