groff (GNU troff)

The GNU project wrote the groff utility as a reimplementation of ditroff, which encompassed the functionality of the historical nroff and troff utilities. The first version was released in 1990, and it is still actively maintained. groff is significant in that it is the predominant implementation of nroff and troff on contemporary UNIX operating systems.

On systems with groff installed, both troff and nroff invoke the underlying groff utility. It is able to produce the classical terminal and PS output, along with more recent support for XHTML, HTML, and PDF. It has strong support for non-ASCII output on supporting media. Consult your local groff manual all possible outputs via the T flag.

The mdoc implementation in groff was entirely re-written in version 1.17. Prior to this, input documents had some severe restrictions. Most notably, macro lines were limited to 9 arguments, Bl column macros had a restricted syntax, and displays such as Bd could not be nested.

The groff utility is supported on both UNIX and non-UNIX operating systems.

Examples

Paging a manual to a UNIX terminal:

groff -Tascii -mandoc file.1 | less

To strip the escape-character encoding of output to create clean, printable ASCII output:

groff -Tascii -mandoc file.1 | col -b >file.1.txt

Generating PS output:

groff -Tps -mandoc file.1 >file.1.ps

Last edited by $Author: kristaps $ on $Date: 2012/01/01 15:13:33 $. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.