[Tex/LaTex] box all equations of align environment, but not the equation numbers

boxesequations

I want to box (like \boxed{} of package amsmath or \Aboxed{} of package mathtools) the entire block of equations from an align (or eqnarray) environment, but not the equation labels. How can I do that? (I saw this in a book and thought that LaTeX should be able to do that too.)

Best Answer

Two options; the first one using the empheq package, and the second one using the interaction between empheq and tcolorbox for fancyer designs:

enter image description here

The code:

\documentclass{article}    
\usepackage{amsmath}
\usepackage[many]{tcolorbox}
\usepackage{empheq}
\usetikzlibrary{shadows}

\tcbset{
  highlight math style={
    enhanced,
    colframe=red!60!black,
    colback=yellow!50,
    arc=4pt,
    boxrule=1pt,
    drop fuzzy shadow
  }
}

\begin{document}

\begin{empheq}[box=\fbox]{align}
a&=\sin(z)\\
E&=mc^2 + \int_a^b x\, dx
\end{empheq}

\begin{empheq}[box=\tcbhighmath]{align}
a&=\sin(z)\\
E&=mc^2 + \int_a^b x\, dx
\end{empheq}

\end{document}