while requests, in addition to ordinary
Expressions, there are several more operators available:
True if the current page is even or odd numbered (respectively).
True if the document is being processed in nroff mode (i.e., the
.nroff command has been issued). See Troff and Nroff Mode.
True if the document is being processed in troff mode (i.e., the
.troff command has been issued). See Troff and Nroff Mode.
Always false. This condition is for compatibility with other
troff versions only (identifying a
True if the output produced by xxx is equal to the output produced
by yyy. Other characters can be used in place of the single
quotes; the same set of delimiters as for the
\D escape is used
gtroff formats xxx and yyy in
separate environments; after the comparison the resulting data is
.ie "|"\fR|\fP" \ true .el \ false ⇒ true
The resulting motions, glyph sizes, and fonts have to match,22 and not the individual motion, size, and font requests. In the previous example, ‘|’ and ‘\fR|\fP’ both result in a roman ‘|’ glyph with the same point size and at the same location on the page, so the strings are equal. If ‘.ft I’ had been added before the ‘.ie’, the result would be “false” because (the first) ‘|’ produces an italic ‘|’ rather than a roman one.
To compare strings without processing, surround the data with
.ie "\?|\?"\?\fR|\fP\?" \ true .el \ false ⇒ false
Since data protected with
\? is read in copy-in mode it is even
possible to use incomplete input without causing an error.
.ds a \[ .ds b \[ .ie '\?\*a\?'\?\*b\?' \ true .el \ false ⇒ true
True if there is a number register named xxx.
True if there is a string, macro, diversion, or request named xxx.
True if there is a color named xxx.
True if there is a glyph g available23; g is either an ASCII character or a special
\[ggg]); the condition is also true if g has been
defined by the
True if a font named font exists. font is handled as if it
was opened with the
ft request (this is, font translation and
styles are applied), without actually mounting it.
This test doesn’t load the complete font but only its header to verify its validity.
True if style style has been registered. Font translation is applied.
Note that these operators can’t be combined with other operators like ‘:’ or ‘&’; only a leading ‘!’ (without whitespace between the exclamation mark and the operator) can be used to negate the result.
.nr xxx 1 .ie !r xxx \ true .el \ false ⇒ false
A whitespace after ‘!’ always evaluates to zero (this bizarre
behaviour is due to compatibility with UNIX
.nr xxx 1 .ie ! r xxx \ true .el \ false ⇒ r xxx true
It is possible to omit the whitespace before the argument to the ‘r’, ‘d’, and ‘c’ operators.