Superscript and Subscripts
Last updated
Last updated
The use of superscripts and subscripts is very common in mathematical expressions involving exponents, indexes, and in some special operators. This article explains how to write superscripts and subscripts in simple expressions, integrals, summations and so forth.
Definite integrals are some of the most common mathematical expressions, so let's see an example:
This LaTeX code produces:
By convention, superscripts and subscripts in LATEX are created using the characters ^
and _
respectively; for example, the exponents applied to xx and yy in the code fragment above. Those characters can also be used with mathematical symbols, such as the integral (\int
) included in the example above where _
is used to set the lower limit and the ^
for the upper limit.
The command \limits
changes the way the limits are displayed in the integral, if not present the limits would be next to the integral symbol instead of being on top and bottom:
This LaTeX code produces:
The symbols _
and ^
can also be combined in the same expression, for example:
This LaTeX code produces:
If the expression contains long superscripts or subscripts, these need to be collected in braces, as LATEX normally applies the mathematical commands ^
and _
only to the following character:
This LaTeX code produces:
Subscripts and superscripts can be nested and combined in various ways. When nesting subscripts/superscripts, however, remember that each command must refer to a single element; this can be a single letter or number, as in the examples above, or a more complex mathematical expression collected in braces or brackets. For example:
This LaTeX code produces:
Some mathematical operators may require subscripts and superscripts. The most frequent cases are those of the integral \int
(check the introduction) and the summation (\sum
) operators, whose bounds are typeset precisely with subscripts and superscripts.
This LaTeX code produces: