16

I am looking for chemical molecular drawing packages.

There is mhchem which basically sets up a structure for including externally generated molecular structures.

Also Chemfig, which is the closest to a user friendly solution and uses pgf.

The vast majority of chemists would use ISISDraw or other program which has the advantage of being able to name the structure based on IUPAC rules. There is also the brookhaven Protein database which has a file format for large proteins.

My question is: Are there any packages that can convert ISISDraw (or similar molecular drawing packages) file formats to pgf or any packages that are closer to ISISDraw than Chemfig

Leeser
  • 2,752
  • 6
    ISISDraw is not the standard: ChemDraw is! (You can tell ISISDraw diagrams as they look bad.) I'm afraid that such a conversion always looks complex as ChemDraw saves in binary format, but also because you'd not want to edit such output in anything but ChemDraw. This area is very graphical. – Joseph Wright Nov 29 '11 at 12:57
  • 1
    @joseph You're (w)right pardon the pun, ChemDraw is the standard now known as Accelrys Draw. There is an interesting link http://chemapps.stolaf.edu/jmol/ that shows how to incorporate 3d mol structures into a pdf file. It was when looking at this i realised that the solution would most likely be an external program and then \includegraphics... – Leeser Nov 29 '11 at 13:04
  • 1
    Nope, Accelrys Draw is not ChemDraw. The latter was for many years written by CambridgeSoft: they are recently taken over by Perkin-Elmer. The same considerations apply whatever graphical editor you talk about: for a scheme of any complexity, a TikZ or other code-based approach rapidly becomes very hard to follow. – Joseph Wright Nov 29 '11 at 14:53
  • Thanks for the clarification...sometimes I get lost in the myriad of software out there... – Leeser Nov 29 '11 at 16:46
  • 1
    Could you include a picture of the kind of output you'd like to get (for those of us whose chemistry is a little ... dated)? – Andrew Stacey Dec 29 '11 at 18:37
  • Attached are links to wikipedia pages: Phenyalanine, which shows certain reaction mechanisms. Another essential part is the ability to draw different stereoisomers/enantiomers of molecules, molecules with the same molecular formula and constitution but different 3-D orientation eg lactic acid – Leeser Jan 03 '12 at 13:21
  • @Leeser, 1. Can you tell me why do you need pgf? 2. If you are interested in generating the chemical structure, you can use Accelrys Draw or Marvin Sketch, which are free for academic use. Copy the image and paste it in Inkspace and save the file as you wish. – Anil Jan 19 '12 at 06:26
  • @Anil. No real reason why I want to use pgf except that the fonts etc are the same as the rest of the text input. – Leeser Jan 20 '12 at 15:15
  • @JosephWright And here I thought chemists used ChemSketch (ACD Labs) or SymexDraw (Formerly IsisDraw) I don't suppose ChemDraw is free? – Canageek Jan 29 '12 at 17:02
  • @Canageek No, ChemDraw is certainly not free. Undergraduates have a tendency to use ISISDraw: it shows! My current department now has a ChemDraw site license, so they have no excuse. If you look at most chemistry journals sites, you'll see that they all accept ChemDraw graphics. – Joseph Wright Jan 29 '12 at 17:08
  • @JosephWright I tend to prefer CheckSketch myself, though I keep both installed as one is better for inorganics thne then the other. Now if I didn't have to export them to raster graphics to put them into LaTeX I'd be happy! – Canageek Jan 29 '12 at 17:18

2 Answers2

11

The short answer is 'no' at the present time. Products such as ISISDraw/Accelrys Draw or ChemDraw produce binary files, which cannot be read directly by TeX. So any conversion would either require a separate tool or reading a text file format, such as ChemDraw's XML format.

By far the most popular file format for journal submission is ChemDraw's .cdx format, which is publicly documented. Thus perhaps the most sensible approach to creating a tool for the conversion would be to read .cdx files.

Stefan Kottwitz
  • 231,401
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • I was looking into this again recently and I now use Accelrys Draw which as you said is free for academic use. I was thinking about saving the molecule as a .mol file and somehow manipulating the .mol file structure (somehow!) to set nodes and then draw bonds as paths between the nodes. (I can do it by hand but not automatically yet). The mol file structure does give the x,y,z-cordinates of the atoms, the charge, mass (difference) of the atoms and lists the bonds between the atoms and type of bond. Issues such as no explicit of list hydrogens and stereo depictions.. – Leeser Apr 17 '12 at 11:15
  • @Leeser As I said, given the fact that .cdx files are the best chose for use for publication, etc., my personal take is that the best real solution here would be a tool to convert those. However, that also looks like serious work. – Joseph Wright Apr 17 '12 at 11:16
  • I think I was still editing my comment when you posted again so my apologies if there were changes in between... – Leeser Apr 17 '12 at 11:19
  • Might it not be easier to figure out the format that ChemDraw outputs to when you select Postscript or SVG and then reparse that, rather then the binary file? – Canageek Jul 02 '14 at 17:50
  • @Canageek I would probably try to parse .cdxml, which contain the same data but in an XML format. The issue of course is that this is proprietary, so it's potentially a moving target. – Joseph Wright Jul 02 '14 at 18:28
3

Now it is not a problem since we have mol2chemfig, which is a program that renders chemical structures from smiles format or MDL molfile format to LaTeX source code. The generated code can then be processed using the excellent and highly customizable chemfig LaTeX package.

mol2chemfig document here

The package can be found in CTAN: https://ctan.org/pkg/mol2chemfig

The homepage of mol2chemfig is here (but currently offline): mol2chemfig homepage