# Chemical formulas with fractional numbers are displayed wrongly

According to mhchem manual the following code

\ce{0.5H2O}


should produce the following result

But it does not. Instead, I have

in a browser. So far I tried Safari 7.1.4 & Firefox 36.0.4 both on OS X 10.9.

P.S. To quickly test your browser look below: $$\ce{0.5H2O}$$.

• Yup, using Google Chrome Version 41.0.blah blah blah (latest version, I think) and I get the same view as you do. Mar 24 '15 at 19:15
• @MARamezani, good to hear that I'm not alone. I'm pretty sure it worked pretty well previously, but today I noticed that it is broken. :( Mar 24 '15 at 19:16
• I can confirm that mhchem V3.15 in pdflatex works the way it should. Here on SE using Chromium 41.0.2272.76 8 and Firefox 36.0.4 MathJax seems to have a lot of hiccups lately. Mar 24 '15 at 19:18
• @KlausWarzecha Well I can't comment on that, but I know Cr and Win OS is a bad choice for SE. I just activated an experimental feature because the main page in physics.SE was displayed incorrectly. I thought the Mathjax inconsistency was due to that.... (And it could be aggravating it) Mar 24 '15 at 19:24
• @MARamezani, MathJax is the only bad choice. Wikipedia still generates PNG images out of LaTeX code by default and show them. Yes, MathJax can be selected in the user preferences, but it is not a default option, which tells us something about how trustworthy MathJax is. Mar 24 '15 at 19:28
• Yes, same ugly result under Chromium. Mar 24 '15 at 19:37
• $$\mathrm{M_{ath}J^{a}X}\neq\LaTeX$$ It essentially reimplements a lot of commands from the original source new and of course simplifies it. I also think mhchem for MathJax is not simultaneously developed for the latex kernel and MathJax. There might be a lot of functions, that don't work properly. And sub-/superscript stacking is not only awful, it is also not IUPAC recommended. But currently, it is the best you can do with a live editor/interpretor. Mar 26 '15 at 12:03

As a workaround, you could use $\ce{$0.5$\,H2O}$ to get $\ce{$0.5$\,H2O}$

Or you can use $\ce{1/2\,H2O}$ to get $\ce{1/2\,H2O}$.

This issue has been solved since mid of 2016.

$\ce{0.5H2O}$ renders as $\ce{0.5H2O}$.

Short background: MathJax is NOT LaTeX. MathJax is a complete re-implementation of LaTeX using the same input syntax. Almost the same, with fine differences. The same applied to mhchem. The behavior of LaTeX/mhchem (written by me) was re-created for MathJax (by the MathJax guys, missing some fine details and further development of the original package). Linking to the LateX documentation might have increased the confusion. Mid of 2016, a new version of MathJax/mhchem (written by me) was published and is since used here. This lead to a few small changes. 0.5H2O working being one, staggered charges (as in IUPAC style) being another.

Do we keep such questions for the archive? Should we mark them as 'solved'? Do we delete them because they do not apply any more?

• The moderator-only tag status-completed marks the issue as "solved". I've gone ahead and applied it here. Thanks for highlighting this!
– orthocresol Mod
Mar 7 '17 at 18:19

From a very simplistic point of view, this actually makes sense, since $\ce{NEt3.3HF}$ is supposed to show up as $\ce{NEt3.3HF}$ — with a multiplication dot between the two numbers. I suspect that the MathJax implementation of mhchem uses rather less sophisticated algorithms for recognition of these patterns than the one for $\mathrm{\TeX}$ (or $\mathrm{\LaTeX}$ or $\mathrm{X_E\TeX / X_E\LaTeX}$) for the benefit of quicker calculations or whatnot.

Remember what was said when we requested upgreek?

One does not simply add LaTeX packages to MathJax.