# troff(1) - man - phpMan

[TROFF(1)](https://www.chedong.com/phpMan.php/man/TROFF/1/markdown)                               General Commands Manual                              [TROFF(1)](https://www.chedong.com/phpMan.php/man/TROFF/1/markdown)



## NAME
       troff - the troff processor of the groff text formatting system

## SYNOPSIS
       **troff** [**-abcivzCERU**] [**-d** _cs_] [**-f** _fam_] [**-F** _dir_] [**-I** _dir_] [**-m** _name_] [**-M** _dir_] [**-n** _num_] [**-o** _list_]
             [**-r** _cn_] [**-T** _name_] [**-w** _name_] [**-W** _name_] [_file_ ...]

## DESCRIPTION
       This manual page describes the GNU version of **troff**.  It is part of the groff  document  for‐
       matting  system.  It is functionally compatible with Unix troff, but has many extensions, see
       **groff**___**[diff**(7)](https://www.chedong.com/phpMan.php/man/diff/7/markdown).  Usually it should be invoked using the [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown) command which will  also  run
       preprocessors and postprocessors in the appropriate order and with the appropriate options.

## OPTIONS
       Whitespace is permitted between a command-line option and its argument.

### -a

### -b
              track down the cause of the error.  The line numbers given in the  backtrace  may  not
              always  be  correct,  for  **troff**'s  idea of line numbers gets confused by **as** or **am** re‐
              quests.

### -c

### -C

### -d
### -d
              Define _c_ or _name_ to be a string _s_; _c_ must be a one letter name.

### -E
              standard error by macro packages using the **tm** or **tm1** requests.

### -f

### -F
              name of the device) and there for the _DESC_ file and font files.  _dir_ is scanned before
              all other font directories.

### -i

### -I
              the command line and those named in **.psbb** requests).  The search path  is  initialized
              with the current directory.  This option may be specified more than once; the directo‐
              ries are then searched in the order specified (but before the current directory).   If
              you  want  to  make the current directory be read before other directories, add **-I.** at
              the appropriate place.

              No directory search is performed for files with an absolute file name.

### -m
              first  searched  for in directories given with the **-M** command-line option, then in di‐
              rectories given in the _GROFF_TMAC_PATH_ environment variable, then in the  current  di‐
              rectory  (only if in unsafe mode), the home directory, _/usr/lib/groff/site-tmac_, _/usr/_
              _share/groff/site-tmac_, and _/usr/share/groff/1.22.4/tmac_.

### -M
              other macro directories.

### -n

### -o
              print page _n_, _m_**-**_n_ means print every page between _m_ and _n_, **-**_n_ means print every page up
              to  _n_, _n_**-** means print every page from _n_.  **troff** will exit after printing the last page
              in the list.

### -r
### -r
              Set number register _c_ or _name_ to _n_; _c_ must be a one character name; _n_ can be any troff
              numeric expression.

### -R

### -T
              detailed description.

### -U
              For security reasons, these potentially dangerous requests are disabled otherwise.  It
              will also add the current directory to the macro search path.

### -v

### -w
              To enable most useful warnings use **-w** **all**.  To enable absolutely all warnings use **-w** **w**
              instead.  Multiple **-w** options are allowed.

### -W -W

### -z

