[Tex/LaTex] Coloured shadowbox around equations

boxesequationsshadows

I currently put some boxes around equations using:

\newcommand*\eqbox[1]{
\definecolor{shadowcolor}{RGB}{0, 0, 102}\setlength\shadowsize{2pt}\shadowbox*{#1}
}
\eqbox{$1+1=2$}

How to have the same visual result but with equations between \begin{equation}\end{equation} ?

\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{empheq}

\newcommand*\eqbox[1]{\definecolor{shadowcolor}{RGB}{0, 0, 102}\setlength\shadowsize{2pt}\shadowbox*{#1}}
\begin{document}
\eqbox{$1+1 = 2$} % OK
\eqbox{\begin{equation}1+1 = 2\end{equation}} % NOT OK
\begin{equation}\eqbox{1+1 = 2}\end{equation} %OK
\begin{equation}\eqbox{r_{s} = \frac{2GM}{c^{2}}}\end{equation} % NOT OK
\end{document}

Note: I do not want the equation number to be in the box…

Best Answer

The package empheq does this quite easily:

\documentclass[11pt,a4paper]{book}
\usepackage{fancybox,xcolor}
\usepackage{empheq}

\definecolor{shadowcolor}{RGB}{0, 0, 102}
\newcommand*\eqbox[1]{%
  \setlength\shadowsize{2pt}%
  \shadowbox*{#1}%
}


\begin{document}
Some text
\begin{empheq}[box=\eqbox]{equation}
1+1 = 2
\end{empheq}
Some text
\begin{empheq}[box=\eqbox]{align}
r_{s} &= \dfrac{2GM}{c^{2}} \\
v &= ab+cd
\end{empheq}

\end{document}

enter image description here

Is this something I like? No.