LinuxCommandLibrary

grotty

Convert troff output for terminal display

SYNOPSIS

grotty [ -bcelpvV ] [ -f font ] [ -F dir ] [ files ... ]

PARAMETERS

-b
    Suppress bold font; use underline instead for emphasis

-c
    Use only basic 7-bit character set (compatibility mode)

-e
    Suppress underlining with backspaces; use escape sequences

-l
    Produce tabular output layout (implies -v)

-p
    Enable pipe mode, like traditional nroff behavior

-v
    Use full video capabilities of terminal (overstriking)

-V
    Print version information and exit

-f font
    Specify default font for output

-F dir
    Search directory dir for font description files

DESCRIPTION

grotty is a device driver for the GNU groff text formatting system, specifically designed to translate device-independent troff output into a format suitable for display on terminal emulators or line printers. It processes the intermediate output from groff or gtroff, converting it into escape sequences and overstruck characters that render bold, italic, underline, and other typographic effects on text terminals.

This command is particularly useful for previewing formatted documents in a terminal environment, mimicking the behavior of traditional Unix nroff. It supports a variety of terminal types by using terminfo or hardcoded sequences for common terminals like xterm, vt100, and others. grotty handles pagination, fills lines, adjusts spacing, and preserves special characters, making it ideal for rendering manual pages (man pages) or other troff-formatted text directly in the console.

Unlike graphical viewers, grotty prioritizes compatibility with ASCII terminals, using backspaces for overstriking (e.g., printing a character, backspacing, and overprinting for bold). Modern usage often pairs it with groff -Tascii or -Tlatin1 for optimal results. It's lightweight and fast, essential for command-line workflows in typesetting and documentation.

CAVEATS

Output quality varies by terminal; overstriking may not work well on all emulators. Requires groff intermediate format as input. Not suitable for high-resolution rendering.

INPUT FORMAT

Expects device-independent troff output from groff -Z; pipes from groff -Tascii | grotty are common.

EXAMPLE USAGE

groff -Tascii -man foo.1 | grotty -v
Renders man page foo.1 with full terminal effects.

HISTORY

Developed by James Clark as part of GNU groff (1990s), replacing AT&T's legacy grotty from Unix System V. Evolved with groff releases for better terminal support and Unicode handling.

SEE ALSO

groff(1), gtroff(1), nroff(1), troff(1), man(1)

Copied to clipboard