Seth Woolley's Man Viewer

Manual for groff - man groff

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

GROFF(1)                                                              GROFF(1)

       groff(1,7) - front-end for the groff(1,7) document formatting system

       groff(1,7) [-abcegilpstzCEGNRSUVXZ] [-d cs] [-f fam(1m,3)] [-F dir] [-I dir]
             [-L arg] [-m name] [-M dir] [-n num] [-o list] [-P arg] [-r cn]
             [-T dev] [-w name] [-W name] [file(1,n) ...]
       groff(1,7) -h | --help
       groff(1,7) -v | --version [option ...]

       The  command line is parsed according to the usual GNU convention.  The
       whitespace between a command line option and its argument is  optional.
       Options can be grouped behind a single - (minus character).  A filename
       of - (minus character) denotes the standard input.

       This document describes the groff(1,7) program, the main front-end  for  the
       groff(1,7) document formatting system.  The groff(1,7) program and macro suite is
       the implementation of a roff(7) system within the free software collec-
       tion  GNU  <>.   The groff(1,7) system has all features of
       the classical roff, but adds many extensions.

       The groff(1,7) program allows to control the whole groff(1,7) system  by  command
       line  options.   This  is  a  great simplification in(1,8) comparison to the
       classical case (which uses pipes only).

       As groff(1,7) is a wrapper program for troff both programs share  a  set(7,n,1 builtins)  of
       options.  But the groff(1,7) program has some additional, native options and
       gives a new meaning to some troff options.  On the other hand, not  all
       troff options can be fed into groff(1,7).

   Native groff(1,7) Options
       The  following options either do not exist for troff or are differently
       interpreted by groff(1,7).

       -e     Preprocess with eqn.

       -g     Preprocess with grn.

       -G     Preprocess with grap.

       -h --help
              Print a help message.

       -I dir This option may be used to specify a  directory  to  search  for
              files  (both  those on the command line and those named(5,8) in(1,8) .psbb
              and .so requests, and \X'ps: import' and \X'ps: file(1,n)'  escapes).
              The current directory is always searched first.  This option may
              be specified more than once; the directories will be searched in(1,8)
              the order specified.  No directory search is performed for files
              specified using an absolute path.  This option  implies  the  -s

       -l     Send  the output to a spooler program for printing.  The command
              that should be used for this is specified by the  print  command
              in(1,8) the device description file(1,n), see groff_font(5).  If this com-
              mand is not present, the output is piped into the lpr(1) program
              by default.  See options -L and -X.

       -L arg Pass  arg  to  the spooler program.  Several arguments should be
              passed with a separate -L option each.  Note that groff(1,7) does not
              prepend - (a minus sign) to arg before passing it to the spooler

       -N     Don't allow newlines within eqn delimiters.  This is the same as
              the -N option in(1,8) eqn.

       -p     Preprocess with pic.

       -P -option
       -P -option -P arg
              Pass  -option  or  -option arg to the postprocessor.  The option
              must be specified with the necessary preceding minus sign(s) `-'
              or `--' because groff(1,7) does not prepend any dashes before passing
              it to the postprocessor.  For example, to pass a  title  to  the
              gxditview postprocessor, the shell command

              sh# groff(1,7) -X -P -title -P 'groff(1,7) it' foo

              is equivalent to

              sh# groff(1,7) -X -Z foo | gxditview -title 'groff(1,7) it' -

       -R     Preprocess with refer.  No mechanism is provided for passing ar-
              guments to refer because most refer options have equivalent lan-
              guage  elements  that can be specified within the document.  See
              refer(1) for more details.

       -s     Preprocess with soelim.

       -S     Safer mode.  Pass the -S option to pic and disable the following
              troff requests: .open, .opena, .pso, .sy, and .pi.  For security
              reasons, safer mode is enabled by default.

       -t     Preprocess with tbl.

       -T dev Set output device to dev.  Contrary  to  troff,  groff(1,7)  calls  a
              postprocessor  to convert troff's intermediate output to its fi-
              nal format.  Real devices in(1,8) groff(1,7) are

                     dvi    TeX DVI format (postprocessor is grodvi).

                     html   HTML  output   (preprocessors   are   soelim   and
                            pre-grohtml, postprocessor is post-grohtml).

                     lbp    Canon CAPSL printers (LBP-4 and LBP-8 series laser
                            printers; postprocessor is grolbp).

                     lj4    HP LaserJet4 compatible (or other PCL5 compatible)
                            printers (postprocessor is grolj4).

                     ps     PostScript output (postprocessor is grops).

              For  the  following  TTY output devices (postprocessor is always
              grotty), -T selects the output encoding:

                     ascii(1,7)  7bit ASCII.

                     cp1047 Latin-1 character set(7,n,1 builtins) for EBCDIC hosts.

                     latin1 ISO 8859-1.

                     utf8   Unicode character set(7,n,1 builtins) in(1,8) UTF-8 encoding.

              The following arguments select(2,7,2 select_tut) gxditview as the  `postprocessor'
              (it is rather a viewing program):

                     X75    75dpi resolution, 10pt document base font.

                     X75-12 75dpi resolution, 12pt document base font.

                     X100   100dpi resolution, 10pt document base font.

                            100dpi resolution, 12pt document base font.

              The default device is ps.

       -U     Unsafe  mode.  Reverts to the (old) unsafe behaviour; see option

       -v --version
              Output version(1,3,5) information of groff(1,7) and of all programs that are
              run by it; that is, the given command line is parsed in(1,8) the usu-
              al way, passing -v to all subprograms.

       -V     Output the pipeline that would be run by  groff(1,7)  (as  a  wrapper
              program) on the standard output, but do not execute it.  If giv-
              en more than once, the commands will  be  both  printed  on  the
              standard error(8,n) and run.

       -X     Use  gxditview  instead  of  using  the  usual  postprocessor to
              (pre)view a document.  The printing spooler behavior as outlined
              with options -l and -L is carried over to gxditview(1) by deter-
              mining an argument for the -printCommand option of gxditview(1).
              This  sets  the  default Print action and the corresponding menu(3x,n,n tk_menuSetFocus)
              entry to that value.  -X only produces good results  with  -Tps,
              -TX75,  -TX75-12, -TX100, and -TX100-12.  The default resolution
              for previewing -Tps output is 75dpi;  this  can  be  changed  by
              passing the -resolution option to gxditview, for example

              sh# groff(1,7) -X -P-resolution -P100 -man foo.1

       -z     Suppress output generated by troff.  Only error(8,n) messages will be

       -Z     Do not postprocess the output of troff that is  normally  called
              automatically by groff(1,7).  This will print the intermediate output
              to standard output; see groff_out(5).

   Transparent Options
       The following options are transparently handed over  to  the  formatter
       program  troff that is called by groff(1,7) subsequently.  These options are
       described in(1,8) more detail in(1,8) troff(1).

       -a     ascii(1,7) approximation of output.

       -b     backtrace on error(8,n) or warning.

       -c     disable color output.

       -C     enable compatibility mode.

       -d cs
       -d name=s
              define string.

       -E     disable troff error(8,n) messages.

       -f fam(1m,3) set(7,n,1 builtins) default font family.

       -F dir set(7,n,1 builtins) path for font DESC files.

       -i     process standard input after the specified input files.

       -m name
              include  macro  file(1,n)  name.tmac   (or;   see   also

       -M dir path for macro files.

       -n num number the first page num.

       -o list
              output only pages in(1,8) list.

       -r cn
       -r name=n
              set(7,n,1 builtins) number register.

       -w name
              enable warning name.

       -W name
              disable warning name.

       The  groff(1,7)  system implements the infrastructure of classical roff; see
       roff(7) for a survey on how a roff system works in(1,8) general.  Due to the
       front-end  programs  available  within the groff(1,7) system, using groff(1,7) is
       much easier than classical roff.  This section gives an overview of the
       parts  that  constitute  the groff(1,7) system.  It complements roff(7) with
       groff-specific features.  This section can be regarded as  a  guide  to
       the documentation around the groff(1,7) system.

       The  groff(1,7) program is a wrapper around the troff(1) program.  It allows
       to specify the preprocessors by command line options and  automatically
       runs  the  postprocessor  that  is appropriate for the selected device.
       Doing so, the sometimes tedious piping mechanism of  classical  roff(7)
       can be avoided.

       The  grog(1) program can be used for guessing the correct groff(1,7) command
       line to format a file.

       The groffer(1) program is an allround-viewer for groff(1,7)  files  and  man(1,5,7)

       The  groff(1,7)  preprocessors  are  reimplementations of the classical pre-
       processors with moderate  extensions.   The  preprocessors  distributed
       with the groff(1,7) package are

       eqn(1) for mathematical formul,

       grn(1) for including gremlin(1) pictures,

       pic(1) for drawing diagrams,

              for bibliographic references,

              for including macro files from standard locations,


       tbl(1) for tables.

       Besides these, there are some internal preprocessors that are automati-
       cally run with some devices.  These aren't visible to the user.

   Macro Packages
       Macro packages can be included by option -m.  The groff(1,7)  system  imple-
       ments  and extends all classical macro packages in(1,8) a compatible way and
       adds some packages of its own.  Actually, the following macro  packages
       come with groff(1,7):

       man(1,5,7)    The  traditional  man(1,5,7)  page format; see groff_man(7).  It can be
              specified on the command line as -man or -m man(1,5,7).

       mandoc The general package for man(1,5,7) pages; it  automatically  recognizes
              whether  the  documents  uses  the  man(1,5,7)  or  the mdoc format and
              branches to the corresponding macro package.  It can  be  speci-
              fied on the command line as -mandoc or -m mandoc.

       mdoc   The  BSD-style  man(1,5,7)  page  format; see groff_mdoc(7).  It can be
              specified on the command line as -mdoc or -m mdoc.

       me     The classical me document format; see groff_me(7).   It  can  be
              specified on the command line as -me or -m me.

       mm     The  classical  mm  document format; see groff_mm(7).  It can be
              specified on the command line as -mm or -m mm.

       ms     The classical ms document format; see groff_ms(7).   It  can  be
              specified on the command line as -ms or -m ms.

       www    HTML-like macros for inclusion in(1,8) arbitrary groff(1,7) documents; see

       Details on the naming of macro files and their placement can  be  found
       in(1,8) groff_tmac(5).

   Programming Language
       General concepts common to all roff programming languages are described
       in(1,8) roff(7).

       The groff(1,7) extensions to the classical troff language are documented  in(1,8)

       The  groff(1,7)  language  as a whole is described in(1,8) the (still incomplete)
       groff(1,7) info(1,5,n) file(1,n); a short (but  complete)  reference  can  be  found  in(1,8)

       The  central  roff  formatter  within the groff(1,7) system is troff(1).  It
       provides the features of both the classical troff and nroff, as well as
       the  groff(1,7)  extensions.  The command line option -C switches troff into
       compatibility mode which tries to emulate classical  roff  as  much  as

       There  is a shell script nroff(1) that emulates the behavior of classi-
       cal nroff.  It tries to automatically select(2,7,2 select_tut) the proper  output  encod-
       ing(3,n), according to the current locale.

       The  formatter program generates intermediate output; see groff_out(7).

       In roff, the output targets are called devices.   A  device  can  be  a
       piece of hardware, e.g. a printer, or a software file(1,n) format.  A device
       is specified by the option -T.  The groff(1,7) devices are as follows.

       ascii(1,7)  Text output using the ascii(1,7)(7) character set.

       cp1047 Text output using the EBCDIC code page IBM cp1047  (e.g.  OS/390

       dvi    TeX DVI format.

       html   HTML output.

       latin1 Text  output  using  the ISO Latin-1 (ISO 8859-1) character set(7,n,1 builtins);
              see iso_8859_1(7).

       lbp    Output for Canon CAPSL printers (LBP-4 and  LBP-8  series  laser

       lj4    HP LaserJet4-compatible (or other PCL5-compatible) printers.

       ps     PostScript  output;  suitable  for  printers and previewers like

       utf8   Text output using the Unicode (ISO  10646)  character  set(7,n,1 builtins)  with
              UTF-8 encoding(3,n); see unicode(7).

       X75    75dpi  X  Window  System  output  suitable  for  the  previewers
              xditview(1x) and gxditview(1).  A variant for  a  12pt  document
              base font is X75-12.

       X100   100dpi  X  Window  System  output  suitable  for  the previewers
              xditview(1x) and gxditview(1).  A variant for  a  12pt  document
              base font is X100-12.

       The  postprocessor  to be used for a device is specified by the postpro
       command in(1,8) the device description file(1,n); see groff_font(5).  This can be
       overridden with the -X option.

       The default device is ps.

       groff(1,7) provides 3 hardware postprocessors:

              for some Canon printers,

              for printers compatible to the HP LaserJet 4 and PCL5,

              for  text  output using various encodings, e.g. on text-oriented
              terminals or line-printers.

       Today, most printing or drawing hardware is handled  by  the  operating
       system, by device drivers, or by software interfaces, usually accepting
       PostScript.  Consequently, there isn't an urgent need for more hardware
       device postprocessors.

       The groff(1,7) software devices for conversion into other document file(1,n) for-
       mats are

              for the DVI format,

              for HTML format,

              for PostScript.

       Combined with the many existing free conversion tools  this  should  be
       sufficient to convert a troff document into virtually any existing data

       The following utility programs around groff(1,7) are available.

              Add information to troff font description  files  for  use  with

              Create font description files for PostScript device.

              General viewer program for groff(1,7) files and man(1,5,7) pages.

              The groff(1,7) X viewer, the GNU version(1,3,5) of xditview.

              Create font description files for lj4 device.

              Make inverted index for bibliographic databases.

              Search bibliographic databases.

              Interactively search bibliographic databases.

              Translate a PostScript font in(1,8) .pfb format to ASCII.

              Create font description files for TeX DVI device.

              roff viewer distributed with X window.

       Normally,  the path separator in(1,8) the following environment variables is
       the colon; this may vary depending on the operating system.  For  exam-
       ple, DOS and Windows use a semicolon instead.

              This  search  path, followed by $PATH, will be used for commands
              that are executed by groff(1,7).  If it is not set(7,n,1 builtins) then the directory
              where the groff(1,7) binaries were installed is prepended to PATH.

              When  there  is  a need to run different roff implementations at
              the same time(1,2,n) groff(1,7) provides the facility to prepend a prefix to
              most  of  its  programs that could provoke name clashings at run
              time(1,2,n) (default is to have none).  Historically, this  prefix  was
              the  character  g,  but it can be anything.  For example, gtroff
              stood for groff(1,7)'s troff, gtbl for the groff(1,7) version(1,3,5) of tbl.   By
              setting  GROFF_COMMAND_PREFIX to different values, the different
              roff installations can be addressed.  More exactly, if(3,n) it is set(7,n,1 builtins)
              to  prefix  xxx  then groff(1,7) as a wrapper program will internally
              call xxxtroff instead of troff.  This also applies to  the  pre-
              processors  eqn, grn, pic, refer, tbl, soelim, and to the utili-
              ties indxbib and lookbib.  This feature does not  apply  to  any
              programs  different  from the ones above (most notably groff(1,7) it-
              self) since they are unique to the groff(1,7) package.

              A list of directories in(1,8) which to search for the devname  direc-
              tory  in(1,8)  addition  to  the  default  ones.   See  troff(1)  and
              groff_font(5) for more details.

              A list of directories in(1,8) which to search for macro files in(1,8)  ad-
              dition   to   the   default   directories.    See  troff(1)  and
              groff_tmac(5) for more details.

              The directory in(1,8) which temporary files will be created.  If this
              is  not  set(7,n,1 builtins) but the environment variable TMPDIR instead, tempo-
              rary files will be created in(1,8) the directory $TMPDIR.  On  MS-DOS
              and Windows 32 platforms, the environment variables TMP and TEMP
              (in(1,8) that  order)  are  searched  also,  after  GROFF_TMPDIR  and
              TMPDIR.   Otherwise,  temporary  files  will be created in(1,8) /tmp.
              The refer(1), groffer(1), grohtml(1), and grops(1) commands  use
              temporary files.

              Preset  the default device.  If this is not set(7,n,1 builtins) the ps device is
              used as default.  This device name is overwritten by the  option

       There  are  some  directories  in(1,8)  which groff(1,7) installs all of its data
       files.  Due to different installation  habits  on  different  operating
       systems,  their  locations are not absolutely fixed, but their function
       is clearly defined and coincides on all systems.

   groff(1,7) Macro Directory
       This contains all information related to  macro  packages.   Note  that
       more  than a single directory is searched for those files as documented
       in(1,8) groff_tmac(5).  For the groff(1,7)  installation  corresponding  to  this
       document, it is located at /usr/share/groff(1,7)/1.19.1/tmac.  The following
       files contained in(1,8) the groff(1,7) macro directory have a special meaning:

              Initialization file(1,n) for troff.  This is interpreted by troff be-
              fore reading the macro sets and any input.

              Final  startup file(1,n) for troff, it is parsed after all macro sets
              have been read.

              Macro file(1,n) for macro package name.

   groff(1,7) Font Directory
       This contains all information related to  output  devices.   Note  that
       more than a single directory is searched for those files; see troff(1).
       For the groff(1,7) installation corresponding to this document, it is locat-
       ed  at  /usr/share/groff(1,7)/1.19.1/font.  The following files contained in(1,8)
       the groff(1,7) font directory have a special meaning:

              Device description file(1,n) for device name, see groff_font(5).

              Font file(1,n) for font F of device name.

       The following example illustrates the power of the groff(1,7) program  as  a
       wrapper around troff.

       To  process  a roff file(1,n) using the preprocessors tbl and pic and the me
       macro set(7,n,1 builtins), classical troff had to be called by

       sh# pic | tbl | troff -me -Tlatin1 | grotty

       Using groff(1,7), this pipe(2,8) can be shortened to the equivalent command

       sh# groff(1,7) -p -t -me -T latin1

       An even easier way to call this is to use grog(1)  to  guess  the  pre-
       processor and macro options and execute the generated command (by using
       backquotes to specify shell command substitution)

       sh# `grog -Tlatin1`

       The simplest way is to view the contents in(1,8) an automated way by calling

       sh# groffer

       On  EBCDIC  hosts  (e.g.  OS/390 Unix), output devices ascii(1,7) and latin1
       aren't available.  Similarly, output for EBCDIC code page cp1047 is not
       available on ASCII based operating systems.

       Report  bugs  to  Include a complete, self-contained
       example that will allow the bug to be reproduced, and say which version(1,3,5)
       of groff(1,7) you are using.

       Information on how to get groff(1,7) and related information is available at
       the GNU website <,7)>.  The  most  recent
       released version(1,3,5) of groff(1,7) is available for anonymous ftp at the groff(1,7)
       development site <,7)/devel/

       Three groff(1,7) mailing lists are available:
              for reporting bugs,

              for general discussion of groff(1,7),
              a  read-only list showing logs of commitments to the CVS reposi-

       Details on CVS access(2,5) and much more can be found in(1,8) the file(1,n) README  at
       the top directory of the groff(1,7) source package.

       There is a free implementation of the grap preprocessor, written by Ted
       Faber <>.  The actual version(1,3,5) can be found at the
       grap   website   <>.
       This is the only grap version(1,3,5) supported by groff.

       Copyright  1989, 2002, 2003, 2004 Free Software Foundation, Inc.

       This document is distributed under the terms of the FDL (GNU Free Docu-
       mentation  License)  version(1,3,5)  1.1 or later.  You should have received a
       copy of the FDL on your system, it is also available on-line at the GNU
       copyleft site <>.

       This  document is based on the original groff(1,7) man(1,5,7) page written by James
       Clark <>.  It was rewritten, enhanced, and put under  the
       FDL  license  by  Bernd  Warken <>.  It is maintained by
       Werner Lemberg <>.

       groff(1,7) is a GNU free software project.  All parts of the  groff(1,7)  package
       are  protected  by  GNU copyleft licenses.  The software files are dis-
       tributed under the terms of the GNU General Public License (GPL), while
       the  documentation  files mostly use the GNU Free Documentation License

       The groff(1,7) info(1,5,n) file(1,n) contains all information on the groff(1,7) system within
       a  single document.  Beneath the detailed documentation of all aspects,
       it provides examples and background information.  See info(1,5,n)(1) on how to
       read(2,n,1 builtins) it.

       Due  to  its  complex  structure,  the groff(1,7) system has many man(1,5,7) pages.
       They can be read(2,n,1 builtins) with man(1,5,7)(1) or groffer(1).

       Introduction, history(1,3,n,1 builtins) and further readings:

       Viewer for groff(1,7) files:
              groffer(1), gxditview(1), xditview(1x).

       Wrapper programs for formatters:
              groff(1,7)(1), grog(1).

       Roff preprocessors:
              eqn(1), grn(1), pic(1), refer(1), soelim(1), tbl(1), grap(1).

       Roff language with the groff(1,7) extensions:
              groff(1,7)(7), groff_char(7), groff_diff(7), groff_font(5).

       Roff formatter programs:
              nroff(1), troff(1), ditroff(7).

       The intermediate output language:

       Postprocessors for the output devices:
              grodvi(1),  grohtml(1),   grolbp(1),   grolj4(1),   lj4_font(5),
              grops(1), grotty(1).

       Groff macro packages and macro-specific utilities:
              groff_tmac(5),    groff_man(7),    groff_mdoc(7),   groff_me(7),
              groff_mm(7),    groff_mmse(7),    groff_mom(7),     groff_ms(7),
              groff_www(7), groff_trace(7), mmroff(7).

       The following utilities are available:
              addftinfo(1),    afmtodit(1),    eqn2graph(1),    grap2graph(1),
              groffer(1), gxditview(1), hpftodit(1),  indxbib(1),  lookbib(1),
              pfbtops(1), pic2graph(1), tfmtodit(1).

Groff Version 1.19.1            14 January 2004                       GROFF(1)

References for this manual (incoming links)