Subscripts use _, superscripts use ^. Both take exactly one token unless you give them braces — and that single-token rule is responsible for almost every mis-rendered formula people paste into a converter. Once the index is understood as a group rather than a character, everything else on this page follows: stacking both marks, nesting one index inside another, and the bounds on a big operator. Summation applies the same rule to sigma, Limits to lim, and Align to whole lines.
Which one to use
x^2, a_ix^{10}, a_{ij}x_i^2\sum_{i=1}^{n}x_{i_j}The commands
a_1
a_{12}
x^{2n+1}
x_i^2
e^{-x^2}
a_{b_{c}}
{}^5_2\mathrm{He}
f'(x) \qquad f''(x)
Worked examples
The brace rule in one line
x^10 \quad \text{versus} \quad x^{10}
The first prints x¹0. Two characters, one token.
A sum with both bounds
\sum_{i=1}^{n} i^2
On a big operator in display maths the bounds go above and below; inline they sit to the side.
Function with a subscripted argument
f(x_0) = y_0
The subscript belongs to the x, not to the whole parenthesis.
Common mistakes
a_12whena_{12}was meant. This is the most frequent LaTeX error in transcribed maths.- Putting
^before a group with nothing to attach to, e.g. starting a line with^2. Prefix an empty group{}^2. - Using
\limitsin inline maths and wondering why nothing moves — the bounds are already to the side by design there. - Mixing a subscript on an operator with a subscript on its argument:
\sum_i a_iis two different things both using_, and braces keep them straight.
Questions about this notation
Why does my exponent only highlight the first digit?
How do I force subscript limits under a sum sign?
\limits explicitly: \sum\limits_{i=1}^n.Can a subscript be a word?
\text{max}}. Use \text{} so the word is set upright rather than as a product of italic variables.How do I stack a subscript and a superscript, or put a subscript on a subscript?
x_i^2, in either order. A script on a script shrinks again, so x_{i_1} is legal but hard to read — x_{i,1} with a comma is the form most journals prefer. Under an operator such as sum or lim the two go one above the other in display maths and beside it in inline maths; \limits and \nolimits force either.Keep reading
Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.