groff: Escapes
5.5.3 Escapes
-------------
Escapes may occur anywhere in the input to 'gtroff'. They usually begin
with a backslash and are followed by a single character, which indicates
the function to be performed. The escape character can be changed; see
Character Translations.
Escape sequences that require an identifier as a parameter accept
three possible syntax forms.
* The next single character is the identifier.
* If this single character is an opening parenthesis, take the
following two characters as the identifier. Note that there is no
closing parenthesis after the identifier.
* If this single character is an opening bracket, take all characters
until a closing bracket as the identifier.
Examples:
\fB
\n(XX
\*[TeX]
Other escapes may require several arguments and/or some special
format. In such cases the argument is traditionally enclosed in single
quotes (and quotes are always used in this manual for the definitions of
escape sequences). The enclosed text is then processed according to
what that escape expects. Example:
\l'1.5i\(bu'
Note that the quote character can be replaced with any other
character that does not occur in the argument (even a newline or a space
character) in the following escapes: '\o', '\b', and '\X'. This makes
e.g.
A caf
\o
e\'
in Paris
=> A café in Paris
possible, but it is better not to use this feature to avoid confusion.
The following escapes sequences (which are handled similarly to
characters since they don't take a parameter) are also allowed as
delimiters: '\%', '\ ', '\|', '\^', '\{', '\}', '\'', '\`', '\-', '\_',
'\!', '\?', '\)', '\/', '\,', '\&', '\:', '\~', '\0', '\a', '\c', '\d',
'\e', '\E', '\p', '\r', '\t', and '\u'. Again, don't use these if
possible.
No newline characters as delimiters are allowed in the following
escapes: '\A', '\B', '\Z', '\C', and '\w'.
Finally, the escapes '\D', '\h', '\H', '\l', '\L', '\N', '\R', '\s',
'\S', '\v', and '\x' can't use the following characters as delimiters:
* The digits '0'-'9'.
* The (single-character) operators '+-/*%<>=&:().'.
* The space, tab, and newline characters.
* All escape sequences except '\%', '\:', '\{', '\}', '\'', '\`',
'\-', '\_', '\!', '\/', '\c', '\e', and '\p'.
To have a backslash (actually, the current escape character) appear
in the output several escapes are defined: '\\', '\e' or '\E'. These
are very similar, and only differ with respect to being used in macros
or diversions. Character Translations, for an exact description
of those escapes.
DONTPRINTYET Implementation Differences, Copy-in Mode, and *noteDONTPRINTYET Implementation Differences, Copy-in Mode, and
Diversions, Identifiers, for more information.
Menu