Next: , Previous: , Up: Embedded Commands   [Contents][Index]


5.5.1 Requests

A request line begins with a control character, which is either a single quote (‘'’, the no-break control character) or a period (‘.’, the normal control character). These can be changed; see Character Translations, for details. After this there may be optional tabs or spaces followed by an identifier, which is the name of the request. This may be followed by any number of space-separated arguments (no tabs here).

Since a control character followed by whitespace only is ignored, it is common practice to use this feature for structuring the source code of documents or macro packages.

.de foo
.  tm This is foo.
..
.
.
.de bar
.  tm This is bar.
..

Another possibility is to use the blank line macro request blm by assigning an empty macro to it.

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

.de foo
.  tm This is foo.
..


.de bar
.  tm This is bar.
..

.blm             \" deactivate blank line macro

See Blank Line Traps.

To begin a line with a control character without it being interpreted, precede it with \&. This represents a zero width space, which means it does not affect the output.

In most cases the period is used as a control character. Several requests cause a break implicitly; using the single quote control character prevents this.

Register: \n[.br]

A read-only number register, which is set to 1 if a macro is called with the normal control character (as defined with the cc request), and set to 0 otherwise.

This allows to reliably modify requests.

.als bp*orig bp
.de bp
.  tm before bp
.  ie \\n[.br] .bp*orig
.  el 'bp*orig
.  tm after bp
..

Using this register outside of a macro makes no sense (it always returns zero in such cases).

If a macro is called as a string (this is, using \*), the value of the .br register is inherited from the calling macro.


Next: , Previous: , Up: Embedded Commands   [Contents][Index]