2017-09-08 17:06:21 +01:00
|
|
|
# groff
|
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
> GNU replacement for the `troff` and `nroff` typesetting utilities.
|
2019-06-07 11:58:27 +01:00
|
|
|
> More information: <https://www.gnu.org/software/groff>.
|
2017-09-08 17:06:21 +01:00
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
- Format output for a PostScript printer, saving the output to a file:
|
2017-09-08 17:06:21 +01:00
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
`groff {{path/to/input.roff}} > {{path/to/output.ps}}`
|
2017-09-08 17:06:21 +01:00
|
|
|
|
|
|
|
- Render a man page using the ASCII output device, and display it using a pager:
|
|
|
|
|
2021-12-10 10:06:31 +00:00
|
|
|
`groff -man -T ascii {{path/to/manpage.1}} | less --RAW-CONTROL-CHARS`
|
2017-09-08 17:06:21 +01:00
|
|
|
|
|
|
|
- Render a man page into an HTML file:
|
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
`groff -man -T html {{path/to/manpage.1}} > {{path/to/manpage.html}}`
|
2017-09-08 17:06:21 +01:00
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
- Typeset a roff file containing [t]ables and [p]ictures, using the [me] macro set, to PDF, saving the output:
|
2017-09-08 17:06:21 +01:00
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
`groff {{-t}} {{-p}} -{{me}} -T {{pdf}} {{path/to/input.me}} > {{path/to/output.pdf}}`
|
2017-09-08 17:06:21 +01:00
|
|
|
|
|
|
|
- Run a `groff` command with preprocessor and macro options guessed by the `grog` utility:
|
|
|
|
|
2021-10-21 08:17:15 +01:00
|
|
|
`eval "$(grog -T utf8 {{path/to/input.me}})"`
|