# Finding a library to allow drawing chemical structures directly on the site

Drawing structural formulas is a very common task in chemistry. Simple chemical formulas are often not sufficient, they are ambiguous for pretty much any non-trivial molecule, and structural formulas are pretty much required to explain reaction mechanisms accurately.

So while we can write formulas like $\ce{C6H12O6}$ natively on the site, drawing the following structural formula is not as easy

To draw such formulas you need either have a local pogram installed, or copy an existing image from somewhere, you can't draw them here.

I think it would be very useful to have a tool for drawing structural formulas embedded in the site. I'd like to collect our requirements here, as well as collect information about existing libraries that could be used on the site.

The must-have features are

• drawing of a single chemical formula
• drawing of a reaction (A -> B)

Other features that would be useful are

• the ability to save the result as png, so that viewers that don't edit don't have to load the javascript and there is no delay in display
• Users should be able to copy the formulas from another post and user them in their own posts (an answer would likely need some of the same formulas the question uses)

If you have some more ideas on what such a libray should be able to do, please comment on this post.

The main purpose of this post is to find libraries that could be added to the site. Please add one answer for each library that could be implemented. It should not only be the name, but also a short evaluation of the features and maybe your own impression of the library.

• There's a list on Wikipedia Oct 24 '14 at 17:59
• I'd also suggest that saving to SVG might be a good alternative to PNG. Oct 24 '14 at 17:59

## ChemDoodle Web Components

licence: GPLv3

This library looks like it has enough features for us, the documentation for developers on the site also looks nice on first glance.

It has support for curly arrows to draw mechanisms, which seems pretty nice.

SE might have to get the commercial licence, though.

• I had started work on making this into a plugin (just poking around, mostly), but I'm way to busy to do anything now :/ Oct 24 '14 at 13:39
• I'll point out that the author even came to answer questions Oct 24 '14 at 19:35
• Another plus is that ChemDoodle offers a 3D viewer, so both 2D and 3D rendering is available. Oct 25 '14 at 20:29

# Marvin Sketch

Licence: FreeWeb

I know Marvin Sketch also has an applet kind of editor. Maybe something like that can be incorporated.

## Ketcher

licence: AGPLv3

Seems to have all the essential features.

## Chemfig

licence: The LATEX Project Public Li­cense 1.3

If you are handy with LaTeX, you can typeset the desired objects and save them as whatever figure you want. Rehost to something like imgur and it will make it readily available to punch into any SE post.

(EDIT: Just realized OP was asking for something that draws directly on the site. I suppose if you used shareLaTeX then Chemfig would count but it isn't as 'direct' as some of the other options)

## JSME

licence: BSD

looks somewhat ugly, and I don't like that the bonds don't snap to certain angles.