I am trying to use subscripts within a fraction. Using them each on their own works fine, like this:
\documentclass{article}
\usepackage{fixltx2e}
\usepackage{hyperref}
\usepackage{amsmath}
\begin{document}
\texorpdfstring{n\textsubscript{subscript}} \\ \\
\( \frac{n}{2} \) \\ \\
\end{document}
I get the desired result:
However, when I combine them into
\( \frac{\texorpdfstring{n\textsubscript{subscript}} }{2} \)
I get the following error:
/Users/niklas/workspace/udemy_tex/my_ownfile/test.tex:15: Extra }, or forgotten \endgroup.
\frac #1#2->{\begingroup #1\endgroup \@@over #2}
l.15 ...pdfstring{n\textsubscript{subscript}} }{2}
How can this be done?


\texorpdfstring? In math mode you should consider just switchin ton_{\text{subscript}}. – TeXnician Feb 14 '17 at 08:01\( \frac{n_{\text{subscript}}}{2} \)should be preferred. – NiklasR Feb 14 '17 at 08:24