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:Is this something I like? No.