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

\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!

  • 2
    \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.


    highlight math style={enhanced, drop shadow}

\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]}}}

enter image description here


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


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


E = mc^2

Which gives:

enter image description here

When you provide MWE or what you try so far, I will try to adopt this answer to your wish.

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.