Next: , Previous: File formats, Up: File formats


8.1 gtroff Output

This section describes the intermediate output format of GNU troff. This output is produced by a run of gtroff before it is fed into a device postprocessor program.

As groff is a wrapper program around gtroff that automatically calls a postprocessor, this output does not show up normally. This is why it is called intermediate. groff provides the option -Z to inhibit postprocessing, such that the produced intermediate output is sent to standard output just like calling gtroff manually.

Here, the term troff output describes what is output by gtroff, while intermediate output refers to the language that is accepted by the parser that prepares this output for the postprocessors. This parser is smarter on whitespace and implements obsolete elements for compatibility, otherwise both formats are the same.1

The main purpose of the intermediate output concept is to facilitate the development of postprocessors by providing a common programming interface for all devices. It has a language of its own that is completely different from the gtroff language. While the gtroff language is a high-level programming language for text processing, the intermediate output language is a kind of low-level assembler language by specifying all positions on the page for writing and drawing.

The intermediate output produced by gtroff is fairly readable, while output from AT&T troff is rather hard to understand because of strange habits that are still supported, but not used any longer by gtroff.


Footnotes

[1] The parser and postprocessor for intermediate output can be found in the file
groff-source-dir/src/libs/libdriver/input.cpp.