Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   chem    ( 1 )

вставлять диаграммы химической структуры в документы groff (embed chemical structure diagrams in groff documents)

Имя (Name)

chem - embed chemical structure diagrams in groff documents


Синопсис (Synopsis)

chem [--] [file ...]

chem -h chem --help

chem -v chem --version


Описание (Description)

chem produces chemical structure diagrams. Today's version is best suited for organic chemistry (bonds, rings). The chem program is a groff preprocessor like eqn, pic, tbl, etc. It generates pic output such that all chem parts are translated into diagrams of the pic language.

If no operands are given, or if file is '-', chem reads the standard input stream. -h and --help display a usage message, whereas -v and --version display version information; all exit.

The program chem originates from the Perl source file chem.pl. It tells pic to include a copy of the macro file chem.pic. Moreover the groff source file pic.tmac is loaded.

In a style reminiscent of eqn and pic, the chem diagrams are written in a special language.

A set of chem lines looks like this

.cstart chem data .cend

Lines containing the keywords .cstart and .cend start and end the input for chem, respectively. In pic context, i.e., after the call of .PS, chem input can optionally be started by the line begin chem and ended by the line with the single word end instead.

Anything outside these initialization lines is copied through without modification; all data between the initialization lines is converted into pic commands to draw the diagram.

As an example,

.cstart CH3 bond CH3 .cend

prints two CH3 groups with a bond between them.

If you want to create just groff output, you must run chem followed by groff with the option -p for the activation of pic:

chem [file ...] | groff -p ...