1

I've had a look at the other double subscript error questions here and they don't seen to solve my error. When I simplify what I want the suggested answer works, but then I don't get what I would like to display.

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage{chemfig}
\usepackage[version=4]{mhchem}
\usepackage{chemmacros}
\begin{document}
\begin{equation*}
\begin{split}
n_{\ce{NH3}}=n_{\ce{NH3}_\text{initial}}-n_{\ce{HCl}}=0.3\text{ milimoles}\\
\end{split}
\end{equation*}
\end{document}

What I'd like it to have the moles of NH3 subscripted by the word initial. If I remove the \ce command it works but messes up the representation of the NH3.

closed as off-topic by Phelype Oleinik, TeXnician, Stefan Pinnow, Andrew Swann, egreg Mar 5 '18 at 13:37

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Try adding an extra brace layer: n_{\ce{NH3}}=n_{{\ce{NH3}}_\text{initial}}-n_{\ce{HCl}}=0.3\text{ milimoles}. – Peter Grill Mar 5 '18 at 6:41
  • 4
    I'm voting to close this question as off-topic because the question was solved in the comments. – Phelype Oleinik Mar 5 '18 at 11:25
  • @Phelype-Oleinik is there a way I can close it? – SvenskTacoma Mar 6 '18 at 11:51
  • @SvenskTacoma When I voted to close the question, other users received a notification to vote to close (or not). When 5 users voted to close, the question was put [on hold] (see the tag appended to the title?). If the question stays on hold for enough time, it will be closed automatically. – Phelype Oleinik Mar 6 '18 at 11:59