chem
groff preprocessor for chemical structure diagrams
TLDR
Process a chem file and view the output
SYNOPSIS
chem [option...] [--] [filespec...]
chem -h | --help
chem -v | --version
DESCRIPTION
chem is a groff preprocessor for producing chemical structure diagrams. It translates chemical notation into pic language diagrams, which can then be processed by groff for rendering.
The tool is best suited for organic chemistry, supporting bonds, rings, moieties (like CH3, NH3), and strings. Chemical diagrams are enclosed between .cstart and .cend markers.
Example input:
CH3
bond
CH3
.cend
PARAMETERS
-h, --help
Display usage message and exit-v, --version
Display version information and exitfilespec
Input file or - for stdin. Without arguments, reads stdin
CAVEATS
No library or file inclusion mechanism exists. No shorthand for repetitive structures. The extension mechanism uses pic macros, which can be tricky to implement correctly.
There is no in-line chemistry syntax (like eqn's $...$ construct) and no way to control bond entry points on groups.
HISTORY
The GNU version of chem was written by Bernd Warken, based on documentation of Brian Kernighan's original awk version. The chemical structure diagram language was developed at Bell Labs alongside other troff preprocessors like eqn and pic.
