Subscripts are written in LaTeX using the underscore character followed by the character or expression you want to appear below the line
In LaTeX, a subscript is text or a number that appears smaller and lower than the baseline of regular text. The most common use is in mathematical notation — like writing H₂O for water or x₁ for the first value in a series. To create a subscript in LaTeX, you type an underscore (_) followed by the character or group of characters you want subscripted.
The basic syntax is straightforward: x_1 produces x with a subscript 1. If your subscript contains more than one character, you must wrap it in curly braces: x_{12} produces x with subscript 12, while x_12 would only subscript the 1 and leave the 2 at normal size. This distinction matters because LaTeX reads only the single character when ready after the underscore as the subscript unless you tell it otherwise with braces.
Key Takeaways
- Use the underscore character _ followed by a single character to create a subscript, or use curly braces _{} for multi-character subscripts.
- Subscripts work in both math mode (between dollar signs) and text mode, though they are most readable in math mode.
- You can combine subscripts with superscripts in the same expression by using both underscore and caret: x_1^2 creates x with subscript 1 and superscript 2.
- Common mistakes include forgetting braces for multi-character subscripts and using subscripts outside of math mode where they may not render correctly.
Subscripts in Math Mode Versus Text Mode
LaTeX has two main contexts where you write: math mode and text mode. Math mode is triggered by surrounding your content with single dollar signs ($...$) for inline math or double dollar signs ($$...$$) for displayed equations. Subscripts work in both, but they behave differently.
In math mode, subscripts are the standard way to write mathematical notation. The expression $x_1 + x_2 = y$ produces properly formatted mathematical subscripts that are smaller and positioned correctly. In text mode — regular writing outside of dollar signs — subscripts still work but may not render as cleanly depending on your font. For chemistry or mathematical writing, always use math mode: $H_2O$ looks professional, while H_2O without the dollar signs may appear misaligned or use a different font.
Writing Multi-Character and Complex Subscripts
When your subscript is more than one character long, you must use curly braces to group them. Without braces, LaTeX treats only the first character as the subscript. For example, x_ab produces x with only the letter a subscripted, leaving b at normal size. To subscript both, write x_{ab}.
This rule applies to numbers, letters, and symbols. The expression $a_{n+1}$ correctly subscripts the entire expression "n+1" because of the braces. If you wrote $a_n+1$, only the n would be subscripted and the +1 would appear at normal size. Subscripts can also contain other formatting: $x_{\text{max}}$ subscripts the word "max" in text font, useful when your subscript is a label rather than a variable.
Combining Subscripts with Superscripts
You often need both a subscript and a superscript on the same base character — for instance, writing x with subscript i and superscript 2. LaTeX lets you use both the underscore and the caret (^) in the same expression. The order does not matter: $x_i^2$ and $x^2_i$ produce the same result.
When combining them, use braces if either part is multi-character: $x_{i}^{2}$ works, as does $x_i^2$ since both subscript and superscript are single characters. But $x_{ij}^{2k}$ requires braces around both to keep "ij" together as the subscript and "2k" together as the superscript. Without braces, LaTeX would only subscript the i and superscript the 2, leaving j and k floating at normal size.
Common Mistakes and How to Fix Them
The most frequent error is forgetting braces on multi-character subscripts. If you write $x_12$ expecting x with subscript 12, you will get x with subscript 1 and a separate 2 at normal size. The fix is always to add braces: $x_{12}$.
Another common issue is using subscripts outside math mode and expecting them to look right. The command H_2O without dollar signs may render with incorrect spacing or font. Always wrap chemical formulas and mathematical notation in dollar signs. A third mistake is nesting subscripts — trying to subscript a subscript, like $x_{y_z}$ — which is rarely what you want and often produces confusing output. If you need nested structure, consider whether a different notation would be clearer.
Subscripts in Different Document Environments
Subscripts behave consistently across LaTeX document types — articles, reports, books, and presentations all use the same underscore syntax. However, the visual appearance may vary slightly depending on the font and document class you choose. In some fonts, subscripts are more compact; in others, they have more space around them.
In tables and special environments like arrays or matrices, subscripts work the same way. If you are writing a table with mathematical content, use math mode within the table cells and subscript as normal: $x_1$ inside a cell renders just as it would in regular text. In presentation software built on LaTeX (like Beamer), subscripts also work identically — the underscore syntax is universal across LaTeX contexts.
Frequently Asked Questions
Do I need dollar signs around subscripts?
Subscripts work without dollar signs in text mode, but they render much better inside math mode (between dollar signs). For any mathematical or scientific notation, use dollar signs: $x_1$ instead of x_1. The subscript will be properly sized and positioned.
What if I want a subscript that contains special characters or spaces?
Use curly braces and, if needed, the \text{} command. For example, $x_{\text{initial}}$ subscripts the word "initial" in regular text font. This is useful for labels that are not variables: $T_{\text{max}}$ for maximum temperature.
Can I have a subscript on a subscript?
Technically yes — $x_{y_z}$ is valid — but it is rarely readable and usually indicates you should use a different notation. If you need nested subscripts, consider whether a matrix, array, or different variable naming scheme would be clearer.
Why does my subscript look wrong in plain text?
You are likely writing outside math mode. LaTeX subscripts in text mode depend on your font and may not render correctly. Always use dollar signs for mathematical content: $H_2O$ instead of H_2O.
How do I subscript a fraction or complex expression?
Use braces to group the entire expression: $x_{a/b}$ subscripts the fraction a/b. For more complex expressions, keep everything inside the braces: $y_{n+1}$ or $z_{\sqrt{2}}$ both work as expected.