Getting Started
Text Formatting
Mathematical Expressions
Document Structure
Page Layout
Accessibility
Errors & Troubleshooting
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.
Quick answer
In math mode, use ^ for a superscript and _ for a subscript: $x^2$ and $x_i$. Group more than one character with braces:$x_{i+1}^{n-1}$.
Basic Math Mode Usage
In math mode, use _ for subscripts and ^ for superscripts:
x_{i+1}Common Applications
- Mathematical sequences:
- Chemical formulas:
- Powers and exponents:
Text Mode Options
For subscripts and superscripts in regular text, use the \textsuperscript and \textsubscript commands.
\textsubscript{} has been part of the standard LaTeX kernel since 2015, so current TeX installations do not need a subscript package. Only very old installations require a compatibility package.Common superscript and subscript errors
- Missing $ inserted:
^and_are math syntax. Put the expression inside$...$,\(...\), or a display-math environment. - Double superscript: write
x^{2^n}, notx^2^n. Braces tell LaTeX which exponent belongs inside the other. - Only one character is raised or lowered: write
x_{total}rather thanx_total. - For chemical formulas in running text, consider the
mhchempackage instead of manually switching in and out of math mode.
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:
Side-by-side sub/superscripts:
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
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.
Quick answer
In math mode, use ^ for a superscript and _ for a subscript: $x^2$ and $x_i$. Group more than one character with braces:$x_{i+1}^{n-1}$.
Basic Math Mode Usage
In math mode, use _ for subscripts and ^ for superscripts:
x_{i+1}Common Applications
- Mathematical sequences:
- Chemical formulas:
- Powers and exponents:
Text Mode Options
For subscripts and superscripts in regular text, use the \textsuperscript and \textsubscript commands.
\textsubscript{} has been part of the standard LaTeX kernel since 2015, so current TeX installations do not need a subscript package. Only very old installations require a compatibility package.Common superscript and subscript errors
- Missing $ inserted:
^and_are math syntax. Put the expression inside$...$,\(...\), or a display-math environment. - Double superscript: write
x^{2^n}, notx^2^n. Braces tell LaTeX which exponent belongs inside the other. - Only one character is raised or lowered: write
x_{total}rather thanx_total. - For chemical formulas in running text, consider the
mhchempackage instead of manually switching in and out of math mode.
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:
Side-by-side sub/superscripts:
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
Getting Started
Text Formatting
Mathematical Expressions
Document Structure
Page Layout
Accessibility
Errors & Troubleshooting
