Tx · LaTeX & TikZ

How to Fix “Misplaced Alignment Tab Character &” in LaTeX

Published By the 9to5Science editorial team

At a glance

  1. 1. Find the ampersand

    Check the reported line and nearby source for an unescaped &.

  2. 2. Escape literal symbols

    Write \& wherever you want a printed ampersand in ordinary text or a cell.

  3. 3. Check table columns

    Inside tabular or longtable, use & only between cells and match the declared number of columns.

  4. 4. Rebuild generated files

    If the error comes from a nomenclature, fix its source entry and regenerate the list.

The error Misplaced alignment tab character & means LaTeX encountered an ampersand where it was not expecting a table or alignment separator. In ordinary prose, the usual fix is to write \& instead of &. In a table, an unescaped & separates cells, so the fix may instead be to correct the table structure or the number of columns.

What the ampersand means

In environments such as tabular, longtable, and align, & marks a boundary between columns. For example, this table has two columns and therefore one separator on each row:

\begin{tabular}{ll}
Name & Department \\
Ada Lovelace & Research \& Development \\
\end{tabular}

The first & on each row separates the two cells. The \& in Research \& Development prints an ampersand inside a cell instead of starting a third cell.

Outside an alignment environment, a bare & is not a way to print the character. Use \& in normal text, headings, captions, and most command arguments that contain ordinary text:

Research \& Development

A minimal working example

This complete document compiles with a standard LaTeX installation and shows the difference between a literal ampersand in text and a column separator in a table:

\documentclass{article}

\begin{document}

In the text, write Research \& Development.

\begin{tabular}{ll}
Name & Department \\
Ada Lovelace & Research \& Development \\
\end{tabular}

\end{document}

The column specification {ll} declares two left-aligned columns. Each row has exactly one unescaped & to divide those columns. The \\ ends a row; it is not interchangeable with &.

Check the table structure

If the ampersand is inside tabular or longtable, count the columns in the environment’s column specification. A table declared with three columns, such as {lll}, normally needs two unescaped ampersands in a row that fills all three columns. Any extra ampersand is interpreted as another cell boundary, even if you intended it to be printed.

For example, this row has three cells:

\begin{tabular}{lll}
Name & Field & Year \\
\end{tabular}

To show an ampersand in one of those cells, escape it, as in R\&D. The same rule applies to longtable; it uses the same column-separation syntax as tabular, even though it can span pages.

A row with too many separators may produce a different message, such as Extra alignment tab has been changed to \\. That usually means the row contains more unescaped ampersands than the declared columns allow. A row with fewer separators can leave trailing cells blank; if a separator was omitted by mistake, content may end up in the wrong cell.

If the error involves a nomenclature

A nomenclature entry is written in your source using a command such as \nomenclature{symbol}{description}. If you want a literal ampersand in ordinary text in either argument, escape it there too. For instance, a description containing “Research & Development” should use Research \& Development in the source.

The nomenclature package writes entries to auxiliary files and later generates a printed list. Fix the entry in your main .tex source rather than editing the generated list file. Then rerun the nomenclature-generation step and compile again as required by your LaTeX setup. If the source is already corrected but an old generated file still triggers the error, remove the relevant generated auxiliary files and rebuild the document and nomenclature.

An ampersand can also be present in a macro or included file, so the line LaTeX reports is not always the exact place where you typed it. Check the surrounding source, included files, and any recently changed table or nomenclature entries.

Common mistakes

  • Using & for punctuation in prose: Write \& when you want the printed symbol.
  • Escaping a real column separator: Inside a table, keep the unescaped & that divides cells; escape only ampersands meant to appear as text.
  • Declaring the wrong number of columns: Compare each row’s unescaped separators with the column specification.
  • Editing an auxiliary file: Correct the original entry or table in the .tex source, then regenerate derived files.
  • Changing every ampersand blindly: Some commands, such as URL-handling commands, have their own rules for special characters. Follow the command’s syntax rather than altering characters inside it without checking.

When the reported line looks correct, search the project for every &, including files brought in with \input or \include. Decide for each occurrence whether it is a cell separator or a printed symbol; that distinction usually reveals the problem.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.