# Can we extend mhchem support in MathJax to include physical units?

You may or may not be aware that Worldbuilding.SE (partially) supports the mhchem MathJax extension, that allows for nice rendering of chemical formulae. I only discovered it quite recently. It lets you do stuff like this: \ce{H2O}$ to generate output like this: $$\require{mhchem} \ce{H2O}$$ (the plain latex equivalent would be $\mathrm{H_2O}$ -> $$\mathrm{H_2O}$$) Chemistry Stack Exchange is obviously the main consumer of this feature and has a nice FAQ on its use. The chemists get two things that we don't: • \require{mhchem} is implicit... you get support automatically without having to require it explicitly. • They get physical unit formatting via $\pu{273.15 K}$, which currently renders as a grumpy error on WB.SE and WB meta that looks like this My requests are that we a) support \pu, and optionally b) support automatic \require{mhchem}. There have been two related meta questions in the past: The former was never officially completed, but we seem to have (partial) mhchem support anyway (presumably all of Stack Exchange has basic support). The latter was fixed by suggesting use of the \text macro, but only around unit names because it breaks rendering of underscores, etc. If you look at this Meta Stack Exchange answer on which sites use MathJax you can see that 4 already have mhchem fully enabled, and the space exploration people are also looking into getting it too. Given that it doesn't appear to affect page loading times or rendering performance, and is entirely optional for people to use, is there any reason not to enable it? • I have asked Prerequisites to enable mhchem on a site to see what are the prerequisites to have it. Feel free to chip in with further explanations. – L.Dutch Mod Mar 25 at 15:35 • I have added two options as answers. Any user can upvote the option they prefer. – L.Dutch Mod Mar 25 at 16:11 • Silly q: what's the advantage of this over plain MathJax with \text? Is it just that it's less arcane?$\text{H}_2\text{O}$and$\text{273.15 K}$appear to render similarly (although not quite identically - the subscript appears to be slightly higher) to$\ce{H2O}$and$\pu{273.15 K}\$.
– TLW
May 14 at 20:52