# man > GROFF_OUT(5)

[GROFF_OUT(5)](https://www.chedong.com/phpMan.php/man/GROFFOUT/5/markdown)                             File Formats Manual                            [GROFF_OUT(5)](https://www.chedong.com/phpMan.php/man/GROFFOUT/5/markdown)



## NAME
       groff_out - groff intermediate output format

## DESCRIPTION
       This  manual page describes the _intermediate_ _output_ format of the GNU [**roff**(7)](https://www.chedong.com/phpMan.php/man/roff/7/markdown) text processing
       system [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown).  This output is produced by a run of the GNU [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown) program.  It  contains
       already  all  device-specific  information, but it is not yet fed into a device postprocessor
       program.

       As the GNU _roff_ processor [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown) is a wrapper program around **troff** that automatically calls
       a  postprocessor, this output does not show up normally.  This is why it is called _intermedi__‐
       _ate_ within the _groff_ _system_.  The **groff** program provides the option **-Z**  to  inhibit  postpro‐
       cessing,  such  that  the  produced  _intermediate_ _output_ is sent to standard output just like
       calling **troff** manually.

       In this document, the term _troff_ _output_ describes what is output by the  GNU  **troff**  program,
       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  ob‐
       solete  elements for compatibility, otherwise both formats are the same.  Both formats can be
       viewed directly with [**gxditview**(1)](https://www.chedong.com/phpMan.php/man/gxditview/1/markdown).

       The main purpose of the _intermediate_ _output_ concept is to facilitate the development of post‐
       processors by providing a common programming interface for all devices.  It has a language of
       its own that is completely different from the [**groff**(7)](https://www.chedong.com/phpMan.php/man/groff/7/markdown) language.  While the _groff_ 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 pre-_groff_ _roff_ versions are denoted as _classical_ _troff_.  The _intermediate_ _output_ produced
       by **groff** is fairly readable, while _classical_ _troff_ output was hard to understand  because  of
       strange habits that are still supported, but not used any longer by _GNU_ _troff_.

## LANGUAGE CONCEPTS
       During  the run of **troff**, the _roff_ input is cracked down to the information on what has to be
       printed at what position on the intended device.  So the language of the _intermediate_  _output_
       format  can  be  quite  small.  Its only elements are commands with or without arguments.  In
       this document, the term “command” always refers to the _intermediate_ _output_ language, never to
       the  _roff_ language used for document formatting.  There are commands for positioning and text
       writing, for drawing, and for device controlling.

### Separation
       _Classical_ _troff_ _output_ had strange requirements on whitespace.  The **groff** output parser, how‐
       ever,  is smart about whitespace by making it maximally optional.  The whitespace characters,
       i.e., the _tab_, _space_, and _newline_ characters, always have a syntactical  meaning.   They  are
       never printable because spacing within the output is always done by positioning commands.

       Any  sequence  of _space_ or _tab_ characters is treated as a single _syntactical_ _space_.  It sepa‐
       rates commands and arguments, but is only required when there would occur a clashing  between
       the command code and the arguments without the space.  Most often, this happens when variable
       length command names, arguments, argument lists, or command clusters meet.  Commands and  ar‐
       guments with a known, fixed length need not be separated by _syntactical_ _space_.

       A line break is a syntactical element, too.  Every command argument can be followed by white‐
       space, a comment, or a newline character.  Thus a _syntactical_ _line_ _break_ is defined  to  con‐
       sist  of  optional  _syntactical_ _space_ that is optionally followed by a comment, and a newline
       character.

       The normal commands, those for positioning and text, consist of  a  single  letter  taking  a
       fixed  number  of arguments.  For historical reasons, the parser allows stacking of such com‐
       mands on the same line, but fortunately, in _groff_ _intermediate_ _output_, every command with  at
       least one argument is followed by a line break, thus providing excellent readability.

       The  other  commands  —  those  for  drawing and device controlling — have a more complicated
       structure; some recognize long command names, and some take a variable number  of  arguments.
       So  all  **D**  and **x** commands were designed to request a _syntactical_ _line_ _break_ after their last
       argument.  Only one command, ‘**x** **X**’ has an argument that can stretch over several  lines,  all
       other  commands  must  have all of their arguments on the same line as the command, i.e., the
       arguments may not be split by a line break.

       Empty lines, i.e., lines containing only space and/or a comment, can occur everywhere.   They
       are just ignored.

### Argument Units
       Some  commands  take  integer arguments that are assumed to represent values in a measurement
       unit, but the letter for the corresponding _scale_ _indicator_ is not  written  with  the  output
       command arguments; see [**groff**(7)](https://www.chedong.com/phpMan.php/man/groff/7/markdown) and _Groff:_ _The_ _GNU_ _Implementation_ _of_ _troff_, the _groff_ Texinfo
       manual, for more on this topic.  Most commands assume the scale indicator **u**, the  basic  unit
       of  the  device,  some  use **z**, the _scaled_ _point_ _unit_ of the device, while others, such as the
       color commands expect plain integers.  Note that these scale indicators are relative  to  the
       chosen  device.   They are defined by the parameters specified in the device's _DESC_ file; see
       **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown).

       Note that single characters can have the eighth bit set, as can the names of fonts  and  spe‐
       cial 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  new‐
       line); 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 speci‐
       fied 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 se‐
       quence of any commands different from the ones used in the _prologue_.   Processing  is  termi‐
       nated as soon as the first **x** **stop** command is encountered; the last line of any _groff_ _interme__‐
       _diate_ _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_⟨⟨**end-of-line**⟩⟩
              A  comment.  Ignore any characters from the **#** character up to the next newline charac‐
              ter.

       This command is the only possibility for commenting in the _intermediate_ _output_.  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 be‐
       fore, 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 only necessary when two integer
       arguments would clash or if the preceding argument ends with a string argument.

       **C** _xxx_⟨white-space⟩
              Print  a  glyph (special character) named _xxx_.  The trailing _syntactical_ _space_ or _line_
              _break_ is necessary to allow glyph names of arbitrary length.  The glyph is printed  at
              the  current  print  position; the glyph's size is read from the font file.  The print
              position is not changed.

       **c** _c_    Print glyph with single-letter name _c_ at the current print position; the glyph's  size
              is read from the font file.  The print position is not changed.

       **f** _n_    Set font to font number _n_ (a non-negative integer).

       **H** _n_    Move  right  to  the  absolute  vertical  position  _n_ (a non-negative integer in basic
              units **u**) relative to left edge of current page.

       **h** _n_    Move _n_ (a non-negative integer) basic units **u** horizontally to the right.   [CSTR  #54]
              allows negative values for _n_ also, but _groff_ doesn't use this.

       **m** _color-scheme_ [_component_ _..._]
              Set  the color for text (glyphs), line drawing, and the outline of graphic objects us‐
              ing different color schemes; the analogous command for the filling  color  of  graphic
              objects  is **DF**.  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 sequence **\m**.  No position
              changing.  These commands are a _groff_ extension.

              **mc** _cyan_ _magenta_ _yellow_
                     Set color using the CMY color scheme, having the 3 color components  cyan,  ma‐
                     genta, and yellow.

              **md**     Set color to the default color value (black in most cases).  No component argu‐
                     ments.

              **mg** _gray_
                     Set color to the shade of gray given by the  argument,  an  integer  between  0
                     (black) and 65536 (white).

              **mk** _cyan_ _magenta_ _yellow_ _black_
                     Set  color using the CMYK color scheme, having the 4 color components cyan, ma‐
                     genta, yellow, and black.

              **mr** _red_ _green_ _blue_
                     Set color using the RGB color scheme, having the 3 color components red, green,
                     and blue.

       **N** _n_    Print glyph with index _n_ (an integer, normally non-negative) of the current font.  The
              print position is not changed.  If **-T** **html** or **-T** **xhtml** is used,  negative  values  are
              emitted  also  to indicate an unbreakable space with given width.  For example, **N** **-193**
              represents an unbreakable space which has a width of 193u.  This command  is  a  _groff_
              extension.

       **n** _b_ _a_  Inform  the device about a line break, but no positioning is done by this command.  In
              _classical_ _troff_, the integer arguments _b_ and _a_ informed about the space before and af‐
              ter  the current line to make the _intermediate_ _output_ more human readable without per‐
              forming any action.  In _groff_, they are just ignored, but they must  be  provided  for
              compatibility reasons.

       **p** _n_    Begin  a  new  page  in the outprint.  The page number is set to _n_.  This page is com‐
              pletely independent of pages formerly processed even if those have the same page  num‐
              ber.   The vertical position on the outprint is automatically set to 0.  All position‐
              ing, writing, and drawing is always done relative to a page, so a **p**  command  must  be
              issued before any of these commands.

       **s** _n_    Set point size to _n_ scaled points (this is unit **z** in GNU **troff**).  _Classical_ _troff_ used
              the unit _points_ (**p**) instead; see section “Compatibility” below.

       **t** _xyz..._⟨white-space⟩
       **t** _xyz..._ _dummy-arg_⟨white-space⟩
              Print a word, i.e., a sequence of glyphs with single-letter names _x_, _y_, _z_, etc.,  ter‐
              minated  by  a space character or a line break; an optional second integer argument is
              ignored (this allows the formatter to generate an  even  number  of  arguments).   The
              first glyph should be printed at the current position, the current horizontal position
              should then be increased by the width of the first glyph, and so on  for  each  glyph.
              The  widths  of  the  glyph  are read from the font file, scaled for the current point
              size, and rounded to a multiple of  the  horizontal  resolution.   Special  characters
              (glyphs  with names longer than a single letter) cannot be printed using this command;
              use the **C** command for those glyphs.  This command is a _groff_  extension;  it  is  only
              used for devices whose _DESC_ file contains the **tcommand** keyword; see **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown).

       **u** _n_ _xyz..._⟨white-space⟩
              Print  word  with  track kerning.  This is the same as the **t** command except that after
              printing each glyph, the current horizontal position is increased by the  sum  of  the
              width  of that glyph and _n_ (an integer in basic units **u**).  This command is a _groff_ ex‐
              tension; it is only used for devices whose _DESC_ file contains  the  **tcommand**  keyword;
              see **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown).

       **V** _n_    Move  down  to  the  absolute  vertical  position  _n_  (a non-negative integer in basic
              units **u**) relative to upper edge of current page.

       **v** _n_    Move _n_ basic units **u** down (_n_ is a non-negative integer).  [CSTR #54]  allows  negative
              values for _n_ also, but _groff_ doesn't use this.

       **w**      Informs  about a paddable whitespace to increase readability.  The spacing itself must
              be performed explicitly by a move command.

### 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 inte‐
       gers 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 dis‐
       tances 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)](https://www.chedong.com/phpMan.php/man/groff/7/markdown).

       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  ob‐
              jects  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).  No position changing.  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 ar‐
                     gument, 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.

              No position changing.  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 actual horizontal position and the even ones to the vertical po‐
              sition.  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 se‐
              lect the smallest available line thickness; if _n_<0 set the line thickness proportional
              to  the  point  size  (this is the default before the first **Dt** command was specified).
              For historical reasons, the horizontal position is changed by adding the  argument  to
              the  actual 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_  exten‐
              sion.

### 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  com‐
       mand **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)](https://www.chedong.com/phpMan.php/man/font/5/markdown).

       **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 _in__‐
              _termediate_ _troff_ _output_.

       **xt** ⟨line-break⟩
              (_trailer_ control command)
              Generate trailer information, if any.  In **groff**, this is actually just ignored.

       **xT** _xxx_⟨line-break⟩
              (_Typesetter_ control command)
              Set name of device to word _xxx_, a sequence of characters ended by the next  whitespace
              character.   The  possible  device names coincide with those from the groff **-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 fol‐
              lowing sense.  The **+** is ignored, but a newline character is sent instead  to  the  de‐
              vice,  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  gen‐
              erated by the _groff_ escape sequence **\X**.  The line-continuing feature is a _groff_ exten‐
              sion.

### 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  sin‐
              gle-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  vari‐
              able  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  al‐
              most 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**, this is only used  for  the
       devices  **X75**,  **X75-12**,  **X100**, and **X100-12**.  For other devices, the commands **t** and **u** provide a
       better functionality.

## 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_ sys‐
       tem 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 ob‐
       tained 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 ref‐
       erence in section “Files” below.

## EXAMPLES
       This section presents the _intermediate_ _output_ generated from the same input for three differ‐
       ent 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)](https://www.chedong.com/phpMan.php/man/grops/1/markdown) to get its representation as a Post‐
       Script file, or [**gropdf**(1)](https://www.chedong.com/phpMan.php/man/gropdf/1/markdown) 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  mi‐
         nor  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)](https://www.chedong.com/phpMan.php/man/grotty/1/markdown) to get a formatted text document.

       • Classical style output

         As a computer monitor has a very low resolution compared to modern printers the  _intermedi__‐
         _ate_  _output_ for the X devices can use the jump-and-write command with its 2-digit displace‐
         ments.

         **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)](https://www.chedong.com/phpMan.php/man/xditview/1x/markdown)  or  [**gxditview**(1)](https://www.chedong.com/phpMan.php/man/gxditview/1/markdown)  for  displaying
       in X.

       Due to the obsolete jump-and-write command, the text clusters in the classical output are al‐
       most 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 Post‐
         Script 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  clas‐
         sical  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  con‐
         flicts 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)](https://www.chedong.com/phpMan.php/man/diff/7/markdown).

## FILES
       _/usr/share/groff/1.22.4/font/dev_name_/DESC_
              Device description file for device _name_.

       _src/libs/libdriver/input.cpp_
              Defines the parser and postprocessor for the _intermediate_ _output_.  It is located rela‐
              tive  to  the  top  directory of the _groff_ source tree.  This parser is the definitive
              specification of the _groff_ _intermediate_ _output_ format.

## AUTHORS
       James Clark wrote an early version of this document, which described only the differences be‐
       tween  [**ditroff**(7)](https://www.chedong.com/phpMan.php/man/ditroff/7/markdown)'s  output  format and that of GNU _roff_.  The present version was completely
       rewritten in 2001 by Bernd Warken ⟨<groff-bernd.warken-72@web.de>⟩.

## SEE ALSO
       A reference like [**groff**(7)](https://www.chedong.com/phpMan.php/man/groff/7/markdown) refers to a manual page; here **groff** in section _7_ of  the  man  page
       documentation  system.  To read the example, look up section 7 in your desktop help system or
       call from the shell prompt

              **shell>** man 7 groff

       For more details, see [**man**(1)](https://www.chedong.com/phpMan.php/man/man/1/markdown).

       [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown)
              option **-Z** and further readings on groff.

       [**groff**(7)](https://www.chedong.com/phpMan.php/man/groff/7/markdown)
              for details of the _groff_ language such as numerical units and escape sequences.

       **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown)
              for details on the device scaling parameters of the _DESC_ file.

       [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown)
              generates the device-independent intermediate output.

       [**roff**(7)](https://www.chedong.com/phpMan.php/man/roff/7/markdown)
              for historical aspects and the general structure of roff systems.

       **groff**___**[diff**(7)](https://www.chedong.com/phpMan.php/man/diff/7/markdown)
              The differences between the intermediate output in groff and classical troff.

       [**gxditview**(1)](https://www.chedong.com/phpMan.php/man/gxditview/1/markdown)
              Viewer for the _intermediate_ _output_.

       [**grodvi**(1)](https://www.chedong.com/phpMan.php/man/grodvi/1/markdown), [**grohtml**(1)](https://www.chedong.com/phpMan.php/man/grohtml/1/markdown), [**grolbp**(1)](https://www.chedong.com/phpMan.php/man/grolbp/1/markdown), [**grolj4**(1)](https://www.chedong.com/phpMan.php/man/grolj4/1/markdown), [**grops**(1)](https://www.chedong.com/phpMan.php/man/grops/1/markdown), [**grotty**(1)](https://www.chedong.com/phpMan.php/man/grotty/1/markdown)
              the groff postprocessor programs.

       _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”.

       The  _classical_ _troff_ _output_ _language_ is described in two AT&T Bell Labs CSTR documents avail‐
       able on-line at Bell Labs CSTR site ⟨<http://cm.bell-labs.com/cm/cs/cstr.html>⟩.

       [CSTR #97]
              _A_ _Typesetter-independent_ _TROFF_ by _Brian_ _Kernighan_ is the original and most  comprehen‐
              sive  documentation  on the output language; see CSTR #97 ⟨<http://cm.bell-labs.com/cm/>
              cs/cstr/97.ps.gz⟩.

       [CSTR #54]
              The 1992 revision of the  _Nroff/Troff_  _User's_  _Manual_  by  _J._  _F._  _Ossanna_  and  _Brian_
              _Kernighan_  isn't  as  comprehensive  as  [CSTR #97] regarding the output language; see
              CSTR #54 ⟨<http://cm.bell-labs.com/cm/cs/cstr/54.ps.gz>⟩.



groff 1.22.4                                23 March 2022                               [GROFF_OUT(5)](https://www.chedong.com/phpMan.php/man/GROFFOUT/5/markdown)
