This section lists several common uses of groff and the
corresponding command lines.
groff file
This command processes file without a macro package or a
preprocessor. The output device is the default, ‘ps’, and the
output is sent to stdout.
groff -t -mandoc -Tascii file | less
This is basically what a call to the man program does.
gtroff processes the manual page file with the
mandoc macro file (which in turn either calls the man or
the mdoc macro package), using the tbl preprocessor and
the ASCII output device. Finally, the less pager
displays the result.
groff -X -m me file
Preview file with gxditview, using the me macro
package. Since no -T option is specified, use the default
device (‘ps’). Note that you can either say ‘-m me’ or
‘-me’; the latter is an anachronism from the early days of
UNIX.1
groff -man -rD1 -z file
Check file with the man macro package, forcing double-sided printing – don't produce any output.
[1] The same is true for the other main macro
packages that come with groff: man, mdoc,
ms, mm, and mandoc. This won't work in general;
for example, to load trace.tmac, either ‘-mtrace’ or
‘-m trace’ must be used.