Next: , Previous: , Up: Formatter Instructions   [Contents][Index]


5.6.2 Invoking Requests

A control character is optionally followed by tabs and/or spaces and then an identifier naming a request or macro. The invocation of an unrecognized request is interpreted as a macro call. Defining a macro with the same name as a request replaces the request. Deleting a request name with the rm request makes it unavailable. The als request can alias requests, permitting them to be wrapped or non-destructively replaced.76

There is no inherent limit on argument length or quantity. Most requests take one or more arguments, and ignore any they do not expect. A request that is not supplied a mandatory argument does nothing.77 Spaces or tabs separate a request’s name from its first argument, but only spaces can separate an argument from its successor.78 Only one space between arguments is necessary; the formatter ignores any excess. GNU troff does not interpret tabs as argument separators.79

Generally, a space within a request argument is not relevant, not meaningful, or is supported by bespoke provisions, as with the tl request’s delimiters.80 Some requests, like ds, interpret the remainder of the control line as a single argument.81

Commonly, authors use spaces and/or tabs after a control character to indent the source of documents or macro files. The formatter ignores spaces and tabs immediately after a control character, except that the presence of a tab prevents recognition of the end of a macro definition.

.de center
.  if \\n[.br] \
.    br
.  ce \\$1
..
.
.
.de right-align
.→if \\n[.br] \
.→→br
.→rj \\$1
..

If you assign an empty blank line trap, you can separate macro definitions (or any input lines) with blank lines.82

.de do-nothing
..
.blm do-nothing  \" activate blank line trap

.de center
.  if \\n[.br] \
.    br
.  ce \\$1
..


.de right-align
.→if \\n[.br] \
.→→br
.→rj \\$1
..

.blm             \" deactivate blank line trap

Next: , Previous: , Up: Formatter Instructions   [Contents][Index]