我正在使用Sphinx來記錄項目。它從restructured text生成LaTeX文件。如何在不干擾其他環境的情況下自定義現有的LaTeX環境
我想設置背景色爲灰色的提示和筆記,所以我創造一個灰盒環境後定製通知環境:
\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\[email protected]{#1}
\par\strong{#2}
\csname [email protected]@#1\endcsname
}
{
\csname [email protected]@\[email protected]\endcsname
\end{graybox}
}
\makeatother
一切正常,除非我放置一個figure環境內通知環境。在這種情況下,我得到這個錯誤:
LaTeX Error: Not in outer par mode
有沒有辦法設置一個灰色的背景到通知環境?
您可能想要將此標題更改爲「現有的Latex環境」。 – ramanujan 2009-04-20 12:14:54