I get problems when I try to use sidenotes in an mdframed environment:
\documentclass{tufte-book}
\usepackage{xcolor}
\usepackage{mdframed}
\newtheorem{mdtheorem}{Theorem}
\newenvironment{theorem}%
{\begin{mdframed}[backgroundcolor=lightgray]\begin{mdtheorem}}%
{\end{mdtheorem}\end{mdframed}}
\begin{document}
\begin{theorem}
test \sidenote{side note}
\end{theorem}
\end{document}
Any ideas how to get around this issue?