Double subscript.

Two _ (or two ^) apply to the same symbol, as in x_i_j. Group them with braces: x_{i_j} or x_{ij}, x^{2^3} or {x^2}^3.

Help centre › LaTeX errors › Maths · Error: the build stops or the output is wrong

What the log says

! Double subscript.
l.3 The entry $x_i_
                   j$ is positive.
I treat `x_1_2' essentially like `x_1{}_2'.

Also printed as: Double superscript.

What it means

A symbol can have one subscript and one superscript. TeX found a second _ (or a second ^) for the same symbol and does not know whether you meant a subscript on the subscript or two side by side. Braces say which you meant.

Causes and fixes

Most common first. Each example is a complete document; the first fails with this message, the second is the same document fixed.

1. Two subscripts or two superscripts in a row

Write x_{ij} for side-by-side indices, x_{i_j} for a subscript on the subscript, and x^{2^3} or {x^2}^3 for nested powers.

Fails
\documentclass{article}
\begin{document}
The entry $x_i_j$ is positive.
\end{document}
Fixed
\documentclass{article}
\begin{document}
The entry $x_{ij}$ is positive.
\end{document}

2. A prime written after a superscript

A prime ' is itself a superscript, so f^2' has two. Put the prime first: f'^2, or write {f^2}'.

Fails
\documentclass{article}
\begin{document}
We need $f^2'$ here.
\end{document}
Fixed
\documentclass{article}
\begin{document}
We need $f'^2$ here.
\end{document}

3. A macro that already contains a subscript

If \vx is defined as x_1, then \vx_2 is x_1_2. Brace the macro when you index it, {\vx}_2, or define it with braces: \newcommand{\vx}{{x_1}}.

Fails
\documentclass{article}
\newcommand{\vx}{x_1}
\begin{document}
Then $\vx_2 = 0$.
\end{document}
Fixed
\documentclass{article}
\newcommand{\vx}{x_1}
\begin{document}
Then \( {\vx}_2 = 0 \).
\end{document}

In Manulyx

The editor shows the error beside the line with an explanation, and the compile log is parsed into a list of problems.

Write in Manulyx for free · Journal templates

More in maths

  • Missing $ inserted.A maths-only character or command (_ ^ \alpha) appeared in text, or text appeared in maths. Wrap the maths in $ … $ or escape the character.
  • Missing \right. inserted.A \left has no matching \right in the same formula or line, or a \right has no \left. Pair them, or use \right. / \left. as invisible partners.
  • Display math should end with $$.A displayed equation was closed with a single $ or a $ appeared inside it. Use \[ … \] or an equation environment, and no $ inside.
  • LaTeX Error: Bad math environment delimiter.\[ or \( was used inside maths, or \] or \) without its opening. Close one formula before opening the next, and pair each delimiter.

Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors