7
$\begingroup$

According to @orthocresol's answer to Chemistry equation \ce modifier works in a non chem. SE site's posts, but not in search results. Should we consider it "working" and start using it? any site that has Mathjax enabled can use the MathJax package mhchem. In chemistry SE they pre-enable it site-wide, in non chem. SE sites we can load it with $\require{mhchem}$

I kind-of like our haphazard diversity of ways that we express chemical formulae here in Space SE; we use H2O, H<sub>2</sub>O, H₂O and $H_2O$ interchangeably and more often than not do not go edit other people's posts to impose our own formatting preference on them.

Also note that (I think) putting MathJax in titles prevents the possibility of a question becoming HNQ.

Question: Should we start using the normal MathJax chemistry notation for chemicals? e.g. \require{mhchem}\ce{H_2O} for H₂O

The purpose of my question is primarily just to let folks know that like Dorothy in the Wizard of Oz we've had this power all along and as far as I can tell rarely if ever used it except for very old posts. I'm hoping that answer(s) will confirm that folks can use what they want and we'll have no rules (it's way too late to go back and fix a thousand old posts!) but it's fine if anyone wants to start using it.

However, loading a separate MathJax package is overhead (as would be adding syntax highlighting to the site) and so it deserves a passing thought if it's a good idea or not. That's something that website programming folks can address.


$\require{mhchem}\ce{H_2O}$ renders as $\require{mhchem}\ce{H_2O}$ wherever MathJax is enabled. You only need one instance and it should be the first instance where you need it to load.

$\endgroup$
1
  • $\begingroup$ I don't know if I should copy/paste this into Astronomy meta as well. It's intended primarily as a "public service announcement" so it seems it wouldn't hurt. $\endgroup$
    – uhoh
    Commented Feb 15, 2022 at 23:43

3 Answers 3

7
$\begingroup$

I would go one step further, $\require{mhchem}\ce{H_2O}$ takes longer to type, and is more inconvenient, than simply $\ce{H_2O}$. On the Meta.SE you can see in Which Stack Exchange sites use MathJax? that the following sites have the mchem extension "enabled" so that you don't have to type \require{mhchem} every time:

  • Chemistry
  • Matter Modeling
  • Biology
  • Earth Science

Since we have MathJax enabled here, we might as well add the tiny bit of code required to have the mchem extension enabled. You would need to convince me that adding the mchem extension actually slows down the loading of pages and such, in order for me not to advocate for adding this extension.

Should we always use the mchem extension to type chemical formulas? Perhaps not. If the entire post only has one mention of the H2 gas, then I don't think we need to slow down the loading of the entire page just to have it displayed as $\ce{H_2}$ (which also has the disadvantage of making the text look less uniform). Another discussion about when we might want to avoid using MathJax unnecessarily, pertained to using MathJax in titles, and can be found here: MathJax or Unicode in titles? Does it matter? (pun intended).

A diamond moderator at Quantum Computing SE said that s/he couldn't find any performance issues related with adding the mchem extension, nor "any significant reason not to do this" here: Please add ChemJax. Somehow the question didn't get any votes though, including the by diamond moderator who supported the proposal and tagged it with to tell the CMs that we want it, so if you do support this proposal on Space.SE and you have the time for it, I'd encourage you to support that proposal too.

$\endgroup$
4
$\begingroup$

I prefer seeing subscripts and subscripts where they should be because they make things more readily readable: H2O instead of H2O. How it's achieved doesn't both me ( H<sub>2</sub>O, H₂O or $H_2O$ ).

Until now I didn't know Mathjax had a chemical notation for chemicals. If it makes things easier and more readable then let's have it. However, is there really a need for it. I can understand making it a standard on SE Chemistry, where chemical equations would be numerous. I don't know that SE Space Exploration has many questions or answers that incorporate chemical equations.

$\endgroup$
2
  • $\begingroup$ Thanks! A quick search for “CO2” shows ~400 posts have it, so maybe 4 or 5% have some chemical? $\endgroup$
    – uhoh
    Commented Feb 27, 2022 at 11:21
  • $\begingroup$ One thing that particularly irritates me is that H<sub>2</sub>O doesn't render nicely in comments, even though I prefer the way it looks in Q/A bodies (because it doesn't change the font or line height, compared to rendered latex). $\endgroup$ Commented Feb 27, 2022 at 20:59
0
$\begingroup$

It's simply easier to type H$_2$O than what you are suggesting. Result: H$_2$O

Much shorter and straightforward than either HTML subscript tags or what you are suggesting.

$\endgroup$
1
  • $\begingroup$ Okay, well I didn't suggest that anyone stop using the other methods and went out of my way to make that clear. I think you've answered the title without reading through the entire post? $\endgroup$
    – uhoh
    Commented Mar 1, 2022 at 20:31

You must log in to answer this question.

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