Subscript in LaTeX text mode

It’s an easy task to write subscripts in LaTeX math mode with this _. But This technique did not work in text mode. So in this tutorial, I will show you various methods to write subscript in LaTeX text mode.

PackageCommandOutput
NoneU$_{\text{a}}$Uₐ
NoneU\textsubscript{a}Uₐ
mhchem\ce{U_{a}}Uₐ

Let’s see some examples for a better understanding.

\documentclass{article}
\usepackage{mhchem}
\begin{document}

\verb|$like_{this}$| $\rightarrow$ $like_{this}$
\\[4pt]
\verb|like$_{\text{this}}$| $\rightarrow$ like$_{\text{this}}$
\\[4pt]
\verb|like\textsubscript{this}| $\rightarrow$ like\textsubscript{this}
\\[4pt]
\verb|\ce{like_{this}}| $\rightarrow$ \ce{like_{this}}
\\[4pt]
\verb|\ce{like_{this\ and\ this}}| $\rightarrow$ \ce{like_{this\ and\ this}}

\end{document}

Output:

Subscript in LaTeX text mode.

Leave a Reply

Your email address will not be published. Required fields are marked *