Subscripts and superscripts are essential elements in mathematical notation, scientific formulas, and various other fields. LaTeX provides simple and powerful ways to create these elements, enhancing the readability and precision of your documents.
In LaTeX, you can create subscripts using the underscore (_) character and superscripts using the caret (^) character. These symbols are typically used within math mode.
To create a subscript, use the underscore followed by the subscript text:
$x_1$
This produces: x₁
For superscripts, use the caret symbol followed by the superscript text:
$x^2$
This produces: x²
When your subscript or superscript consists of multiple characters, enclose them in curly braces:
$x_{12}$ and $y^{a+b}$
This produces: x₁₂ and yᵃ⁺ᵇ
You can use both subscripts and superscripts on the same base character:
$x_1^2$
This produces: x₁²
The order of the subscript and superscript doesn't matter in LaTeX, but it's conventional to put the subscript first:
$x_1^2$ is equivalent to $x^2_1$
Subscripts and superscripts are frequently used in mathematical expressions:
$\sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6}$
They're also essential for representing chemical formulas:
H$_2$O, CO$_2$, Fe$_2$O$_3$
\textrm{}
command for non-mathematical text in subscripts or superscripts.For more complex mathematical expressions, LaTeX offers additional commands:
\sideset
: For multiple subscripts and superscripts on summation symbols.\substack
: For creating multi-line subscripts or superscripts.These advanced features are part of the AMS-LaTeX package, which provides enhanced mathematical typesetting capabilities.
Mastering subscripts and superscripts in LaTeX is crucial for creating professional-looking documents in mathematics, science, and engineering. With the syntax and examples provided here, you can effectively incorporate these elements into your LaTeX documents, enhancing their clarity and precision.