In <[log in to unmask]> Reinhard Kotucha <[log in to unmask]> writes:
>If there would be something like \AtEndPage, the \afterpage package
>would be much smaller, its code easier to understand and much easier
>to maintain.

look at macros/latex/contrib/supported/ms/everyshi.* for a hook just before
\shipout. Should be easy to extend.

Best regards

                 Martin Schr"oder, [log in to unmask]
The mass of men lead lives of quiet desperation and go to the grave
with the song still in them.                     (Henry David Thoreau)