Before we can go much further in
we need to learn a bit about the
In its simplest form, a macro is just a shorthand notation
quite similar to a string.
Suppose we want every paragraph to start
in exactly the same way _
with a space and a temporary indent of two ems:
Then to save typing, we would like to collapse these into
The first line names the macro
and upper case so it wouldn't conflict with
marks the end of the definition.
which is simply inserted whenever
can contain any mixture of text and formatting commands.
has to precede its first use;
undefined macros are simply ignored.
Names are restricted to one or two characters.
Using macros for commonly occurring sequences of commands
Not only does it save typing,
but it makes later changes much easier.
Suppose we decide that the paragraph indent is too small,
the vertical space is much too big,
and roman font should be forced.
Instead of changing the whole document,
we need only change the definition of
^de PP \e" paragraph macro
effect everywhere we used
command that causes the rest of the line to be ignored.
We use it here to add comments to the macro
(a wise idea once definitions get complicated).
As another example of macros,
consider these two which start and end a block of offset,
unfilled text, like most of the examples in this paper:
^de BS \e" start indented block
^de BE \e" end indented block
Now we can surround text like
and it will come out as it did above.
Notice that we indented by
This way we can nest our uses of
to get blocks within blocks.
If later on we decide that the indent
should be 0.5i, then it is only necessary to
change the definitions of