[Tex/LaTex] How to typeset subscript in usual text mode
subscripts
It's easy to make subscripts in math mode: $a_i$.
How do I make a subscript outside math environment, likethis?
Best Answer
Note that \textsubscript enters math mode as well. This might produce problems in PDF strings where math is not allowed, for instance in bookmarks. If you used hyperref and simply used \textsubscript in a section heading, hyperref would complain about the math shift. The command \texorpdfstring comes to the rescue:
Use \DeclareMathSizes{S}{t}{s}{ss}, which sets the math text font to size t, the scriptsize math font to size s, and the scriptscriptsize math font to ss whenever the main text font size is set to S.
\documentclass{article}
\usepackage{lmodern}
\DeclareMathSizes{7}{7}{5}{4} % \scriptsize is 7 pt
\DeclareMathSizes{5}{5}{3}{2} % \tiny is 5 pt
\begin{document}
\tracingmacros=2
{\tiny$(x_{i_1},y_{i_1})$} is in tiny font.
\noindent{\scriptsize$(x_{i_1},y_{i_1})$} is in scriptsize font.
\noindent$(x_{i_1},y_{i_1})$ is in normal font.
\end{document}
Don't overdo this, though: Tiny fonts can be really hard to read. There is a reason why the standard is \DeclareMathSizes{5}{5}{5}{5}. I.e., when \tiny is in effect (so the standard text font size is 5pt (assume 10pt in the main document) then all three math font sizes (text, script, scriptscript) will be 5pt. The thinking is probably that anything less than 5pt is unreadable.
Also, note my use of the lmodern package. The standard computer modern fonts don't have sizes that small, so the 5pt version is substituted even if you specify a smaller size.
You may also try with ~_{\bigtriangleup} or with \phantom{text}_{\bigtriangleup}. In the second case the width of text determines how much blank space will be left before the subscript.
Best Answer
Note that
\textsubscript
enters math mode as well. This might produce problems in PDF strings where math is not allowed, for instance in bookmarks. If you used hyperref and simply used\textsubscript
in a section heading, hyperref would complain about the math shift. The command\texorpdfstring
comes to the rescue:That applies to math and math symbols in sectioning headings of course as well.
Since 2015, LaTeX provides the fixltx2e features by default, so you can omit
\usepackage{fixltx2e}
then.