7
$\begingroup$

According to mhchem manual the following code

\ce{0.5H2O}

should produce the following result

enter image description here

But it does not. Instead, I have

enter image description here

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}$$.

$\endgroup$
7
  • $\begingroup$ Yup, using Google Chrome Version 41.0.blah blah blah (latest version, I think) and I get the same view as you do. $\endgroup$
    – M.A.R.
    Mar 24, 2015 at 19:15
  • $\begingroup$ @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. :( $\endgroup$
    – Wildcat
    Mar 24, 2015 at 19:16
  • $\begingroup$ 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. $\endgroup$ Mar 24, 2015 at 19:18
  • $\begingroup$ @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) $\endgroup$
    – M.A.R.
    Mar 24, 2015 at 19:24
  • 1
    $\begingroup$ @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. $\endgroup$
    – Wildcat
    Mar 24, 2015 at 19:28
  • $\begingroup$ Yes, same ugly result under Chromium. $\endgroup$ Mar 24, 2015 at 19:37
  • $\begingroup$ $$\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. $\endgroup$ Mar 26, 2015 at 12:03

4 Answers 4

9
$\begingroup$

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

$\endgroup$
8
$\begingroup$

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

$\endgroup$
7
$\begingroup$

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?

$\endgroup$
1
  • 1
    $\begingroup$ The moderator-only tag status-completed marks the issue as "solved". I've gone ahead and applied it here. Thanks for highlighting this! $\endgroup$ Mar 7, 2017 at 18:19
2
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .