Home

roff

Roff is a family of text-formatting languages and processing systems used on Unix and Unix-like systems to format documents for printing or on-screen display. The name is traditionally traced to Runoff, one of the earliest programs for formatting text for line printers; roff was developed in the 1970s at Bell Labs and evolved into the troff/nroff/groff family. The core idea is that a plain text input contains formatting requests and macros, which are interpreted by a roff processor to produce paginated output.

In practice, roff consists of a pipeline: the input is processed by macro packages that provide higher-level

A suite of preprocessors and macro packages extends roff’s capabilities, including eqn for mathematics, tbl for

Overall, roff represents a foundational, text-based approach to high-quality document formatting that persists primarily in Unix

formatting
constructs,
and
then
fed
to
a
roff
processor
such
as
troff
(for
high-quality
typeset
output)
or
nroff
(for
terminal
or
simple
device
output).
Troff
and
nroff
are
the
main
successors
of
the
original
roff,
with
troff
typically
producing
PostScript
or
other
printer
formats,
and
nroff
targeting
terminal
displays.
These
tools
are
foundational
to
many
document
workflows
on
Unix
systems
and
are
the
historical
basis
for
the
later
groff
implementation.
tables,
and
pic
for
diagrams.
Groff,
the
GNU
reimplementation,
supports
numerous
macro
packages
(such
as
man,
ms,
and
mm)
and
can
emit
a
variety
of
output
formats,
including
PostScript,
PDF,
and
plain
text.
The
roff
family
remains
in
use
for
formatting
manuals,
man
pages,
and
older
documentation,
even
as
more
modern
tools
have
become
prevalent
in
general
publishing
tasks.
documentation
and
legacy
systems.