Next: Line Layout, Previous: Character Translations, Up: GNU troff Reference [Contents][Index]
troff and nroff ModesHistorically,
nroff
and
troff
were two separate programs;
the former for terminal output,
the latter for typesetters.
GNU
troff merges both functions into one executable104
that sends its output to a device driver
(grotty
for terminal devices,
grops
for PostScript,
and so on)
that interprets its output.
When discussing AT&T
troff,
it makes sense to talk about
nroff mode
and
troff mode
since the differences are hard-coded.
GNU
troff
takes information from device and font description files
without handling requests specially if a terminal output device is used,
so such a strong distinction is unnecessary.
Usually, a macro package can be used with all output devices.
Nevertheless, it is sometimes necessary to make a distinction between
terminal and non-terminal devices: GNU troff provides two
built-in conditions ‘n’ and ‘t’ for the if, ie,
and while requests to decide whether GNU troff shall
behave like nroff or like
troff.105
Make the ‘t’ built-in condition true (and the ‘n’ built-in
condition false) for if, ie, and while conditional
requests. This is the default if GNU troff (not
groff) is started with the -R switch to avoid loading of
the startup files troffrc and troffrc-end. Without
-R, GNU troff stays in troff mode if the output
device is not a terminal (e.g., ‘ps’).
Make the ‘n’ built-in condition true (and the ‘t’ built-in
condition false) for if, ie, and while conditional
requests. This is the default if GNU troff uses a terminal
output device; the code for switching to nroff mode is in the
file tty.tmac, which is loaded by the startup file
troffrc.
Next: Line Layout, Previous: Character Translations, Up: GNU troff Reference [Contents][Index]