Subscript basics in LaTeX

In LaTeX, you create a subscript by typing an underscore followed by the character or characters you want to appear below the line. For a single character, write H_2O to get H with a 2 subscripted. For multiple characters or more complex subscripts, wrap them in curly braces: x_{n+1} produces x with n+1 as the subscript.

Subscripts work in both math mode and text mode, though they behave differently. In math mode (between dollar signs or in equation environments), subscripts appear directly below the variable. In text mode, they appear slightly lower but remain on the baseline. Most scientific and technical writing uses math mode for subscripts because the formatting is clearer.

Key Takeaways

  • Use an underscore followed by the subscript character or wrap multiple characters in curly braces: x_2 or x_{n+1}.
  • Subscripts in math mode (between dollar signs) display below the baseline; subscripts in text mode display slightly lower but stay on the line.
  • Curly braces are required whenever your subscript contains more than one character, a space, or special symbols.
  • You can nest subscripts and combine them with superscripts in the same expression: x_i^2 creates x with subscript i and superscript 2.

Single versus multiple character subscripts

A single character subscript does not need braces. Type a_1 and LaTeX renders it correctly as a with subscript 1. However, if you try a_12, LaTeX treats only the 1 as the subscript and leaves the 2 in normal size, producing a₁2 instead of a₁₂.

To subscript multiple characters, always use curly braces. Write a_{12} to get both digits as subscripts. This rule applies to any subscript longer than one character: x_{max}, C_{H2O}, or v_{initial} all require braces. Without them, only the first character becomes a subscript.

Subscripts in math mode versus text mode

Math mode is the standard environment for subscripts in LaTeX. Inline math mode uses single dollar signs: $x_2$. Display math mode uses double dollar signs or the equation environment. In both cases, subscripts appear directly below the variable in a smaller font.

Text mode subscripts use the same underscore syntax but produce a different visual result. Type H\textsubscript{2}O in text mode to get a subscript that stays closer to the baseline. This command requires the fixltx2e package in older LaTeX versions, though modern distributions include it by default. For most documents, math mode subscripts are preferred because they scale properly and align consistently with other mathematical notation.

Combining subscripts with superscripts

You can write both a subscript and superscript on the same variable. The order does not matter: x_i^2 and x^2_i produce the same result, with i subscripted and 2 superscripted. LaTeX positions them automatically so they do not overlap.

For complex expressions, use braces around each modifier. Write x_{i,j}^{2} to subscript both i and j, then superscript 2. If you have nested or stacked subscripts, keep each level in its own braces: x_{y_z} creates x with y subscripted, and z subscripted to y.

Common subscript mistakes and how to avoid them

The most frequent error is forgetting braces on multi-character subscripts. LaTeX will not warn you—it simply subscripts only the first character and leaves the rest normal size. Always use braces when your subscript contains more than one character, a space, or any operator like + or −.

Another mistake is using a hyphen instead of an underscore. The hyphen produces a minus sign in math mode, not a subscript. Check that you are using the underscore key (Shift + hyphen on most keyboards), not a dash character. If your subscript contains special symbols like Greek letters, wrap them in braces and use the correct LaTeX command: x_{\alpha} for x with alpha subscripted.

Subscripts in different LaTeX environments

Subscripts work the same way in inline math, display math, and equation environments. In an equation array or align environment, use the same underscore syntax within each cell. If you are writing a subscript in a table cell, make sure you are in math mode (between dollar signs) or use the \textsubscript command for text mode.

In section titles, figure captions, or other text-heavy areas, subscripts may not display correctly without math mode delimiters. Wrap them in dollar signs: The H$_2$O molecule ensures the subscript renders properly. Some LaTeX packages like siunitx provide specialized commands for chemical formulas and units that handle subscripts automatically.

Frequently Asked Questions

Do I need braces for a subscript that is just a number?

No, single digits do not need braces. Type x_1 or a_9 and LaTeX handles it correctly. Use braces only when your subscript has more than one character, such as x_{12} or v_{max}.

What is the difference between underscore and the \textsubscript command?

The underscore method works in math mode and is the standard for equations. The \textsubscript command works in text mode and keeps the subscript on the baseline rather than below it. Use underscore for math, \textsubscript for text-only subscripts like trademark symbols or footnote markers.

Can I subscript a subscript?

Yes, you can nest subscripts using multiple levels of braces. Write x_{y_z} to subscript y to x, then subscript z to y. Each level appears smaller and lower than the one above it.

Why does my subscript look wrong in the output?

Check that you used an underscore, not a hyphen or dash. Verify that multi-character subscripts are wrapped in braces. If you are in text mode, use \textsubscript instead of the underscore method, or switch to math mode with dollar signs.

How do I subscript text that contains spaces or operators?

Wrap the entire subscript in braces and use the correct LaTeX syntax. For spaces, use x_{max\ value} with a backslash before the space. For operators, write x_{n+1} or x_{i-1} inside the braces, and LaTeX formats them correctly.