Some of the examples in this manuals are buggy. Correctly working macros are presented here.
cleardivert macro (see section Discarding diverted text) cannot, as it stands, be
called without arguments to clear all pending diversions. A macro that
achieves that as well is:
define(`cleardivert', `pushdef(`_num', divnum)divert(-1)ifelse($#, 0, `undivert`'', `undivert($@)')divert(_num)popdef(`_num')')
If called without arguments, it will call undivert without argument, otherwise they will be passed to undivert().
Go to the first, previous, next, last section, table of contents.