HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

troff — Typesetting processor for the groff (GNU Troff) document formatting system. See also: `groff`. More

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thegroffcommandprocessortrofftypesettingclifor

Problem

How to use the troff command: Typesetting processor for the groff (GNU Troff) document formatting system. See also: groff. More information: <https://manned.org/troff>.

Solution

troff — Typesetting processor for the groff (GNU Troff) document formatting system. See also: groff. More information: <https://manned.org/troff>.

Format output for a PostScript printer, saving the output to a file:
troff {{path/to/input.roff}} | grops > {{path/to/output.ps}}


Format output for a PostScript printer using the me macro package, saving the output to a file:
troff -{{me}} {{path/to/input.roff}} | grops > {{path/to/output.ps}}


Format output as ASCII text using the man macro package:
troff -T {{ascii}} -{{man}} {{path/to/input.roff}} | grotty


Format output as a pdf file, saving the output to a file:
troff -T {{pdf}} {{path/to/input.roff}} | gropdf > {{path/to/output.pdf}}

Code Snippets

Format output for a PostScript printer, saving the output to a file

troff {{path/to/input.roff}} | grops > {{path/to/output.ps}}

Format output for a PostScript printer using the me macro package, saving the output to a file

troff -{{me}} {{path/to/input.roff}} | grops > {{path/to/output.ps}}

Format output as ASCII text using the man macro package

troff -T {{ascii}} -{{man}} {{path/to/input.roff}} | grotty

Format output as a pdf file, saving the output to a file

troff -T {{pdf}} {{path/to/input.roff}} | gropdf > {{path/to/output.pdf}}

Context

tldr-pages: common/troff

Revisions (0)

No revisions yet.