I would like to copy the content of an environment so that I can use it somewhere else. My main purpose is to print it inside a tooltip note.
My idea was to use the environ package:
\NewEnviron{foo}
{
\xdef\bidule{\BODY}
%more stuff
}
But when I use \bidule I get an error:
Undefined control sequence ....
leading text: \end{foo}
Undefined control sequence \endgroup.
leading text: \end{foo}
Missing { inserted.
leading text: \bidule
main.tex:19: File ended while scanning text of \errhelp.
If my understanding is correct, I cannot use \def because \BODY won't be defined when I will use \foo. Is there a way to achieve my goal?
scontentspackage, for one) – user202729 Nov 26 '22 at 00:16