Some Stack Exchange sites have site-specific extensions that allow them e.g. to typeset mathematical equations, create UI mockups or display Go board positions. Some support for creating and displaying chemical formulas would be very useful here in my opinion.

To convince SE to add support for that we should collect information about existing software that could be used for that. The requirements are, as far as I know:

  • It should be completely implemented in Javascript
  • It needs to be released under a compatible licence

Which existing software could we use to make drawing and typing chemical formulas easier here?


4 Answers 4


The ChemDoodle Web Components allow embedding an HTML5-based editor for structural formulas. It's released under the GPL, which should be suitable for SE as they don't distribute their software.

Having such an editor would be very valuable in my opinion, it would greatly simplify the workflow if one want's to include structural formulas.


MathJax, which is already used by many SE sites supports the mhchem extension meant for typesetting chemical formulas like H2O or [AgCl2]- using simple syntax like \ce{H2O} or \ce{[AgCl2]-}. We'll likely be using chemical formulas very often, so a simple way to enter them would be very useful.

Alternatively, an easier way of writing super- and subscripts could also work, and it would avoid relying on javascript postprocessing of the posts.

  • $\begingroup$ Apparently \ce{} doesn't work with mathjax. Better stick with ${H_2O}$({H_2O}) then ;) $\endgroup$
    – CHM
    Apr 25, 2012 at 23:10
  • $\begingroup$ @CHM: Mathjax 2.0, he means $\endgroup$ Apr 26, 2012 at 4:24
  • $\begingroup$ Yeah, at the very least, can there be a modification to Markdown that makes the input of sub- and superscripts easy? $\endgroup$
    – user95
    Apr 26, 2012 at 6:15
  • $\begingroup$ I've asked a separate post here: meta.chemistry.stackexchange.com/questions/26/… . Hopefully the overlords will listen $\endgroup$ Apr 26, 2012 at 9:15
  • $\begingroup$ @J.M. Use the math syntax for now.. You get used to it after a while $\endgroup$ Apr 26, 2012 at 9:15
  • 6
    $\begingroup$ The mhchem extension has been enabled for chemistry.se $\endgroup$ Apr 27, 2012 at 0:28
  • $\begingroup$ Does it work for structural formulas? $\endgroup$
    – Daniel
    Aug 30, 2013 at 13:06
  • $\begingroup$ @DantheMan No, this is purely for typesetting chemical formulas, not for structural formulas. $\endgroup$ Aug 30, 2013 at 13:17

We need chemfig for organic chemistry.

The bun­dle pro­vides three pack­ages: The mhchem pack­age pro­vides com­mands for type­set­ting chem­i­cal molec­u­lar for­mu­lae and equa­tions. The hp­state­ment pack­age pro­vides com­mands for the of­fi­cial haz­ard state­ments and pre­cau­tion­ary state­ments (H and P state­ments) that are used to la­bel chem­i­cals. The rsphrase pack­age pro­vides com­mands for the of­fi­cial Risk and Safety (R and S) Phrases that are used to la­bel chem­i­cals.


In addition to ChemDoodle, JME (JME Molecular Editor) is java based. JME has been released to the public.


You must log in to answer this question.

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