I'm using Sphinx for documenting a project. It produces LaTeX files from restructured text.
I would like to set a gray background color to the tips and notes, so I customized the notice environment after creating a graybox environment:
\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
\makeatletter\newenvironment{graybox}{%
\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth}}{\end{minipage}\end{lrbox}%
\colorbox{MyGray}{\usebox{\@tempboxa}}
}\makeatother
\makeatletter
\renewenvironment{notice}[2]{
\begin{graybox}
\bf\it
\def\py@noticetype{#1}
\par\strong{#2}
\csname py@noticestart@#1\endcsname
}
{
\csname py@noticeend@\py@noticetype\endcsname
\end{graybox}
}
\makeatother
Everything works fine except if I place a figure environment inside the notice environment. In that case, I get this error:
LaTeX Error: Not in outer par mode
Is there a way to set a gray background to that notice environment ?