Linux "troff" Command Line Options and Examples
the troff processor of the groff text formatting system

This manual page describes the GNU version of troff. It is part of the groff document formatting system. It is functionally compatible with UNIX troff, but has many extensions, see groff_diff(7).


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 ...]

Command Line Options:

Generate an ASCII approximation of the typeset output.
troff -a ...
Disable color output (always disabled in compatibility mode).
troff -c ...
Enable compatibility mode.
troff -C ...
Define c or name to be a string s; c must be a one letter name.
troff -dname ...
Use fam as the default font family.
troff -ffam ...
Read the standard input after all the named input files have been processed.
troff -i ...
Number the first page num.
troff -nnum ...
Don't load troffrc and troffrc-end.
troff -R ...
Print the version number.
troff -v ...
Inhibit warning name. Multiple -W options are allowed.
troff -Wname ...
WARNINGSThe warnings that can be given by troff are divided into the following categories. The name associated witheach warning is used by the -w and -W options; the number is used by the warn request, and by the .warn regis‐ter; 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 linelength. 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, theescape 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 conditions that are errorswhen 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 ordiversion is used, that string is automatically defined as empty. So, in most cases, atmost 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 regis‐ter is automatically defined to have a value of 0. So, in most cases, at most one warningwill be given for use of a particular name.right-brace 4096 Use of \} where a number was expected.scale 32 Meaningless scaling 65536 Missing space between a request or macro and its argument. This warning will be givenwhen an undefined name longer than two characters is encountered, and the first two char‐acters of the name make a defined name. The request or macro will not be invoked. Whenthis warning is given, no macro is automatically defined. This is enabled by default.This warning will never occur in compatibility mode.syntax 128 Dubious syntax in numeric 2048 Inappropriate use of a tab character. Either use of a tab character where a number wasexpected, 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 usefulwith traditional macro packages.w All warnings.ENVIRONMENTGROFF_TMAC_PATHA colon separated list of directories in which to search for macro files. troff will scan directoriesgiven 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.3/tmac)after these.GROFF_TYPESETTERDefault device.GROFF_FONT_PATHA colon separated list of directories in which to search for the devname directory. troff will scandirectories given in the -F option before these, and in standard directories (/usr/share/groff/site-font, /usr/share/groff/1.22.3/font, /usr/lib/font) after these.FILES/usr/share/groff/1.22.3/tmac/troffrcInitialization file (called before any other macro package)./usr/share/groff/1.22.3/tmac/troffrc-endInitialization file (called after any other macro package)./usr/share/groff/1.22.3/tmac/name.tmac/usr/share/groff/1.22.3/tmac/tmac.nameMacro files/usr/share/groff/1.22.3/font/devname/DESCDevice description file for device name./usr/share/groff/1.22.3/font/devname/FFont file for font F of device name.Note that troffrc and troffrc-end are neither searched in the current nor in the home directory by default forsecurity reasons (even if the -U option is given). Use the -M command line option or the GROFF_TMAC_PATHenvironment variable to add these directories to the search path if necessary.
troff -z ...