I use this code to change the appearance of the equation, but it is full of errors even if at the end it gives a result, please help me to correct it. Thank you .
\documentclass{article}
\usepackage{empheq}
\usepackage{xcolor}
\newcommand{\coloredeq}[1]{
\begin{empheq}[box=\colorbox{red}]{align*}
#1
\end{empheq}
}
\let\oldeqnarray\eqnarray*
\let\endoldeqnarray\endeqnarray*
\renewenvironment{eqnarray*}{
\begin{empheq}[box=\colorbox{red}]{align*}
}{
\end{empheq}
}
\begin{document}
\begin{eqnarray*}
a &= b \\
c &= d
\end{eqnarray*}
\end{document}
eqnarray
is bad and should be replaced byalign
.eqnarray
.