I use declaretheoremstyle to declare a theorem environment. I like the format of shaded, it gives a special background color without shorten the width of a text. But one problem is that a theorem block does not span in 2 pages. So if a block is too long, it intersects with the bottom margin of the page:
\documentclass{article}
\usepackage[english]{babel}
\usepackage[margin=2cm]{geometry}% just for the example
\usepackage{xcolor}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{mdframed}
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\normalfont\bfseries,
postheadspace=1em,
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\itshape,
shaded={bgcolor=yellow!20}
]{thmstyle}
\declaretheorem[style=thmstyle,name=Theorem]{theorem}
\begin{document}
\begin{theorem}[name]
...
\end{theorem}
\renewcommand{\listtheoremname}{List of Theorems}
\addcontentsline{toc}{section}{\listtheoremname}
\listoftheorems[ignoreall,show=theorem]
\end{document}
I tried to follow this proposition by using preheadhook and postfoothook. It does solve the problem of spanning, but it shortens the width of a text, as I showed here.
I think i will go with the authentic width (as shaded gives), does anyone know how to make it span in 2 pages?


declaretheoremstyleis to put a background color. So I would like the other things to be exactly the same as the default theorem environment. So do you thinkspacebelow,spaceaboveandpostheadspaceare all well set (i.e., why are they6ptor1em)? And what aboutskipaboveandskipbelowofmdframed? – SoftTimur Jun 12 '15 at 21:35postheadspacehas no problem. The new set of settings (at the bottom of my answer) will give you the desired result. – Gonzalo Medina Jun 12 '15 at 21:45shadeddoes not shorten the width, its background shading exceeds a little bit the width... Also, shouldskipabove,skipbelowofmdframedbe set? Shouldspacebelowandspaceabovebe6pt? – SoftTimur Jun 12 '15 at 21:52\textwidthfor the text and the frame will protrude2pton both sides. I've updated my answer providing settings that (according to my tests) reproduce the settings of theshadedstyle you originally had. – Gonzalo Medina Jun 13 '15 at 16:42