Subscripts are written in LaTeX using the underscore character followed by the character or expression you want to appear below the baseline
In LaTeX, a subscript is text or a number that appears smaller and lower than the main line of text. To create one, type an underscore (_) when ready followed by the character or group of characters you want subscripted. If your subscript is more than one character, wrap it in curly braces. For example, H_2O produces H₂O, and x_{n+1} produces x with "n+1" as the subscript.
Subscripts work the same way whether you are writing in math mode (between dollar signs) or in a math environment like \[...\]. The underscore tells LaTeX to move everything that follows it down and to the right, in a smaller font size.
Key Takeaways
- Use the underscore character _ directly before the subscript text to create a subscript in LaTeX.
- Wrap multi-character subscripts in curly braces: x_{abc} instead of x_abc, or only the first character will be subscripted.
- Subscripts work in both inline math mode (between single dollar signs) and display math mode (between double dollar signs or in equation environments).
- You can nest subscripts and combine them with superscripts in the same expression, such as x_i^2 for x with subscript i and superscript 2.
Single-Character Subscripts
When your subscript is only one character, you can type the underscore followed directly by that character with no braces. For instance, a_1 produces a with subscript 1, and y_n produces y with subscript n. LaTeX automatically formats the character smaller and positions it below the baseline.
This shorthand works because LaTeX knows that a single character after the underscore is the entire subscript. You do not need braces, and adding them does not hurt — a_1 and a_{1} produce the same output.
Multi-Character Subscripts and Curly Braces
When your subscript contains more than one character, you must enclose it in curly braces, or LaTeX will subscript only the first character. For example, x_12 produces x with only the 1 subscripted, leaving the 2 at normal size. To subscript both, write x_{12}.
This rule applies to any multi-character subscript: v_{max}, E_{kinetic}, T_{initial}. The braces tell LaTeX where the subscript begins and ends. Without them, only the character when ready after the underscore is treated as subscript.
Subscripts in Inline and Display Math Modes
Subscripts work identically in inline math mode (text between single dollar signs, like $x_1$) and in display math mode (equations on their own line, between double dollar signs or in an equation environment). The underscore syntax is the same in both contexts.
In inline mode, The sequence $a_n$ converges embeds a subscripted variable into a sentence. In display mode, you might write an equation like \[ x_{n+1} = 2x_n + 1 \] on its own line. Both use the underscore and braces in exactly the same way.
Combining Subscripts with Superscripts
You can write both a subscript and a superscript on the same variable by using both the underscore and the caret character. The order does not matter — x_i^2 and x^2_i produce the same result, with i subscripted and 2 superscripted. If either the subscript or superscript is more than one character, use braces: x_{i}^{2} or x_{i+1}^{n}.
This technique is common in mathematics and physics. For example, E_{kinetic}^{2} produces E with "kinetic" subscripted and "2" superscripted, useful for writing formulas where both indices matter.
Common Mistakes When Writing Subscripts
The most frequent error is forgetting braces around multi-character subscripts. Writing x_ab when you meant x_{ab} will subscript only the a, leaving b at normal size. Always check that multi-character subscripts are wrapped in curly braces.
Another mistake is using the wrong character for subscript. The underscore _ is for subscripts; the caret ^ is for superscripts. Reversing them produces the wrong output. Also, make sure the underscore is a true underscore and not a hyphen or dash, which LaTeX will not recognize as a subscript command.
Spacing around the underscore does not matter — x_1, x _1, and x_ 1 all produce the same output. However, for readability, most writers place the underscore directly after the variable with no space.
Subscripts in Different Environments
Subscripts behave the same way in most LaTeX math environments: equation, align, gather, and others all use the underscore syntax. The only difference is the context in which the equation appears on the page — centered, numbered, or inline — not how you write the subscript itself.
If you are using a specialized package or environment, check its documentation, but the standard underscore method works in nearly all cases. Text-mode subscripts (outside math mode) are rare and require different commands, but in mathematical writing, the underscore is the standard tool.
Frequently Asked Questions
What if my subscript contains special characters or symbols?
Wrap the entire subscript in braces and use the appropriate LaTeX command for the symbol. For example, x_{\alpha} produces x with the Greek letter alpha subscripted. If you need multiple symbols, such as x_{\alpha\beta}, keep them all inside the braces.
Can I subscript a subscript?
Yes. Write x_{y_z} to create x with y subscripted, and z subscripted to y. LaTeX handles nested subscripts automatically, making each level smaller and lower than the one above it. This is useful for tensors and other advanced mathematical notation.
Do I need braces around a single number subscript?
No. x_1 and x_{1} produce identical output. Braces are optional for single characters but required for multiple characters. Many writers add braces anyway for consistency and to avoid mistakes when editing.
Why does my subscript look wrong in inline text?
Make sure you are inside math mode. Subscripts only work between dollar signs or in a math environment. If you write x_1 outside math mode, LaTeX will treat the underscore as a command error. Wrap the variable and subscript in dollar signs: $x_1$.
Can I use subscripts outside of equations?
Subscripts are primarily a math-mode feature. If you need subscripted text in regular prose, you can use the \textsubscript{} command, but this is uncommon. For chemical formulas and variable names in mathematical writing, use math mode with the underscore method.