0

The whole report cannot even compile now! And the pdf cannot open any more! I narrowed down the problem to \usepackage{mhchem}. I was using version 3 (if it matters) but i also tried writing version=4. I read here that there is an issue when updating latex. So i tried uninstalling and installing the previous version that was working and still nothing. An example:

\documentclass{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[version=4]{mhchem}

\begin{document}
    \begin{equation}
        \label{eq:HDO}
        \ce{C$H_{1.4}O_{0.4}$ -> 1''C$H_{2}$ '' + 0.4H2O}
    \end{equation}
\end{document}

It does nothing. trying to finish compile or just say:

Undefined control sequence. \begin{document}.

  • 1
    (1) welcome, (2) why are you using those $ in math mode? And what does _{1.4} of hydrogen actually mean. – daleif Nov 28 '16 at 16:03
  • 1
    On a recent TeX installation, I don't get the error "undefined control sequence" but complaints from the mhchem package about characters that cannot be interpreted. The complaints go away when I remove the $ signs (math mode is not required for subscripts to work) as well as the quotes ''. – gernot Nov 28 '16 at 16:06
1

You get an error Unexpected input character for the '. They are not supported (yet). But in your example, I don't even know what they should represent. What is 1''?

By the way, this input definitely did never work with any version of mhchem.

You don't need the $, just remove them.

\ce{CH_{1.4}O_{0.4} -> 1CH2 + 0.4H2O} works just fine. (Although 2+0.4*2=2.8, not 1.4.)

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.

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.