Subscripts use the underscore character in LaTeX
To write a subscript in LaTeX, place an underscore (_) before the character or group of characters you want to appear below the baseline. If the subscript is a single character, type it directly after the underscore. If it is more than one character, wrap the subscript in curly braces.
The underscore tells LaTeX to treat whatever follows as a subscript and position it lower than the surrounding text. This works in both math mode (between dollar signs) and in some text contexts, though subscripts are most commonly used in mathematical expressions.
LaTeX will automatically adjust the size and spacing of subscripts to match the context. A subscript within a subscript becomes even smaller, and subscripts in displayed equations look different from subscripts in inline text.
Key Takeaways
- Use an underscore followed by a single character for a one-character subscript: x_1 produces x with a subscript 1.
- Wrap multi-character subscripts in curly braces to keep them together: x_{12} produces x with subscript 12, not x with subscript 1 followed by a separate 2.
- Subscripts work in math mode (between $ signs) and in text mode, but are most readable when used in mathematical expressions.
- You can nest subscripts and combine them with superscripts in the same expression: x_1^2 produces x with subscript 1 and superscript 2.
Single-character subscripts
When your subscript is just one letter or number, you can type it directly after the underscore without braces. For example, $x_1$ renders as x with a subscript 1. This is the simplest form and requires no extra punctuation.
Single-character subscripts are common in mathematics: $a_n$ for a sequence, $F_x$ for a force component, or $T_0$ for an initial temperature. LaTeX handles the spacing and sizing automatically.
Multi-character subscripts with curly braces
When your subscript contains more than one character, you must enclose it in curly braces. Without braces, LaTeX treats only the first character as the subscript and leaves the rest as regular text. For example, $x_{12}$ produces x with subscript 12, while $x_12$ produces x with subscript 1 followed by a separate 2.
Curly braces group the subscript together so LaTeX knows where it ends. This applies to numbers, letters, or any combination: $v_{max}$, $C_{n+1}$, or $\alpha_{ij}$ all work correctly because the content is wrapped in braces.
Subscripts in math mode versus text mode
Subscripts work most reliably inside math mode, which you enter by typing a dollar sign before and after the expression. For example, $x_1 = 5$ is math mode and renders clearly. Outside math mode, subscripts may not format correctly or may not work at all, depending on your LaTeX document class.
If you need a subscript in regular text (not an equation), wrap the entire subscripted expression in dollar signs: The variable $x_1$ represents the first measurement. This keeps the subscript properly formatted while the surrounding words remain in text mode.
Combining subscripts with superscripts
You can use both a subscript and a superscript on the same character. The order does not matter — $x_1^2$ and $x^2_1$ produce the same result: x with subscript 1 and superscript 2. LaTeX positions them correctly regardless of which you type first.
If either the subscript or superscript contains more than one character, use braces for that part: $x_{12}^{34}$ produces x with subscript 12 and superscript 34. You can also nest subscripts within subscripts, though this quickly becomes hard to read: $x_{y_1}$ produces x with a subscript of y with its own subscript 1.
Common subscript patterns in equations
Subscripts appear frequently in scientific and mathematical writing. Sequences use subscripts to denote position: $a_1, a_2, a_3, \ldots, a_n$. Matrix elements use double subscripts: $A_{ij}$ for the element in row i and column j. Partial derivatives use subscripts to show which variable you are differentiating with respect to: $\frac{\partial f}{\partial x_1}$.
Chemical formulas also use subscripts to show the number of atoms: $\text{H}_2\text{O}$ or $\text{CO}_2$. In this case, you may need to use the \text command to keep the letters in regular font rather than math italic.
Troubleshooting subscript problems
If your subscript does not appear or looks wrong, check whether you used braces correctly. The most common error is forgetting braces around multi-character subscripts. If you typed $x_12$ and only the 1 appeared as a subscript, add braces: $x_{12}$.
Another issue is using the underscore outside of math mode. In regular text, the underscore is a special character that LaTeX reserves for subscripts, so it may cause an error. Always wrap subscripted text in dollar signs. If you need a literal underscore in text (for example, in a file name), use \textunderscore or \_ instead.
Frequently Asked Questions
Do I need dollar signs around subscripts?
Yes, subscripts work reliably only in math mode, which you enter with dollar signs. A single pair of dollar signs around the entire expression is enough: $x_1 = 5$. Without them, LaTeX may not recognize the underscore as a subscript command.
What happens if I forget the curly braces around a multi-character subscript?
LaTeX treats only the first character after the underscore as the subscript. The remaining characters appear as regular text at the baseline. For example, $x_12$ looks like x₁2, not x₁₂. Always use braces for anything longer than one character: $x_{12}$.
Can I use subscripts in section headings or titles?
Yes, but wrap the subscripted part in dollar signs. For example, \section{The variable $x_1$ in our model} works correctly. Some document classes may require special handling, so test it in your document to make sure it renders as expected.
How do I make a subscript of a subscript?
Use nested braces: $x_{y_{z}}$ produces x with subscript y, and y has its own subscript z. This creates very small text and is hard to read, so use it sparingly. In most cases, a different notation (like $x_{yz}$) is clearer.
Can I use Greek letters or special symbols as subscripts?
Yes. Type the LaTeX command for the symbol inside the braces: $x_{\alpha}$ produces x with subscript α, and $A_{\infty}$ produces A with subscript ∞. The symbol is treated like any other character and positioned as a subscript.