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 text. To create one, type an underscore (_) followed by the character or group you want subscripted. If your subscript is more than one character, wrap it in curly braces: x_{2} produces x with a subscript 2, and H_{2}O produces the chemical formula for water with the 2 subscripted.
Subscripts work in both text mode and math mode, though they are most commonly used inside math environments like $...$ (inline math) or \[...\] (display math). Outside of math mode, subscripts may not render as expected in all LaTeX compilers.
Key Takeaways
- Use the underscore character _ followed by a single character or a group in curly braces to create a subscript.
- Single characters after the underscore do not need braces, but multiple characters or complex expressions must be wrapped in {}.
- Subscripts work best inside math mode environments like $...$ or \[...\].
- You can nest subscripts and combine them with superscripts in the same expression.
Single-Character Subscripts
When your subscript is just one character, you can type the underscore directly followed by that character without braces. For example, $x_1$ produces x with a subscript 1. This works for letters, numbers, and single symbols.
LaTeX automatically handles the spacing and sizing. The subscripted character appears smaller and positioned lower than the baseline of the main text. This is the simplest form and requires no additional syntax.
Multi-Character and Complex Subscripts
When your subscript contains more than one character, you must enclose it in curly braces. For example, $x_{12}$ produces x with subscript 12, while $x_12$ would produce x with subscript 1 followed by a regular 2 outside the subscript. The braces tell LaTeX to treat everything inside as a single subscript unit.
Complex subscripts can include letters, numbers, and operators. For instance, $a_{n+1}$ creates a subscript containing n+1, and $T_{max}$ creates a subscript with the word "max". Always use braces when your subscript is anything other than a single character.
Subscripts in Math Mode
Subscripts are most reliable when used inside math mode. Inline math mode, created with $...$, keeps the subscript on the same line as surrounding text. Display math mode, created with \[...\] or the equation* environment, places the subscript in a centered block.
Inside math mode, LaTeX automatically adjusts font size and spacing for subscripts. This is why $x_1$ looks correct but typing x_1 in regular text may not render as a subscript at all, depending on your document class and packages.
Combining Subscripts with Superscripts
You can use both subscripts and superscripts on the same base character. The order does not matter — $x_2^3$ and $x^3_2$ both produce x with subscript 2 and superscript 3. LaTeX positions them correctly on either side of the base character.
If either the subscript or superscript is more than one character, use braces: $x_{12}^{34}$. This prevents LaTeX from misinterpreting where one subscript ends and the next character begins.
Subscripts in Different Environments
Subscripts behave slightly differently depending on the environment. In inline math ($...$), subscripts are positioned to the right and slightly below the base character. In display math or equation environments, subscripts may be positioned directly below the base character, especially for large operators like summation or integration signs.
In text mode outside math environments, subscripts do not work reliably. If you need subscripts in regular text, use the \textsubscript{} command from the fixltx2e package, though this is less common and produces a different visual style than math-mode subscripts.
Common Mistakes and How to Fix Them
The most frequent error is forgetting braces around multi-character subscripts. Writing $x_12$ instead of $x_{12}$ produces x₁ followed by 2, not x with subscript 12. Always use braces when your subscript is more than one character.
Another mistake is using subscripts outside math mode. Typing x_1 in regular paragraph text will not produce a subscript; it will either display as x_1 or cause a compilation error, depending on your setup. Always wrap subscripts in $...$ or another math environment.
Frequently Asked Questions
Do I need braces around a single number subscript?
No. Single characters do not require braces. $x_1$ works fine. Braces are only necessary when your subscript contains more than one character or when you want to be extra clear about grouping.
Can I use subscripts in the document title or section headings?
Yes, but you must be inside math mode. Use $x_1$ in your heading text. Some heading commands are fragile and may require you to protect the math with \protect, so if you encounter errors, try \protect$x_1$.
What is the difference between subscripts in inline and display math?
Inline math keeps subscripts on the baseline for readability in paragraphs. Display math may position subscripts directly below the base character for clarity. The visual difference is automatic and depends on the environment, not on your code.
How do I create a subscript of a subscript?
Use nested braces: $x_{1_{2}}$. The inner braces create a subscript of the subscript. This is rarely needed but works if your notation requires it.
Why does my subscript look wrong in my PDF?
Check that your subscript is inside math mode (between $ signs or in an equation environment). If it is outside math mode, LaTeX may not render it as a subscript. Also verify that multi-character subscripts are wrapped in braces.