I have drawn a rounded box around my equations using this code :

\usepackage[customcolors]{hf-tikz}
\usepackage[framemethod=tikz]{mdframed}
\hfsetbordercolor{green}
$$\tikzmarkin{g}(0.4,-0.5)(-0.2,0.75)r = \frac{n \sum xy - \sum x \sum y} {\sqrt{[n \sum x^2 - (\sum x)^2][n \sum y^2 - (\sum y)^2]}}\tikzmarkend{g}$$


I'm wandering how I can add a grey shadow around the outline of the box ?

Thanks for any help!

• \tikzmarkin is not a command defined by either the tikzmark libary or TikZ itself, can you add a complete example? Edit: OK, I see it's defined by hf-tikz, but still, an MWE would have been preferable. – Torbjørn T. Nov 29 '15 at 18:50

Another solution. This one uses tcolorbox instead of mdframed.

\documentclass{article}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage[most]{tcolorbox}

\tcbset{colback=yellow!20!white,colframe=blue!50!black,
}

\begin{document}
$$\tcbhighmath{r=\frac{n \sum xy - \sum x \sum y} {\sqrt{[n \sum x^2 - (\sum x)^2][n \sum y^2 - (\sum y)^2]}}}$$
\end{document}


Well, this is not rounded box ... but for starting point should serve the following example:

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{fancybox}
\usepackage{empheq}

\usepackage[active,tightpage]{preview}% just to show only equation
\setlength\PreviewBorder{1em}

\begin{document}