Underleaf Logo
Underleaf
AboutPricingBlog
Log InGet started

LaTeX Subscripts and Superscripts: Complete Guide

December 27, 2025

LaTeX Subscripts and Superscripts: Complete Guide

Subscripts and superscripts are fundamental to mathematical and scientific writing in LaTeX. This comprehensive guide covers everything from basic syntax to advanced techniques for complex indices, nested scripts, and field-specific notation.

Basic Subscript and Superscript Syntax

In LaTeX, subscripts use the underscore _ and superscripts use the caret ^:

Single Character Scripts

Both Subscript and Superscript

The order doesn’t matter: x_i^2 and x^2_i produce the same result.

Multi-Character Subscripts and Superscripts

When your subscript or superscript has multiple characters, wrap them in curly braces { }:

Without braces, only the first character is affected:

Nested Subscripts and Superscripts

You can nest subscripts and superscripts by using additional _ and ^ within braces:

Subscripts on Subscripts

Superscripts on Superscripts

Mixed Nesting

Limits, Sums, and Integrals

Subscripts and superscripts are crucial for notation involving sums, products, integrals, and limits:

Summation

Product

Integrals

Limits

Text in Subscripts and Superscripts

For multi-letter text (not variables), use \text{} or \mathrm{}:

Without \text, letters are treated as separate variables:

Primes and Derivatives

Prime notation uses the apostrophe ' which is treated as a superscript:

Combining primes with other superscripts:

Tensor Notation

Tensors often require both upper and lower indices (contravariant and covariant):

Einstein Summation

Chemical Formulas

Subscripts are essential for chemical notation. Use text mode for the subscripts:

Matrix and Vector Indices

Matrix Elements

Vector Components

Sequences and Series

Best Practices

  • Use braces for multiple characters: Always use x_{i+1} not x_i+1
  • Text in subscripts: Use \text{} for words like x_ ext{max}
  • Consistent notation: If using x_i, don’t switch to y_j without reason
  • Avoid excessive nesting: More than 2-3 levels becomes hard to read
  • Order matters sometimes: In tensors, T^a_b is different from T_b^a
  • Spacing: LaTeX handles spacing automatically, but use \, if needed for clarity

Common Commands Reference

  • _ - Subscript
  • ^ - Superscript
  • _{ } - Multi-character subscript
  • ^{ } - Multi-character superscript
  • \text{} - Text mode in math
  • ' - Prime (treated as superscript)
  • \ldots - Ellipsis for sequences
  • \sum_{ }^{ } - Summation with limits
  • \int_{ }^{ } - Integral with limits
  • \lim_{ } - Limit

Field-Specific Examples

Physics: Kinematics

Computer Science: Big O Notation

Statistics: Expected Value

Linear Algebra: Eigenvalues

Mastering subscripts and superscripts is essential for any technical or scientific writing in LaTeX. Whether you’re working with simple indices, complex tensor notation, or chemical formulas, these techniques will help you create clear and professional documents. Remember to use braces for multi-character scripts, text mode for words, and maintain consistency throughout your work.

Underleaf Logo
Underleaf

Empowering students and researchers with AI-powered tools for academic writing.

Go to appContact us

Company

PricingBlogLearnAffiliate Program

Free Tools

Image to LaTeXExcel to LaTeXArXiv to LaTeXTikZ GeneratorThesis GeneratorOverleaf Chrome ExtensionAll Tools

© 2026 Underleaf. All rights reserved.