roff systems are best known for formatting man pages. Once it is
has located a man page, a man(1) librarian program may execute a
groff command much like the following, constructing a pipeline to
page the output.
groff -t -man /usr/share/man/man1/groff.1.man | less -R
To process a roff input file using the preprocessors tbl and pic
and the me macro package in the way to which AT&T troff users
were accustomed, one would type (or script) a pipeline.
pic foo.me | tbl | troff -me -Tutf8 | grotty
Using groff, this pipe can be shortened to the equivalent command
groff -p -t -me -T utf8 foo.me
An even easier way to do this is to use grog(1) to guess the
preprocessor and macro options and execute the result by using
the command substitution feature of the shell.
$(grog -Tutf8 foo.me)
Each command-line option to a postprocessor must be specified
with any required leading dashes '-
' because groff passes the
arguments as-is to the postprocessor; this permits arbitrary
arguments to be transmitted. For example, to pass a title to the
gxditview postprocessor, the shell commands
groff -X -P -title -P 'trial run' mydoc.t
and
groff -X -Z mydoc.t | gxditview -title 'trial run' -
are equivalent.