Can we have a font that harmonizes with inline MathJAX?

Inline formulas on chemistry SE are clunky-looking and distracting, because the thin sans-serif font used here is so different from the heavy serif font used in MathJAX expressions. Over at math.stackexchange.com they use font-family: Georgia,"Times New Roman",Times,serif; as their body font. That's much more readable. And more professional-looking, too.

(I've only been here for a little over a week, so if this has been discussed before, forgive me. I didn't see anything tagged with "font" here...)

• I don't know Fred, but I think till we're still in public beta we're not getting the candy. (It's an expression in my mother language) I think "personalized" options are for graduated ones. Jan 17, 2015 at 13:22
• That's exactly right. This seems like a good issue to mention when the designer comes around. :-) Jan 19, 2015 at 3:52

After graduation, we have a better-matching font. I am still not completely happy with the current state.

I looked how much effort it would be to make \ce fit better to the surrounding text, like $\ce{H2O}$. This posting is to whet your appetite.

Before:

After:

How you can try it out yourself:

• Open a page in Chrome, e.g. https://chemistry.stackexchange.com/q/45190/24052
• Open Dev Tools (Chrome on Win: press F12)
• Go to Sources tab
• Open cdn.sstatic.net/Sites/chemistry/all.css
• Paste the following two lines

.MathJax span.mi[style="font-family: MathJax_Main;"] { font-family: inherit !important; font-size:90.09%; }
div.MathJax_Display .MathJax span.mi[style="font-family: MathJax_Main;"] { font-size:100%; }


This sets all upright letters with the font of the text body. Numbers still have the TeX font – which is not 100% matching – because the body font has old style figures. Inline TeX is set to 100% font-size to match the surrounding text, while display-mode TeX stays with 111%.

This his is just a prove of concept. It applies to one MathJax renderer only, namely HTML-CSS. It is a hack and for a proper solution, a MathJax change would probably be needed. A lot of things are missing (text in subscripts, etc.), but I think this gives a good impression of what could be possible.

Does this whet your attpetite? Then we should go forward talking to the MathJax and the SE developers. Otherwise, just state so.

• Nice proof of concept. Feb 20, 2017 at 14:48
• This is a hundred times better. Feb 20, 2017 at 17:22

Hopefully graduation is happening this year. I guess in the same spirit of this post or this post there will be someone paying attention to this, esp. feature requests and or bugs.

I guess this should be much easier to accomplish, than including software for drawing molecules (here and here).

I personally think this is a brilliant idea, as I have seen an awful lot of questions tweaking the original MathJax concept in the form of CuSO$_4$, which renders CuSO$_4$. This probably is one of the worst things to do, since formulas will break at the end of a line. Also multiple mixed styles, with some HTML and some as MathJax, which sometimes makes it hard to read. Other possibilities include $\small \ce{CuSO4}$, which kind of acceptable renders to $\small \ce{CuSO4}$, but is a lot of work to keep up. (And this might mess things up if any changes to MathJax future versions will be made.)