The title explains everything. I have a theorem with ntheorem and want to highlight it with a gray background color. What would be the easiest way to achieve this?

  • 2
    The ntheorem manual has examples that describe this. google: ntheorem.pdf
    – cmhughes
    Aug 3, 2011 at 18:41

3 Answers 3


Just use mdframed package. Here is an example from the document with a little modification:




  • Seems that TeX Live lacks exactly this package. Any other solution? Aug 3, 2011 at 17:51
  • I'm sure that TeX Live 2011 have this package. But your TeX dist may be too old.
    – Leo Liu
    Aug 3, 2011 at 17:55
  • For now, I trust you that it works - furthermore i have changed the highlighting box to \theorem(pre|post)work{(\bigskip\hrule|\hrule\bigskip)} and it's good enough. Hope you understand my notation :D Aug 3, 2011 at 17:58
  • You can either install the mdframed package manually, or update your TeX Live distribution. According to a quick compilation of @Leo's code on ScribTeX - which runs pdftex from TeX Live 2009 - it compiles without problem.
    – Werner
    Aug 3, 2011 at 17:59
  • This solution works great even with TeX Live 2010. Aug 3, 2011 at 18:09

Here's a solution that uses ntheorems built-in shaded theorems; note that this version requires pstricks, and hence you can not use pdflatex. It breaks across pages just fine.






Here's another solution without mdframed package. It is NOT as good as the mdframed solution. The whole theorem environment is put in a box, thus it cannot be break between pages. You may need to put it in a float.





enter image description here

Note: Don't use it if you can access mdframed package. I made it CW and I don't need any score from this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .