LaTeX error: Double subscript (and Double superscript)
In math mode, each symbol can carry one subscript and one superscript. x_1_2 asks for two subscripts on the same x, which TeX cannot typeset, so it stops. x^2^3 gives the matching "Double superscript" error.
! Double subscript.
Try it: this example has the error
Edit the example using the steps below, then press Compile. What pdfTeX printed for it:
! Double subscript.
l.3 $x_1_
2$
Ready. Press Compile (or Ctrl/Cmd + Enter).
Common causes
- Chained subscripts written without braces:
a_i_j. - A prime and a superscript together in an unexpected order, such as
f^2'. - A subscript macro (
\subfrom a style file) applied twice.
How to fix it
- Group the whole index:
x_{1,2}ora_{ij}. - For a subscript on a subscripted symbol, add braces:
{x_1}_2. - For powers, group them:
x^{2^3}or(x^2)^3.
The fixed example
\documentclass{article}
\begin{document}
$x_{1,2}$ and ${x_1}_2$
\end{document}