7

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.)

13

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.