Mathematical Expressions
Document Structure
How to Use Superscripts and Subscripts in LaTeX
Subscripts and superscripts are essential for mathematical notation, chemical formulas, and academic writing. This guide covers all the methods for creating sub and superscripts in LaTeX, both in math mode and text mode.
Basic Math Mode Usage
In math mode, use _
for subscripts and ^
for superscripts:
x_i^2
For expressions with multiple characters, use curly braces to group them:
x_{i+1}
Common Applications
- Mathematical sequences:
a_1, a_2, \ldots, a_n
- Chemical formulas:
H_2O, CO_2
- Powers and exponents:
e^{x^2}
Text Mode Options
For subscripts and superscripts in regular text, use the \textsuperscript
and \textsubscript
commands.
Note: \textsubscript requires the subscript package: \usepackage{subscript}
Command Reference
Command | Use Case | Mode |
---|---|---|
_ | Subscripts | Math mode |
^ | Superscripts | Math mode |
\textsuperscript | Superscripts | Text mode |
\textsubscript | Subscripts | Text mode |
Advanced Techniques
Multiple levels of subscripts and superscripts:
x_{i_{j}}^{2^n}
Side-by-side sub/superscripts:
{}_{b}^{a}X
Best Practices
- Always use curly braces for multi-character sub/superscripts
- Use math mode for mathematical expressions, even within text
- Consider readability when nesting multiple levels
- Use \textsubscript and \textsuperscript for non-mathematical content
- Be consistent with spacing around operators and relations