Next: , Previous: , Up: File Formats   [Contents][Index]


6.1 gtroff Output

We now describe the groff device-independent page description language produced by GNU troff.

As groff is a wrapper program around GNU troff and automatically runs an output driver, users seldom encounter this format under normal circumstances. groff offers the option -Z to inhibit postprocessing such that GNU troff’s output is sent to the standard output stream just as it is when running GNU troff directly.

The purpose of device-independent output is to facilitate the development of postprocessors by providing a common programming interface for all devices. It is a distinct, and much simpler, language from that of the formatter, troff. The device-independent output can be thought of as a “page description language”.

In the following discussion, the term troff output describes what is output by GNU troff, while page description denotes the language accepted by the parser that interprets this output for the output drivers. This parser handles whitespace more flexibly than AT&T troff’s implementation, recognizes a GNU extension to the language, and supports an obsolete construct for compatibility; otherwise, both formats are the same.146

When Brian Kernighan designed AT&T troff’s device-independent page description language circa 1980, he had to balance readability and maintainability against severe constraints on file size and transmission speed to the output device.147 A decade later, when James Clark wrote groff, these constraints were no longer as tight. GNU troff therefore emits device-independent output that is more easily interpreted by humans than did AT&T troff.


Next: , Previous: , Up: File Formats   [Contents][Index]