16.3 Macro Details and Caveats

By design, macro expansion should not happen in the following contexts:

Unfortunately, TeX may do some expansion in these situations, possibly yielding errors.

Also, quite a few macro-related constructs cause problems with TeX; some of the caveats are listed below. Thus, if you get macro-related errors when producing the printed version of a manual, you might try expanding the macros with texi2any by invoking texi2dvi with the ‘-E’ option (see Format with texi2dvi). Or, more reliably, eschew Texinfo macros altogether and use a language designed for macro processing, such as M4 (see External Macro Processors: Line Directives).

The following limitations are by design:

In the makeinfo implementation before Texinfo 5.0, ends of lines from expansion of a @macro definition did not end an @-command line-delimited argument (@chapter, @center, etc.). This is no longer the case. For example:

@macro twolines{}
aaa
bbb
@end macro
@center @twolines{}

In the current texi2any, this is equivalent to:

@center aaa
bbb

with just ‘aaa’ as the argument to @center. In the earlier implementation, it would have been parsed as this:

@center aaa bbb