LinuxCommandLibrary

groff

TLDR

Format document to PDF

$ groff -Tpdf [file.ms] > output.pdf
copy
Format with man macros
$ groff -man [file.1] > output.ps
copy
Format with ms macros
$ groff -ms [file.ms] > output.ps
copy
Preview in terminal
$ groff -Tutf8 [file.roff] | less
copy
Process with preprocessors
$ groff -t -e -p [file.roff] > output.ps
copy

SYNOPSIS

groff [options] [files]

DESCRIPTION

groff is the GNU implementation of the roff document formatting system. It processes text files with embedded formatting commands to produce typeset output in various formats.
The system supports multiple output devices including PDF, PostScript, and terminal display. It includes preprocessors for tables (tbl), equations (eqn), and diagrams (pic).
groff provides powerful text formatting for documents.

PARAMETERS

FILES

Input files to process.
-T DEVICE
Output device (pdf, ps, html, utf8).
-m MACRO
Use macro package (man, ms, me, mm).
-t
Run tbl preprocessor.
-e
Run eqn preprocessor.
-p
Run pic preprocessor.
-s
Run soelim preprocessor.
-man
Use man macros.
-ms
Use ms macros.
--help
Display help information.

CAVEATS

Steep learning curve. Macro packages have different conventions. PostScript output requires viewer.

HISTORY

groff was created by James Clark as a free implementation of AT&T troff. It's now maintained as part of the GNU project.

SEE ALSO

troff(1), nroff(1), man(1), tbl(1), eqn(1)

Copied to clipboard