LaTeX: Subscript
When using an underscore _ character to produce subscript formatting, use a math macro rather than a text macro. For example, \mathrm{} instead of \textrm{}.
Place the underscore in front of the math macro containing the subscript character.
If there are multiple adjacent characters, but only one is subscript, the subscript should be in a separate math macro, preceded by the underscore.
<tex-math notation="LaTeX"><![CDATA[$$\begin{equation}\mathrm{Z}_{\mathrm{i}}\end{equation}$$]]></tex-math>