I've checked the post here, where the package empheq is used for embedding equations into coloured boxes.
With that idea, I wrote in my file the following:
% in the preambule
\usepackage{empheq}
\newcommand*\mybox[1]{%
\colorbox{burlywood1}{\hspace{1em}#1\hspace{1em}}}
% in the body
\begin{empheq}[box=\mybox]{align}
...equation here...
\end{empheq}
It works nicely. However, I'd like to create a new environment for such a box… I tried something like,
\newenvironment{colbox}{%
\begin{empheq}[box=\mybox]{align}}{\end{empheq}}
but this doesn't work.
**Questions**
- Can someone help me to define this environment?
- Is it possible to define an environment which the colour is an argument? So I can use different colours.
Thank you all.
Best Answer
Please always make full documents when asking questions, it makes things a lot easier.
It seems that like a lot of environments that grab the environment body you need to use this form when wrapping in environment definitions (AMS display environments have the same feature):