troff has a number of features which cause incompatibilities
with documents written with old versions of
Long names cause some incompatibilities. UNIX
as defining a string ‘ab’ with contents ‘cd’. Normally, GNU
troff interprets this as a call of a macro named
references to a string or number register called ‘[’. In GNU
troff, however, this is normally interpreted as the start of a
long name. In compatibility mode GNU
troff interprets long names
in the traditional way (which means that they are not recognized as
The read-only number register
.Cis 1 if compatibility mode is on, 0 otherwise.
Compatibility mode can be also turned on with the -C command line option.
dorequest turns off compatibility mode while executing its arguments as a
gtroffcommand. However, it does not turn off compatibility mode while processing the macro itself. To do that, use the
de1request (or manipulate the
.Cregister manually). See Writing Macros..do fam T
famrequest when compatibility mode is enabled.
gtroffrestores the previous compatibility setting before interpreting any files sourced by the cmd.
Two other features are controlled by -C. If not in
compatibility mode, GNU
troff preserves the input level in
.ds xx ' \w'abc\*(xxdef'
In compatibility mode, the string ‘72def'’ is returned; without -C the resulting string is ‘168’ (assuming a TTY output device).
Finally, the escapes
\S are transparent for recognizing the
beginning of a line only in compatibility mode (this is a rather obscure
feature). For example, the code
.de xx Hallo! .. \fB.xx\fP
prints ‘Hallo!’ in bold face if in compatibility mode, and ‘.xx’ in bold face otherwise.
troff does not allow the use of the escape sequences
\c in names of strings, macros, diversions, number
registers, fonts or environments; UNIX
troff does. The
\A escape sequence (see Identifiers) may be helpful in
avoiding use of these escape sequences in names.
Fractional point sizes cause one noteworthy incompatibility. In
ps request ignores scale
indicators and thus
sets the point size to 10 points, whereas in GNU
sets the point size to 10 scaled points. See Fractional Type Sizes, for more information.
troff there is a fundamental difference between
(unformatted) input characters and (formatted) output glyphs.
Everything that affects how a glyph is output is stored with the glyph
node; once a glyph node has been constructed it is unaffected by any
subsequent requests that are executed, including
fp requests. Normally glyphs are
constructed from input characters at the moment immediately before the
glyph is added to the current output line. Macros, diversions and
strings are all, in fact, the same type of object; they contain lists of
input characters and glyph nodes in any combination. A glyph node does
not behave like an input character for the purposes of macro processing;
it does not inherit any of the special properties that the input
character from which it was constructed might have had. For example,
.di x \\\\ .br .di .x
prints ‘\\’ in GNU
troff; each pair of input backslashes is
turned into one output backslash and the resulting output backslashes
are not interpreted as escape characters when they are reread.
troff would interpret them as escape characters
when they were reread and would end up printing one ‘\’. The
correct way to obtain a printable backslash is to use the
escape sequence: This always prints a single instance of the current
escape character, regardless of whether or not it is used in a
diversion; it also works in both GNU
troff and UNIX
troff.1 To store, for some reason, an escape sequence in a
diversion that is interpreted when the diversion is reread, either use
\! transparent output facility, or, if this is
unsuitable, the new
\? escape sequence.
See Diversions, and Gtroff Internals, for more information.
 To be completely independent of the current
escape character, use
\(rs which represents a reverse solidus