Environment (The GNU Troff Manual)

### 2.2 Environment

There are also several environment variables (of the operating system, not within `gtroff`) that can modify the behavior of `groff`.

`GROFF_BIN_PATH` ¶

  This search path, followed by `PATH`, is used for commands executed by `groff`.

`GROFF_COMMAND_PREFIX` ¶

  If this is set to X, then `groff` runs `Xtroff` instead of `gtroff`. This also applies to `tbl`, `pic`, `eqn`, `grn`, `chem`, `refer`, and `soelim`. It does not apply to `grops`, `grodvi`, `grotty`, `pre-grohtml`, `post-grohtml`, `preconv`, `grolj4`, `gropdf`, and `gxditview`.

  The default command prefix is determined during the installation process. If a non-GNU `troff` system is found, prefix ‘`g`’ is used, none otherwise.

`GROFF_ENCODING` ¶

  The value of this variable is passed to the `preconv` preprocessor’s `-e` option to select the character encoding of input files. This variable’s existence implies the `groff` option `-k`. If set but empty, `groff` calls `preconv` without an `-e` option. `groff`’s `-K` option overrides `GROFF_ENCODING`. See the preconv(7) man page; type ‘`man preconv`’ at the command line to view it.

`GROFF_FONT_PATH` ¶

  A list of directories in which to seek the selected output device’s directory of device and font description files. GNU `troff` will search directories given as arguments to any specified `-F` options before these, and a built-in list of directories after them. See Font Directories and the troff(1) or gtroff(1) man pages.

`GROFF_TMAC_PATH` ¶

  A list of directories in which to seek macro files. GNU `troff` will search directories given as arguments to any specified `-M` options before these, and a built-in list of directories after them. See Macro Directories and the troff(1) or gtroff(1) man pages.

`GROFF_TMPDIR` ¶

  The directory in which `groff` creates temporary files. If this is not set and `TMPDIR` is set, temporary files are created in that directory. Otherwise temporary files are created in a system-dependent default directory (on Unix and GNU/Linux systems, this is usually `/tmp`). `grops`, `grefer`, `pre-grohtml`, and `post-grohtml` can create temporary files in this directory.

`GROFF_TYPESETTER` ¶

  Sets the default output device. If empty or not set, a build-time default (often `ps`) is used. The `-Tdev` option overrides `GROFF_TYPESETTER`.

`SOURCE_DATE_EPOCH` ¶

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

`TZ` ¶

  The time zone to use when converting the current time (or value of `SOURCE_DATE_EPOCH`) to human-readable form; see tzset(3).

MS-DOS and MS-Windows ports of `groff` use semicolons, rather than colons, to separate the directories in the lists described above.