My LaTeX Corner

Last edited: 2016/08/28

The story behind my chemical LaTeX packages and this blog

For some time it has been rather difficult to typeset organic structures, empirical formulas and chemical reactions with LaTeX. Many attempts have been made to change that. There are for example streeTeX, ochem and the probably most known and used XyMTeX. All of these had and have its’ limitations. Both streeTeX and ochem only create postscript formulas, which makes it inconvenient to create pdf. ochem is a very powerful package to create structural formulas and reaction schemes. Many users had problems installing the perl script which produces the postscript output, though. (A little help may be found here.)  And XyMTeX has a not very intuitive syntax to typeset the formulas, which for my part was the reason I never used it but used ochem instead.

(For a quick overview over the packages for creating skeletal formulas have a look at this question and its answers: Can you make chemical structure diagrams in LaTeX?)

Nowadays however two packages especially come to mind which finally allow a chemist to use LaTeX without using external programs and where the syntax is intuitively understandable.

  1. mhchem by Martin Hensel
  2. ChemFig by Christian Tellechea

Both authors have done a great job developing these packages and one can’t thank both of them enough. The first one makes it really easy to write empirical formulas and chemical equations while the second one is a very powerful package to draw organic structures, Lewis formulas and reaction schemes.

I still found pieces missing, which is the reason I wrote a few packages myself. I can humbly say that some of them have become part of the standard list of packages of chemists:

  1. chemexec (first attempt ever, obsolete, don’t use it!)
  2. myChemistry: create reaction schemes with ChemFig. Written before ChemFig v1.0 was published. With v1.0 of ChemFig the myChemistry package has become obsolete and I don’t see a reason, why it should actively be maintained any more. I strongly discourage its usage and suggest using ChemFig instead.
  3. chemmacros: provides lots of commands and macros for chemists (replaces chemexec).
  4. chemformula: offspring of the chemmacros package and a very flexible alternative to mhchem.
  5. ghsystem: offspring of the chemmacros package for typesetting the hazard and precautionary statements and the pictograms of the GHS.
  6. chemnum: provides a comprehensive method for the numbering of chemical compounds; I believe it to be more flexible than other packages like chemcompounds or bpchem. Indeed I believe that today chemnum is the package to use in this area.
  7. chemgreek: offspring of the chemmacros package for support of upright Greek letters in chemistry. Mostly a support package for package authors.
  8. MOdiagram: easy creation of molecular orbital diagrams
  9. ENdiagram: easy creation of potential energy curves (not surfaces!) with the help of TikZ.
  10. bohr: draw sim­ple Bohr mod­els of atoms up to the atomic num­ber 112.
  11. elements: offspring of the bohr package which provides basic information about the first 112 chemical elements.
  12. substances: very preliminary support for creating and mainly using a “database” of chemicals — probably rather buggy so feedback is very welcome!
  13. carbohydrates: a package to draw the most common carbohydrates in Fischer, Haworth or chair representation with options to choose for chain, alpha or beta isomer.

I wrote all these packages for personal use first, which is why they a) only can be used with LaTeX and not with Plain TeX or conTeXt and b) may be missing features I didn’t need yet and hence did not think of or have been too lazy to implement. If you find anything missing (or bugs, of course ;) ) please don’t hesitate to contact me.

I will use this blog mainly for news about these packages. However, I’ll also try to cover other news and useful information regarding LaTeX and chemistry.

This blog started as a way to report about the usage of LaTeX for documents with chemical contents. This is still a big part of this blog but not the main focus anymore.

4 Replies to “My LaTeX Corner”

  1. I didn’t found a solution for Numbering my reactions like chemmacros reaction environment does with mychemistrys rxn environment. Before I had lots of sum formulas and the reaction environment did it’s job very well. Now I have to draw the compounds of a reaction, because sum formulas aren’t enough and I’m not able to numerate them only with rxn. I would like to have a numeration like in the reaction environment. (I use [R {number}] for that)

    Many thanks for your packages. They are really great and your pages improved my protocols a lot.

    1. I’m not entirely sure I understand what you’re after. Could you send me an email containing a small example?

  2. Hallo !

    Gibt es bei Gebrauch von Chemfig eigentlich die Möglichkeit selbst definierte Symbole als “Atom” in \chemfig{} zu benutzen ?
    Häufig erstelle ich mit chemfig Strukturformeln für biochemische Reaktionen. Dabei ist es üblich einen als Ester im Molekül vorhanden Phosphatrest als P in einem Kreis an der entsprechenden Stelle zu plazieren.
    Ist es möglich so etwas in chemfig bzw. in tikz zu defnieren und dann zu verwenden ?
    Wenn ja wie ginge denn das ?

    Danke und viele Grüße !


Comments are closed.