Hello!
I am trying to wrap an environment created with \NewEnviron
(package 'environ') into an old good \newenvironment
:
\NewEnviron{test}{\colorbox[gray]{0.7}{\BODY}}
\newenvironment{wrapper}{\begin{test}}{\end{test}}
\begin{wrapper}
debug me
\end{wrapper}
However, this gives me a strange error:
LaTeX Error: \begin{test} on input line 15 ended by \end{wrapper}. LaTeX Error: \begin{wrapper} on input line 15 ended by \end{document}.
If I replace \NewEnviron{test}{aaa(\BODY)bbb}
with \newenvironment{test}{aaa(}{)bbb}
— everything works as expected! It seems like \NewEnviron
fails to find its end for some reason.
I'm trying to do some magic with 'floatfig' wrapped into a \colorbox
so I need a way to convert \colorbox
to an environment and wrap it into another one. I can define a new command but it's not a very good idea.
Thanks in advance!