## WARNINGS
       The warnings that can be given by **troff** are divided into the following categories.  The  name
       associated with each warning is used by the **-w** and **-W** options; the number is used by the **warn**
       request, and by the **.warn** register; it is always a power of 2 to allow bitwise composition.

                           ┌─────────────────────┬─────────────────────────────┐
                           │Bit   Code   Warning │ Bit    Code       Warning   │
                           ├─────────────────────┼─────────────────────────────┤
                           │  0      _1_   **char**    │  10      _1024_   **reg**         │
                           │  1      _2_   **number**  │  11      _2048_   **tab**         │
                           │  2      _4_   **break**   │  12      _4096_   **right-brace** │
                           │  3      _8_   **delim**   │  13      _8192_   **missing**     │
                           │  4     _16_   **el**      │  14     _16384_   **input**       │
                           │  5     _32_   **scale**   │  15     _32768_   **escape**      │
                           │  6     _64_   **range**   │  16     _65536_   **space**       │
                           │  7    _128_   **syntax**  │  17    _131072_   **font**        │
                           │  8    _256_   **di**      │  18    _262144_   **ig**          │
                           │  9    _512_   **mac**     │  19    _524288_   **color**       │
                           │                     │  20   _1048576_   **file**        │
                           └─────────────────────┴─────────────────────────────┘
       **break**           4   In fill mode, lines which could not be broken so that  their  length  was
                           less than the line length.  This is enabled by default.

       **char**            1   Non-existent characters.  This is enabled by default.

       **color**      524288   Color-related warnings.

       **delim**           8   Missing or mismatched closing delimiters.

       **di**            256   Use of **di** or **da** without an argument when there is no current diversion.

       **el**             16   Use of the **el** request with no matching **ie** request.

       **escape**      32768   Unrecognized  escape  sequences.  When an unrecognized escape sequence is
                           encountered, the escape character is ignored.

       **file**      1048576   Indicates a missing file for the **mso** request.  Enabled by default.

       **font**       131072   Non-existent fonts.  This is enabled by default.

       **ig**         262144   Invalid escapes in text ignored with the **ig** request.   These  are  condi‐
                           tions that are errors when they do not occur in ignored text.

       **input**       16384   Invalid input characters.

       **mac**           512   Use  of  undefined  strings,  macros  and  diversions.  When an undefined
                           string, macro or diversion is used, that string is automatically  defined
                           as  empty.  So, in most cases, at most one warning will be given for each
                           name.

       **missing**      8192   Requests that are missing non-optional arguments.

       **number**          2   Invalid numeric expressions.  This is enabled by default.

       **range**          64   Out of range arguments.

       **reg**          1024   Use of undefined number registers.  When an undefined number register  is
                           used,  that  register is automatically defined to have a value of 0.  So,
                           in most cases, at most one warning will be given for use of a  particular
                           name.

       **right-brace**  4096   Use of **\}** where a number was expected.

       **scale**          32   Meaningless scaling indicators.

       **space**       65536   Missing  space between a request or macro and its argument.  This warning
                           will be given when an undefined name longer than two  characters  is  en‐
                           countered,  and the first two characters of the name make a defined name.
                           The request or macro will not be invoked.  When this warning is given, no
                           macro  is automatically defined.  This is enabled by default.  This warn‐
                           ing will never occur in compatibility mode.

       **syntax**        128   Dubious syntax in numeric expressions.

       **tab**          2048   Inappropriate use of a tab character.  Either  use  of  a  tab  character
                           where a number was expected, or use of tab character in an unquoted macro
                           argument.

       There are also names that can be used to refer to groups of warnings:

       **all**    All warnings except **di**, **mac**, and **reg**.  It is intended that this  covers  all  warnings
              that are useful with traditional macro packages.

       **w**      All warnings.

## ENVIRONMENT
       _GROFF_TMAC_PATH_
              A  colon separated list of directories in which to search for macro files.  **troff** will
              scan directories given in the **-M** option before  these,  and  in  standard  directories
              (current  directory if in unsafe mode, home directory, _/usr/lib/groff/site-tmac_, _/usr/_
              _share/groff/site-tmac_, _/usr/share/groff/1.22.4/tmac_) after these.

       _GROFF_TYPESETTER_
              Default device.

       _GROFF_FONT_PATH_
              A colon separated list of directories in which to search for  the  _dev_name  directory.
              **troff**  will  scan directories given in the **-F** option before these, and in standard di‐
              rectories  (_/usr/share/groff/site-font_,  _/usr/share/groff/1.22.4/font_,  _/usr/lib/font_)
              after these.

## FILES
       _/usr/share/groff/1.22.4/tmac/troffrc_
              Initialization file (called before any other macro package).

       _/usr/share/groff/1.22.4/tmac/troffrc-end_
              Initialization file (called after any other macro package).

       _/usr/share/groff/1.22.4/tmac/_name_.tmac_
       _/usr/share/groff/1.22.4/tmac/tmac._name
              Macro files

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

       _/usr/share/groff/1.22.4/font/dev_name_/_F
              Font file for font _F_ of device _name_.

       Note that _troffrc_ and _troffrc-end_ are searched for neither in the current nor the home direc‐
       tory by default for security reasons (even if the **-U** option is given).  Use the  **-M**  command-
       line  option  or  the  _GROFF_TMAC_PATH_  environment  variable to add these directories to the
       search path if necessary.

## AUTHORS
       The GNU version of _troff_ was originally written by James Clark; he also  wrote  the  original
       version  of this document, which was modified by Werner Lemberg ⟨<wl@gnu.org>⟩ and Bernd Warken
       ⟨<groff-bernd.warken-72@web.de>⟩.

## SEE ALSO
       [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown)
              The main program of the _groff_ system, a wrapper around _troff_.

       [**groff**(7)](https://www.chedong.com/phpMan.php/man/groff/7/markdown)
              A description of the _groff_ language, including a short but complete reference  of  all
              predefined  requests,  registers,  and escapes of plain _groff_.  From the command line,
              this is called by

                     **man** **7** **groff**

       **groff**___**[diff**(7)](https://www.chedong.com/phpMan.php/man/diff/7/markdown)
              The differences of the _groff_ language and the _classical_  _troff_  language.   Currently,
              this is the most actual document of the _groff_ system.

       [**roff**(7)](https://www.chedong.com/phpMan.php/man/roff/7/markdown)
              An  overview  over _groff_ and other _roff_ systems, including pointers to further related
              documentation.

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



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