1.1 (CWI) 87/03/31
CHEM l "March 31, 1987"
NAME
chem - troff preprocessor for chemical structure diagrams
SYNOPSIS

chem files

DESCRIPTION
Chem is yet another preprocessor like eqn, pic, etc., this time for producing chemical structure diagrams. Today's version is best suited for organic chemistry (bonds, rings) and it's excruciatingly slow sometimes. Who knows what the future may hold.

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
 .cend
prints 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.
FILES
chem.awk awkscript for chem
chem.macros pic(1) marcros
SEE ALSO
ditroff(1), dieqn(1), pic(1)

John L. Bentley, Lynn W. Jelinsky, Brian W Kernighan, CHEM-A Program for Typesetting Chemical Diagrams: User Manual, 17 April 1986

BUGS
Chem needs the current version of awk; you will get some mysterious error messages from awk if your version is too old. You will also profit from having sensible and consistent definitions for the PS and PE macros
WISH LIST

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.