[Tex/LaTex] Equations and Equation Numbers within a Box

alignboxesempheq

I use the code below to make a box around equations. It puts the equations numbers outside the box, however I would like to have the equation numbers within the box.

How can I alter my code to do this? Thanks in advance.

\documentclass[11pt]{report}

    \usepackage{empheq}


    \newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}}

    \begin{document}
    \begin{empheq}[box=\widefbox]{align}
    & a = b +c \\
    & d = e+f
    \end{empheq}
    \end{document}

enter image description here

(So: I would like to have the ''(1)'' and ''(2)'' within the box.)

Best Answer

For a change, use tcolorbox:

\documentclass[11pt]{report}

\usepackage[most]{tcolorbox}
\tcbset{myformula/.style={colback=white, %yellow!10!white,
    colframe=black, %red!50!black,
    top=0pt,bottom=0pt,left=0pt,right=0pt,
    boxsep=0pt,
    arc=0pt,
    outer arc=0pt,
}}

\begin{document}
\begin{tcolorbox}[ams align,myformula]
& a = b +c \\
& d = e+f
\end{tcolorbox}
\end{document}

enter image description here