# groff_out

## Name



           groff_out - GNU _roff_ device-independent page description language
    


## Description



           The fundamental operation of the _troff_(1) formatter is the
           translation of the _groff_(7) input language into a series of
           instructions concerned primarily with placing glyphs or geometric
           objects at specific positions on a rectangular page.  In the
           following discussion, the term _command_ refers to this device-
           independent output language, never to the _groff_(7) language
           intended for use by document authors.  Device-independent output
           commands comprise several categories: glyph output; font, color,
           and text size selection; motion of the printing position; page
           advancement; drawing of geometric primitives; and device extension
           commands, a catch-all for other operations.  The last includes
           directives to start and stop output, identify the intended output
           device, and embed URL hyperlinks in supported output formats.
    
       **Background**
           As _groff_(1) is a wrapper program around GNU _troff_ and
           automatically calls 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 _device-independent output_ 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, the formats are the same.  (The parser
           for device-independent output can be found in the _groff_ sources at
           _src/libs/libdriver/input.cpp_.)
    
           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.  A decade later, when
           James Clark wrote _groff_ , these constraints were no longer as
           tight.
    
       **Syntax**
           _roff_ 's page description language is a sequence of _tokens:_ single-
           letter commands or their arguments.  Some commands accept a
           subcommand as a first argument, followed by one or more further
           arguments.
    
           AT&T device-independent _troff_ used whitespace minimally when
           producing output.  GNU _troff_ , in contrast, attempts to make its
           output more human-readable.  The whitespace characters—tab, space,
           and newline—are always meaningful.  They are never used to
           represent spacing in the document; that is done with horizontal
           (**h** , **H**) and vertical (**v** , **V**) positioning commands.  Any sequence of
           space and/or tab characters is equivalent to a single space,
           separating commands from arguments and arguments from each other.
           Space is required only where omitting it would cause ambiguity.  A
           line break separates commands.  The comment character is a
           pound/hash sign (**#**), and marks the remainder of the line as a
           comment.  A line comprising only whitespace after comment removal
           does nothing but separate input tokens.
    
           For example, the relative horizontal motion command (**h**) and the
           command to write one glyph (**c**), each take a single argument; the
           former a signed integer, and the latter a printable
           ISO 646/“ASCII” character.  A series of such commands could
           validly occur without spaces on an input line, but GNU _troff_
           follows each with a newline.
    
           Some commands have a more complex syntax; the GNU _troff_ extension
           command for writing glyph sequences (**t**) accepts a variable number
           of arguments.  Those that draw geometric objects (**D**) or control
           the device (**x**) furthermore recognize subcommand arguments.  Such
           commands thus must end with a newline.  In GNU _troff,_ the device
           extension (sub)command “**x X** ” uniquely supports a line continuation
           syntax; all other commands occupy one input line.
    
       **Argument units**
           Some commands accept integer arguments that represent
           measurements, but the scaling units of the formatter's language
           are never used.  Most commands assume a scaling unit of “**u** ” (basic
           units), and others use “**z** ” (scaled points).  These are defined by
           the parameters specified in the device's _DESC_ file; see
           _groff_font_(5) and, for more on scaling units, _groff_(7) and _Groff:_
           _The GNU Implementation of troff_ , the _groff_ Texinfo manual.  Color-
           related commands use dimensionless integers.
    
           Note that single characters can have the eighth bit set, as can
           the names of fonts and special characters (this is, glyphs).  The
           names of glyphs and fonts can be of arbitrary length.  A glyph
           that is to be printed will always be in the current font.
    
           A string argument is always terminated by the next whitespace
           character (space, tab, or newline); an embedded **#** character is
           regarded as part of the argument, not as the beginning of a
           comment command.  An integer argument is already terminated by the
           next non-digit character, which then is regarded as the first
           character of the next argument or command.
    
       **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.  The _groff 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 subsection “Device Control
           Commands” below.  However, the parser for the _intermediate output_
           format is able to swallow additional whitespace and comments as
           well.
    
           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
           _groff 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.
    


## Command reference



           This section describes all _intermediate output_ commands, the
           classical commands as well as the _groff_ extensions.
    
       **Comment command**
           **#**_anything_ ⟨line-break⟩
                  A comment.  Ignore any characters from the **#** character up
                  to the next newline.  Each comment can be preceded by
                  arbitrary _syntactical space_ ; every command can be
                  terminated by a comment.
    
       **Simple commands**
           The commands in this subsection have a command code consisting of
           a single character, taking a fixed number of arguments.  Most of
           them are commands for positioning and text writing.  These
           commands are smart about whitespace.  Optionally, _syntactical_
           _space_ can be inserted before, after, and between the command
           letter and its arguments.  All of these commands are stackable,
           i.e., they can be preceded by other simple commands or followed by
           arbitrary other commands on the same line.  A separating
           _syntactical space_ is necessary only when two integer arguments
           would clash or if the preceding argument ends with a string
           argument.
    
           **C** _id_ ⟨white-space⟩
                  Typeset the glyph of the special character _id_.  Trailing
                  syntactical space is necessary to allow special character
                  names of arbitrary length.  The drawing position is not
                  advanced.
    
           **c** _c_    Typeset the glyph of the ordinary character _c_.  The drawing
                  position is not advanced.
    
           **f** _n_    Select the font mounted at position _n_.  _n_ cannot be
                  negative.
    
           **H** _n_    Horizontally move the drawing position to _n_ basic units
                  from the left edge of the page.  _n_ cannot be negative.
    
           **h** _n_    Move the drawing position right _n_ basic units.  AT&T _troff_
                  allowed negative _n;_ GNU _troff_ does not produce such values,
                  but _groff_ 's output driver library handles them.
    
           **m** _scheme_ [_component_ ...]
                  Select the stroke color using the _component_ s in the color
                  space _scheme_.  Each _component_ is an integer between 0 and
                  65536.  The quantity of components and their meanings vary
                  with each _scheme_.  This command is a _groff_ extension.
    
                  **mc** _cyan magenta yellow_
                         Use the CMY color scheme with components cyan,
                         magenta, and yellow.
    
                  **md** Use the default color (no components; black in most
                         cases).
    
                  **mg** _gray_
                         Use a grayscale color scheme with a component
                         ranging between 0 (black) and 65536 (white).
    
                  **mk** _cyan magenta yellow black_
                         Use the CMYK color scheme with components cyan,
                         magenta, yellow, and black.
    
                  **mr** _red green blue_
                         Use the RGB color scheme with components red, green,
                         and blue.
    
           **N** _n_    Typeset the glyph with index _n_ in the current font.  _n_ is
                  normally a non-negative integer.  The drawing position is
                  not advanced.  The **html** and **xhtml** devices use this command
                  with negative _n_ to produce unbreakable space; the absolute
                  value of _n_ is taken and interpreted in basic units.
    
           **n** _b a_  Indicate a break.  No action is performed; the command is
                  present to make the output more easily parsed.  The
                  integers _b_ and _a_ describe the vertical space amounts before
                  and after the break, respectively.  GNU _troff_ issues this
                  command but _groff_ 's output driver library ignores it.  See
                  **v** and **V**.
    
           **p** _n_    Begin a new page, setting its number to _n_.  Each page is
                  independent, even from those using the same number.  The
                  vertical drawing position is set to 0.  All positioning,
                  writing, and drawing commands are interpreted in the
                  context of a page, so a **p** command must precede them.
    
           **s** _n_    Set type size to _n_ scaled points (unit **z** in GNU _troff_).
                  AT&T _troff_ used unscaled points (**p**) instead; see section
                  “Compatibility” below.
    
           **t** _xyz_...⟨white-space⟩
           **t** _xyz_... _dummy-arg_ ⟨white-space⟩
                  Typeset word _xyz_ ; that is, set a sequence of ordinary
                  glyphs named _x_ , _y_ , _z_ , ..., terminated by a space or
                  newline; an optional second integer argument is ignored
                  (this allows the formatter to generate an even number of
                  arguments).  Each glyph is set at the current drawing
                  position, and the position is then advanced horizontally by
                  the glyph's width.  A glyph's width is read from its
                  metrics in the font description file, scaled to the current
                  type size, and rounded to a multiple of the horizontal
                  motion quantum.  Use the **C** command to emplace glyphs of
                  special characters.  The **t** command is a _groff_ extension and
                  is output only for devices whose _DESC_ file contains the
                  **tcommand** directive; see _groff_font_(5).
    
           **u** _n xyz_...
           **u** _xyz_... _dummy-arg_ ⟨white-space⟩
                  Typeset word _xyz_ with track kerning.  As **t** , but after
                  placing each glyph, the drawing position is further
                  advanced horizontally by _n_ basic units.  The **u** command is a
                  _groff_ extension and is output only for devices whose _DESC_
                  file contains the **tcommand** directive; see _groff_font_(5).
    
           **V** _n_    Vertically move the drawing position to _n_ basic units from
                  the top edge of the page.  _n_ cannot be negative.
    
           **v** _n_    Move the drawing position down _n_ basic units.  AT&T _troff_
                  allowed negative _n;_ GNU _troff_ does not produce such values,
                  but _groff_ 's output driver library handles them.
    
           **w** Indicate an inter-word space.  No action is performed; the
                  command is present to make the output more easily parsed.
                  Only inter-word spaces on an output line (be they breakable
                  or not) are thus described; those resulting from horizontal
                  motion escape sequences are not.  GNU _troff_ issues this
                  command but _groff_ 's output driver library ignores it.  See
                  **h** and **H**.
    
       **Graphics commands**
           Each graphics or drawing command in the _intermediate output_ starts
           with the letter **D** followed by one or two characters that specify a
           subcommand; this is followed by a fixed or variable number of
           integer arguments that are separated by a single space character.
           A **D** command may not be followed by another command on the same
           line (apart from a comment), so each **D** command is terminated by a
           _syntactical line break_.
    
           _troff_ output follows the classical spacing rules (no space between
           command and subcommand, all arguments are preceded by a single
           space character), but the parser allows optional space between the
           command letters and makes the space before the first argument
           optional.  As usual, each space can be any sequence of tab and
           space characters.
    
           Some graphics commands can take a variable number of arguments.
           In this case, they are integers representing a size measured in
           basic units **u**.  The _h_ arguments stand for horizontal distances
           where positive means right, negative left.  The _v_ arguments stand
           for vertical distances where positive means down, negative up.
           All these distances are offsets relative to the current location.
    
           Unless indicated otherwise, each graphics command directly
           corresponds to a similar _groff_ **\D** escape sequence; see _groff_(7).
    
           Unknown **D** commands are assumed to be device-specific.  Its
           arguments are parsed as strings; the whole information is then
           sent to the postprocessor.
    
           In the following command reference, the syntax element _⟨line-_
           _break⟩_ means a _syntactical line break_ as defined in subsection
           “Separation” above.
    
           **D~**_h1 v1 h2 v2_ ... _hn vn_ ⟨line-break⟩
                  Draw B-spline from current position to offset (_h1_ , _v1_),
                  then to offset (_h2_ , _v2_) if given, etc., up to (_hn_ , _vn_).
                  This command takes a variable number of argument pairs; the
                  current position is moved to the terminal point of the
                  drawn curve.
    
           **Da** _h1 v1 h2 v2_ ⟨line-break⟩
                  Draw arc from current position to (_h1_ , _v1_)+(_h2_ , _v2_) with
                  center at (_h1_ , _v1_); then move the current position to the
                  final point of the arc.
    
           **DC** _d_ ⟨line-break⟩
           **DC** _d dummy-arg_ ⟨line-break⟩
                  Draw a solid circle using the current fill color with
                  diameter _d_ (integer in basic units **u**) with leftmost point
                  at the current position; then move the current position to
                  the rightmost point of the circle.  An optional second
                  integer argument is ignored (this allows the formatter to
                  generate an even number of arguments).  This command is a
                  _groff_ extension.
    
           **Dc** _d_ ⟨line-break⟩
                  Draw circle line with diameter _d_ (integer in basic units **u**)
                  with leftmost point at the current position; then move the
                  current position to the rightmost point of the circle.
    
           **DE** _h v_ ⟨line-break⟩
                  Draw a solid ellipse in the current fill color with a
                  horizontal diameter of _h_ and a vertical diameter of _v_ (both
                  integers in basic units **u**) with the leftmost point at the
                  current position; then move to the rightmost point of the
                  ellipse.  This command is a _groff_ extension.
    
           **De** _h v_ ⟨line-break⟩
                  Draw an outlined ellipse with a horizontal diameter of _h_
                  and a vertical diameter of _v_ (both integers in basic
                  units **u**) with the leftmost point at current position; then
                  move to the rightmost point of the ellipse.
    
           **DF** _color-scheme_ [_component_ ...]⟨line-break⟩
                  Set fill color for solid drawing objects using different
                  color schemes; the analogous command for setting the color
                  of text, line graphics, and the outline of graphic objects
                  is **m**.  The color components are specified as integer
                  arguments between 0 and 65536.  The number of color
                  components and their meaning vary for the different color
                  schemes.  These commands are generated by the _groff_ escape
                  sequences **\D'F**...**'** and **\M**(with no other corresponding
                  graphics commands).  This command is a _groff_ extension.
    
                  **DFc** _cyan magenta yellow_ ⟨line-break⟩
                         Set fill color for solid drawing objects using the
                         CMY color scheme, having the 3 color components
                         cyan, magenta, and yellow.
    
                  **DFd** ⟨line-break⟩
                         Set fill color for solid drawing objects to the
                         default fill color value (black in most cases).  No
                         component arguments.
    
                  **DFg** _gray_ ⟨line-break⟩
                         Set fill color for solid drawing objects to the
                         shade of gray given by the argument, an integer
                         between 0 (black) and 65536 (white).
    
                  **DFk** _cyan magenta yellow black_ ⟨line-break⟩
                         Set fill color for solid drawing objects using the
                         CMYK color scheme, having the 4 color components
                         cyan, magenta, yellow, and black.
    
                  **DFr** _red green blue_ ⟨line-break⟩
                         Set fill color for solid drawing objects using the
                         RGB color scheme, having the 3 color components red,
                         green, and blue.
    
           **Df** _n_ ⟨line-break⟩
                  The argument _n_ must be an integer in the range -32767 to
                  32767.
    
                  0≤ _n_ ≤1000
                         Set the color for filling solid drawing objects to a
                         shade of gray, where 0 corresponds to solid white,
                         1000 (the default) to solid black, and values in
                         between to intermediate shades of gray; this is
                         obsoleted by command **DFg**.
    
                  _n_ <0 or _n_ >1000
                         Set the filling color to the color that is currently
                         being used for the text and the outline, see command
                         **m**.  For example, the command sequence
    
                                mg 0 0 65536
                                Df -1
    
                         sets all colors to blue.
    
                  This command is a _groff_ extension.
    
           **Dl** _h v_ ⟨line-break⟩
                  Draw line from current position to offset (_h_ , _v_) (integers
                  in basic units **u**); then set current position to the end of
                  the drawn line.
    
           **Dp** _h1 v1 h2 v2_ ... _hn vn_ ⟨line-break⟩
                  Draw a polygon line from current position to offset
                  (_h1_ , _v1_), from there to offset (_h2_ , _v2_), etc., up to offset
                  (_hn_ , _vn_), and from there back to the starting position.
                  For historical reasons, the position is changed by adding
                  the sum of all arguments with odd index to the current
                  horizontal position and the even ones to the vertical
                  position.  Although this doesn't make sense it is kept for
                  compatibility.  This command is a _groff_ extension.
    
           **DP** _h1 v1 h2 v2_ ... _hn vn_ ⟨line-break⟩
                  The same macro as the corresponding **Dp** command with the
                  same arguments, but draws a solid polygon in the current
                  fill color rather than an outlined polygon.  The position
                  is changed in the same way as with **Dp**.  This command is a
                  _groff_ extension.
    
           **Dt** _n_ ⟨line-break⟩
                  Set the current line thickness to _n_ (an integer in basic
                  units **u**) if _n_ >0; if _n_ =0 select the smallest available line
                  thickness; otherwise, the line thickness is made
                  proportional to the type size, which is the default.  For
                  historical reasons, the horizontal position is changed by
                  adding the argument to the current horizontal position,
                  while the vertical position is not changed.  Although this
                  doesn't make sense, it is kept for compatibility.  This
                  command is a _groff_ extension.
    
       **Device control commands**
           Each device control command starts with the letter **x** followed by a
           space character (optional or arbitrary space/tab in _groff_) and a
           subcommand letter or word; each argument (if any) must be preceded
           by a _syntactical space_.  All **x** commands are terminated by a
           _syntactical line break_ ; no device control command can be followed
           by another command on the same line (except a comment).
    
           The subcommand is basically a single letter, but to increase
           readability, it can be written as a word, i.e., an arbitrary
           sequence of characters terminated by the next tab, space, or
           newline character.  All characters of the subcommand word but the
           first are simply ignored.  For example, _troff_ outputs the
           initialization command **x i** as **x init** and the resolution command
           **x r** as **x res**.  But writings like **x i_like_groff** and
           **x roff_is_groff** are accepted as well to mean the same commands.
    
           In the following, the syntax element _⟨line-break⟩_ means a
           _syntactical line break_ as defined in subsection “Separation”
           above.
    
           **xF** _name_ ⟨line-break⟩
                  (_Filename_ control command)
                  Use _name_ as the intended name for the current file in error
                  reports.  This is useful for remembering the original file
                  name when _groff_ uses an internal piping mechanism.  The
                  input file is not changed by this command.  This command is
                  a _groff_ extension.
    
           **xf** _n s_ ⟨line-break⟩
                  (_font_ control command)
                  Mount font position _n_ (a non-negative integer) with font
                  named _s_ (a text word); see _groff_font_(5).
    
           **xH** _n_ ⟨line-break⟩
                  (_Height_ control command)
                  Set character height to _n_ (a positive integer in scaled
                  points **z**).  _Classical troff_ used the unit points (**p**)
                  instead; see section “Compatibility” below.
    
           **xi** ⟨line-break⟩
                  (_init_ control command)
                  Initialize device.  This is the third command of the
                  _prologue_.
    
           **xp** ⟨line-break⟩
                  (_pause_ control command)
                  Parsed but ignored.  The classical documentation reads
                  _pause device, can be restarted_.
    
           **xr** _n h v_ ⟨line-break⟩
                  (_resolution_ control command)
                  Resolution is _n_ , while _h_ is the minimal horizontal motion,
                  and _v_ the minimal vertical motion possible with this
                  device; all arguments are positive integers in basic
                  units **u** per inch.  This is the second command of the
                  _prologue_.
    
           **xS** _n_ ⟨line-break⟩
                  (_Slant_ control command)
                  Set slant to _n_ degrees (an integer in basic units **u**).
    
           **xs** ⟨line-break⟩
                  (_stop_ control command)
                  Terminates the processing of the current file; issued as
                  the last command of any _intermediate troff output_.
    
           **xt** ⟨line-break⟩
                  (_trailer_ control command)
                  Generate trailer information, if any.  In **groff** , this is
                  currently ignored.
    
           **xT** _xxx_ ⟨line-break⟩
                  (_Typesetter_ control command)
                  Set the name of the output driver to _xxx_ , a sequence of
                  non-whitespace characters terminated by whitespace.  The
                  possible names correspond to those of _groff_ 's **-T** option.
                  This is the first command of the prologue.
    
           **xu** _n_ ⟨line-break⟩
                  (_underline_ control command)
                  Configure underlining of spaces.  If _n_ is 1, start
                  underlining of spaces; if _n_ is 0, stop underlining of
                  spaces.  This is needed for the **cu** request in **nroff** mode
                  and is ignored otherwise.  This command is a _groff_
                  extension.
    
           **xX** _anything_ ⟨line-break⟩
                  (_X-escape_ control command)
                  Send string _anything_ uninterpreted to the device.  If the
                  line following this command starts with a **+** character this
                  line is interpreted as a continuation line in the following
                  sense.  The **+** is ignored, but a newline character is sent
                  instead to the device, the rest of the line is sent
                  uninterpreted.  The same applies to all following lines
                  until the first character of a line is not a **+** character.
                  This command is generated by the _groff_ escape sequence **\X**.
                  The line-continuing feature is a _groff_ extension.
    
       **Obsolete command**
           In _classical troff_ output, emitting a single glyph was mostly done
           by a very strange command that combined a horizontal move and the
           printing of a glyph.  It didn't have a command code, but is
           represented by a 3-character argument consisting of exactly
           2 digits and a character.
    
           _ddc_    Move right _dd_ (exactly two decimal digits) basic units **u** ,
                  then print glyph with single-letter name _c_.
    
                  In _groff_ , arbitrary _syntactical space_ around and within
                  this command is allowed to be added.  Only when a preceding
                  command on the same line ends with an argument of variable
                  length a separating space is obligatory.  In _classical_
                  _troff_ , large clusters of these and other commands were
                  used, mostly without spaces; this made such output almost
                  unreadable.
    
           For modern high-resolution devices, this command does not make
           sense because the width of the glyphs can become much larger than
           two decimal digits.  In _groff_ , it is used only for output to the
           **X75** , **X75-12** , **X100** , and **X100-12** devices.  For others, the commands
           **t** and **u** provide greater functionality and superior troubleshooting
           capacity.
    


## Postprocessing



           The _roff_ postprocessors are programs that have the task to
           translate the _intermediate output_ into actions that are sent to a
           device.  A device can be some piece of hardware such as a printer,
           or a software file format suitable for graphical or text
           processing.  The _groff_ system provides powerful means that make
           the programming of such postprocessors an easy task.
    
           There is a library function that parses the _intermediate output_
           and sends the information obtained to the device via methods of a
           class with a common interface for each device.  So a _groff_
           postprocessor must only redefine the methods of this class.  For
           details, see the reference in section “Files” below.
    


## Example



           This section presents the _intermediate output_ generated from the
           same input for three different devices.  The input is the sentence
           _hell world_ fed into _groff_ on the command line.
    
           •  High-resolution device _ps_
    
              shell> **echo "hell world" | groff -Z -T ps**
    
              x T ps
              x res 72000 1 1
              x init
              p1
              x font 5 TR
              f5
              s10000
              V12000
              H72000
              thell
              wh2500
              tw
              H96620
              torld
              n12000 0
              x trailer
              V792000
              x stop
    
           This output can be fed into the postprocessor _grops_(1) to get its
           representation as a PostScript file, or _gropdf_(1) to output
           directly to PDF.
    
           •  Low-resolution device _latin1_
    
              This is similar to the high-resolution device except that the
              positioning is done at a minor scale.  Some comments (lines
              starting with _#_) were added for clarification; they were not
              generated by the formatter.
    
              **shell > **"hell world" | groff -Z -T latin1
    
              _# prologue_
              x T latin1
              x res 240 24 40
              x init
              _# begin a new page_
              p1
              _# font setup_
              x font 1 R
              f1
              s10
              _# initial positioning on the page_
              V40
              H0
              _# write text 'hell'_
              thell
              _# inform about a space, and do it by a horizontal jump_
              wh24
              _# write text 'world'_
              tworld
              _# announce line break, but do nothing because ..._
              n40 0
              _# ... the end of the document has been reached_
              x trailer
              V2640
              x stop
    
           This output can be fed into the postprocessor _grotty_(1) to get a
           formatted text document.
    
           •  Classical style output
    
              As a computer monitor has a very low resolution compared to
              modern printers the _intermediate output_ for the X devices can
              use the jump-and-write command with its 2-digit displacements.
    
              **shell > **"hell world" | groff -Z -T X100
    
              x T X100
              x res 100 1 1
              x init
              p1
              x font 5 TR
              f5
              s10
              V16
              H100
              _# write text with old-style jump-and-write command_
              ch07e07l03lw06w11o07r05l03dh7
              n16 0
              x trailer
              V1100
              x stop
    
           This output can be fed into the postprocessor _xditview_(1x) or
           _gxditview_(1) for displaying in X.
    
           Due to the obsolete jump-and-write command, the text clusters in
           the classical output are almost unreadable.
    


## Compatibility



           The _intermediate output_ language of the _classical troff_ was first
           documented in [CSTR #97].  The _groff intermediate output_ format is
           compatible with this specification except for the following
           features.
    
           •  The classical quasi device independence is not yet implemented.
    
           •  The old hardware was very different from what we use today.  So
              the _groff_ devices are also fundamentally different from the
              ones in _classical troff_.  For example, the classical PostScript
              device was called _post_ and had a resolution of 720 units per
              inch, while _groff_ 's _ps_ device has a resolution of 72000 units
              per inch.  Maybe, by implementing some rescaling mechanism
              similar to the classical quasi device independence, these could
              be integrated into modern _groff_.
    
           •  The B-spline command **D~** is correctly handled by the
              _intermediate output_ parser, but the drawing routines aren't
              implemented in some of the postprocessor programs.
    
           •  The argument of the commands **s** and **x H** has the implicit unit
              scaled point **z** in _groff_ , while _classical troff_ had point (**p**).
              This isn't an incompatibility, but a compatible extension, for
              both units coincide for all devices without a _sizescale_
              parameter, including all classical and the _groff_ text devices.
              The few _groff_ devices with a sizescale parameter either did not
              exist, had a different name, or seem to have had a different
              resolution.  So conflicts with classical devices are very
              unlikely.
    
           •  The position changing after the commands **Dp** , **DP** , and **Dt** is
              illogical, but as old versions of groff used this feature it is
              kept for compatibility reasons.
    
           The differences between _groff_ and _classical troff_ are documented
           in _groff_diff_(7).
    


## Files



           _/usr/local/share/groff/1.23.0/font/dev_ name _/DESC_
                  describes the output device _name_.
    


## Authors



           James Clark wrote an early version of this document, which
           described only the differences between AT&T device-independent
           _troff_ 's page description language and that of GNU _troff_.  It has
           since been expanded and revised by Bernd Warken ⟨groff-bernd
           .warken-72@web.de⟩ and G. Branden Robinson ⟨g.branden.robinson@
           gmail.com⟩.
    


## See also



           _Groff: The GNU Implementation of troff_ , by Trent A. Fisher and
           Werner Lemberg, is the primary _groff_ manual.  You can browse it
           interactively with “info groff”.
    
           “Troff User's Manual” by Joseph F. Ossanna, 1976 (revised by Brian
           W. Kernighan, 1992), AT&T Bell Laboratories Computing Science
           Technical Report No. 54, widely called simply “CSTR #54”,
           documents the language, device and font description file formats,
           and device-independent page description language referred to
           collectively in _groff_ documentation as “AT&T _troff_ ”.
    
           “A Typesetter-independent TROFF” by Brian W. Kernighan, 1982, AT&T
           Bell Laboratories Computing Science Technical Report No. 97,
           (CSTR #97), provides additional insights into the device and font
           description file formats and device-independent page description
           language.
    
           _groff_(1)
                  documents the **-Z** option and contains pointers to further
                  _groff_ documentation.
    
           _groff_(7)
                  describes the _groff_ language, including its escape
                  sequences and system of units.
    
           _groff_font_(5)
                  details the scaling parameters of _DESC_ (device description)
                  files.
    
           _troff_(1)
                  generates the language documented here.
    
           _roff_(7)
                  presents historical aspects and the general structure of
                  _roff_ systems.
    
           _groff_diff_(7)
                  enumerates differences between the output of AT&T _troff_ and
                  that of GNU _troff_.
    
           _gxditview_(1)
                  is a viewer for device-independent _troff_ output.
    
           _Roff.js_
                  ⟨https://github.com/Alhadis/Roff.js/⟩ is a viewer for
                  device-independent _troff_ output written in JavaScript.
    
           _grodvi_(1), _grohtml_(1), _grolbp_(1), _grolj4_(1), _gropdf_(1), _grops_(1),
           and _grotty_(1) are _groff_ postprocessors.
    


* * *