I'm using etoolbox to patch some environments. I want to use \AtBeginEnvironment{table}{\marginpar{foo}} to put something in the margin by the float. But the marginpar is typeset where the environment is written, not where the float is output, if you see what I mean. How can I get something to float with the table?
|
|
||||
|
|
|
Based on Martin Scharrer's redefinition of the
|
|||||||
|
|
You can't. Both tables and marginpars are insertions and it's forbidden to have an insertion inside an insertion. If you try to put a
Martin's redefinition doesn't work either:
It wouldn't work anyway. |
|||||||||||
|
|
The AtBeginEnvironment code is executed just before the internal macro of the environment (
The important part here is Note that
So I would write:
and insert the code manually. Of course you need to be careful if you load any packages which change the definition of |
|||
|
|