Next: , Previous: Macro Package Intro, Up: Introduction

1.5 Preprocessors

Although groff provides most functions needed to format a document, some operations would be unwieldy (e.g. to draw pictures). Therefore, programs called preprocessors were written which understand their own language and produce the necessary groff operations. These preprocessors are able to differentiate their own input from the rest of the document via markers.

To use a preprocessor, UNIX pipes are used to feed the output from the preprocessor into groff. Any number of preprocessors may be used on a given document; in this case, the preprocessors are linked together into one pipeline. However, with groff, the user does not need to construct the pipe, but only tell groff what preprocessors to use.

groff currently has preprocessors for producing tables (tbl), typesetting equations (eqn), drawing pictures (pic and grn), processing bibliographies (refer), and drawing chemical structures (chem). An associated program which is useful when dealing with preprocessors is soelim.

A free implementation of grap, a preprocessor for drawing graphs, can be obtained as an extra package; groff can use grap also.

Unique to groff is the preconv preprocessor which enables groff to handle documents in various input encodings.

There are other preprocessors in existence, but, unfortunately, no free implementations are available. Among them is a preprocessor for drawing mathematical pictures (ideal).