[texhax] captions and floats

Uwe Lück uwe.lueck at web.de
Thu Jun 8 22:25:00 CEST 2006

At 17:13 06.06.06, Alex Scorpan wrote:
> > \let\@memoldcaption\caption
> > \def\caption{\donemaincaptiontrue\@memoldcaption}
>The new \caption will function just like \donemaincapture\caption did
>You need to store \caption somewhere if you want to just redefine it
>to always be preceded by \donemaincapture.

This way of modifying Standard LaTeX macros is very standard.
However, Alex' `need' is not quite true. This is the easy way,
not necessary. With "parameter-free" macros I prefer doing

     \expandafter{\thatmacro \addingcode}

e.g. (This sacrifices the original macro for the rest of the
document.) Appending to the left is slightly more difficult.
I once managed to do this even for macros with parameters
(using token registers, I think), but I don't remember how
and where I have stored this.



More information about the texhax mailing list