chem files
In a style reminiscent of eqn and pic, diagrams are written in a special language and occur in a document surrounded by lines beginning
.cstart
and
.cend
(in the first column, naturally). Anything outside these is copied through intact; whatever is between .cstart and .cend is converted into pic commands to draw the diagram.
So as a bare minimum,
.cstart CH3 bond CH3 .cendprints two CH3 groups with a bond between them. To actually print this, you must run chem, pic, troff, and your output filter on whatever file contains the input.
chem.awk awkscript for chem chem.macros pic(1) marcros
John L. Bentley, Lynn W. Jelinsky, Brian W Kernighan, CHEM-A Program for Typesetting Chemical Diagrams: User Manual, 17 April 1986
It's too slow (but it's too early in the game to optimize).
Error checking is minimal; errors are usually detected and reported in an oblique fashion by pic.
There's no library or file inclusion mechanism, and there's no shorthand for repetitive structures.
The extension mechanism is to create pic macros, but these are tricky to get right and don't have all the properties of built-in objects.
There's no in-line chemistry yet (e.g., analogous to the $...$ construct of eqn).
There is no way to control entry point for bonds on groups. Normally a bond connects to the carbon atom if entering from the top or bottom and otherwise to the nearest corner.
Bonds from substituted atoms on heterocycles do not join at the proper place without adding a bit of pic.
There is no decent primitive for brackets.
Text (quoted strings) doesn't work very well.
A squiggle bond is needed.