3

I have a document with mhchem and the compile process never ends. What is causing this? How can I fix this?

\documentclass{report}
\usepackage[version=4]{mhchem}
\begin{document}
        \ce{H2O + 💩}
    \end{equation}
\end{document}
5

This can occur when you have a "strange" character in your `\ce' equation that mhchem does not know. mhchem throws an error in that case.

Unfortunately, up to v4.04 (which seems to be included in TeX Live 2016, from reports I get) there was a bug, causing an infinite loop of Unexpected input character when running in nonstop mode, as is the case when compiling within TeX editors.

You can see the error when running pdflatex <yourfile> (or equivalent) from the command line.

Simply fix the equation and everything will work fine.

You can, of course, also update mhchem to 4.05 or later and the error should be displayed correctly in your editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.