Mathematical Typesetting
How to Add Subscripts and Superscripts in LaTeX
Subscripts and superscripts are fundamental to mathematical and scientific notation. LaTeX makes them simple.
Basic Subscript
Use underscore _ for subscripts:
$x_1$
$a_i$
$H_2O$Basic Superscript
Use caret ^ for superscripts:
$x^2$
$e^x$
$a^{n+1}$Multiple Characters
Use braces for more than one character:
$x_{12}$ % subscript 12
$x^{2n}$ % superscript 2n
$a_{i,j}$ % subscript i,jBoth Together
Combine subscripts and superscripts:
$x_1^2$ % x₁²
$\sum_{i=1}^{n}$ % summation
$\int_0^\infty$ % integralNested Scripts
Scripts can be nested:
$e^{x^2}$ % e to the (x squared)
$a_{b_c}$ % a subscript (b subscript c)💡 Tips
- •Always use {} for multi-character subscripts/superscripts
- •For text in subscripts, use $x_{\text{max}}$ (needs amsmath)
- •In text mode, use \textsubscript{} and \textsuperscript{}
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing Free