Superscript and subscript in text in LaTeX (textsuperscript, textsubscript)
\textsuperscript{...} raises text and \textsubscript{...} lowers it, both in the font of the surrounding text and without math mode.
Superscript
The argument is set smaller and raised. Use it for ordinals, abbreviations and marks.
The 1\textsuperscript{st} and the 2\textsuperscript{nd} place,
M\textsuperscript{me} Dupont, Product\textsuperscript{TM}Subscript
\textsubscript is part of LaTeX since 2015. Older installations need the fixltx2e package for it.
H\textsubscript{2}O, CO\textsubscript{2} and a value of x\textsubscript{max}Why not math mode
$^{th}$ sets the letters in the italic math font, as a product of the variables t and h. \textsuperscript{th} uses the text font and its letter spacing.
Text font: 10\textsuperscript{th}. Math font: 10$^{th}$.Units and chemical formulas
For square metres and for formulas such as CO2, the packages siunitx and mhchem raise and lower the characters themselves.
Complete document:
\documentclass{article}
\usepackage{siunitx}
\usepackage[version=4]{mhchem}
\begin{document}
A room of \qty{25}{\square\metre} and a bottle of \ce{CO2}.
\end{document}Pitfalls
^and_in normal text stop with Missing $ inserted. Exponents and indices in formulas are described in Exponents and subscripts in LaTeX.- Footnote numbers are raised automatically by
\footnote; do not build them by hand.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- How-to Exponents and subscripts in LaTeX
- How-to Chemical formulas and reactions in LaTeX
- How-to Footnotes in LaTeX
- How-to Units and numbers in LaTeX with siunitx
- Error Missing $ inserted
- Package
siunitx - Package
mhchem