2.2 Environment

Environment variables in the host system affect the behavior of programs supplied by groff as follows. Normally, the path separator in environment variables ending with ‘PATH’ is the colon; this may vary depending on the operating system. For example, Windows uses a semicolon instead.

GROFF_BIN_PATH

Locate groff commands in these directories, followed by those in PATH. If not set, the installation directory of GNU roff executables, documented in groff(1), is searched before PATH.

GROFF_COMMAND_PREFIX

Apply a prefix to certain GNU roff commands. groff can be configured at compile time to apply a prefix to the names of programs it provides that had counterparts in AT&T troff, so that name collisions are avoided at run time. The default prefix is empty.

When used, this prefix is conventionally the letter ‘g’. For example, GNU troff would be installed as gtroff. Besides troff, the prefix applies to the formatter wrapper nroff; the preprocessors eqn, grn, pic, refer, tbl, and soelim; and the utilities indxbib and lookbib.

GROFF_ENCODING

Specify the assumed character encoding of the input. groff passes its value as an argument to the preconv preprocessor’s -e option. This variable’s existence implies the groff option -k. If set but empty, groff runs preconv without an -e option. groff’s -K option overrides GROFF_ENCODING. See preconv(7).

GROFF_FONT_PATH

Seek the selected output device’s directory of device and font description files in this list of directories. See Font Directories, gtroff(1), and groff_font(5).

GROFF_TMAC_PATH

Seek macro packages in this list of directories. See Macro Directories, gtroff(1), and groff_tmac(5).

GROFF_TMPDIR

Create temporary files in this directory. If not set, but TMPDIR is, the latter is used instead. On Windows systems, if neither of the foregoing are set, the environment variables TMP and TEMP (in that order) are checked also. Otherwise, temporary files are created in a system-dependent default directory (on Unix and GNU/Linux systems, usually /tmp). The grefer, grohtml, and grops commands use temporary files.

GROFF_TYPESETTER

Set the default output device. The -T dev option overrides it. If empty or unset, a default configured at build time, and documented in groff(1), is used.

SOURCE_DATE_EPOCH

Declare a time stamp (expressed as seconds since the Unix epoch) to use as the output creation time stamp in place of the current time. The time is converted to human-readable form using gmtime(3) and asctime(3) when the formatter starts up and stored in registers usable by documents and macro packages (see Built-in Registers).

TZ

Declare the time zone to use when converting the current time to human-readable form; see tzset(3). If SOURCE_DATE_EPOCH is used, it is always converted to human-readable form using UTC.