Previous: Argument Units, Up: Language Concepts


8.1.1.3 Document Parts

A correct intermediate output document consists of two parts, the prologue and the body.

The task of the prologue is to set the general device parameters using three exactly specified commands. gtroff's prologue is guaranteed to consist of the following three lines (in that order):

     
     x T device
     x res n h v
     x init

with the arguments set as outlined in Device Control Commands. Note that the parser for the intermediate output format is able to swallow additional whitespace and comments as well even in the prologue.

The body is the main section for processing the document data. Syntactically, it is a sequence of any commands different from the ones used in the prologue. Processing is terminated as soon as the first ‘x stop command is encountered; the last line of any gtroff intermediate output always contains such a command.

Semantically, the body is page oriented. A new page is started by a ‘p’ command. Positioning, writing, and drawing commands are always done within the current page, so they cannot occur before the first ‘p’ command. Absolute positioning (by the ‘H’ and ‘V’ commands) is done relative to the current page; all other positioning is done relative to the current location within this page.