I want to get a subscript in math mode to be both regular text font and boldfaced. Neither of the following does the job:
Codes 1:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$a_\text{\textbf{b}}$
\end{document}
Codes 2:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$a_\mathbf{\text{b}}$
\end{document}
Best Answer
a_{\textbf{b}}
is what you want. The following example loads a different text font, for comparison with the maths, and compares this output with that froma\textsubscript{\textbf{b}}
in text mode, to show that the subscripts (but not, of course the 'a's) are the same. Finally, this is compared with some maths subscripts, just for comparison.The left shows the result with the suggested code. The next is the text-mode comparison (same 'b', different 'a'). Third is a simple maths subscript (same 'a', different 'b'). Finally, a maths-bold subscript (same 'a', different different 'b').