This is not working because every cell in
align
is a group in itself (just like in a
{tabular}
). The error you're getting is because you open a new group with
{
in the first cell but don't close it there again. Similarly the color setting is forgotten in the next cell because it was limited to the scope of the first cell. An own environment might be of help:
Code: Select all
\documentclass{article}
\usepackage{amsmath,empheq,xcolor}
\newcommand*\widefbox[1]{\fbox{\hspace{1em}#1\hspace{1em}}}
% see the empheq documentation for examples like this one:
\newenvironment{important}[2][]{%
\setkeys{EmphEqEnv}{#2}%
\setkeys{EmphEqOpt}{box=\normalcolor\widefbox,#1}%
\color{red}%
\EmphEqMainEnv}%
{\endEmphEqMainEnv}
\begin{document}
\begin{important}{align}
A &= B+C\nonumber\\
&= D \nonumber\\
&= E+F
\end{important}
\end{document}
But this will also color the equation numbers.
Regards