Last edited: 2022/01/23

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 three 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. chemformula by myself
  3. 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. I’m looking for a new maintainer to take over development of this package. Contact me if you’re interested.
  9. ENdiagram: easy creation of potential energy curves (not surfaces!) with the help of TikZ. I’m looking for a new maintainer to take over development of this package. Contact me if you’re interested.
  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.