Go to the first, previous, next, last section, table of contents.


DEFINE

Use this macro to define or redefine user macros. These can then be used in text bodies where they will be fully expanded. A macro definition can itself include user macros in the same way as text bodies (these will only be expanded from within the text body). However, predefined macros cannot be used in user macro definitions, nor can they be defined or redefined. This macro takes a macro argument which can either be just the name of the user macro being defined, or can be the name followed by the replacement text for that macro. To include a user macro in a text body or a macro definition it should be preceeded by a double percent character sequence. The example program fragment below defines three user macros, and also shows how they are used within a macro definition and a text body.

%%DEFINE TITLE This is the Title
%%DEFINE BOLD \bf
%%DEFINE BOLDTITLE {%%BOLD %%TITLE}
%%HEADER
\centerline{%%BOLDTITLE as at {%%BOLD \today}}

Note that a user macro definition can also include field names and equate macros. However, if using equate macros the name of the equate macro must be preceeded by a hash character rather than a double percent character sequence as done normally. The equate macro name need not have been defined before it is used in a user macro definition (since processing of equates occurs at a later stage.

There is no error when redefining a user macro. The new replacement text is just substituted for the old. There is a maximum number of allowable macros, and a maximum length for the macro replacement text, see section Hard Limits on hard limits.

Note that the GPPDEFINE and TEXDEFINE predefined macros which the above replaces are deprecated and should not be used.


Go to the first, previous, next, last section, table of contents.