From: Enrico Joerns <[email protected]> Spinx deprecated 'notice' environment in 1.6b1 and finally removed in 1.7.0b1.
Anyway, environment renewal to show warning symbol for note rst directive was not working in between. This patch both fixes warning symbol in sphinx versions between 1.6b1 and 1.7.0b1 and tex generation error after version 1.7.0b1: | ! LaTeX Error: Environment notice undefined. Instead of renewing a possible non-existing environment, we create a new one and override sphinxadmonition environment only if it existed before, or notice environment if not. Signed-off-by: Enrico Joerns <[email protected]> --- doc/preamble.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/preamble.inc b/doc/preamble.inc index 58665c52f..d9e528ef4 100644 --- a/doc/preamble.inc +++ b/doc/preamble.inc @@ -46,7 +46,7 @@ \renewcommand{\footrulewidth}{0.4pt} } -\renewenvironment{notice}[2]{ +\newenvironment{ptxdistwarning}[2]{ \def\py@noticetype{#1} \csname py@noticestart@#1\endcsname \begin{minipage}[c]{\textwidth} @@ -70,6 +70,15 @@ \end{minipage} \csname py@noticeend@\py@noticetype\endcsname } +% compatibility to old sphinx versions +\ifdefined\sphinxadmonition +\let\sphinxadmonition\ptxdistwarning +\let\endsphinxadmonition\endptxdistwarning +\else +\let\notice\ptxdistwarning +\let\endnotice\endptxdistwarning +\fi + \definecolor{VerbatimColor}{gray}{0.95} \definecolor{VerbatimBorderColor}{gray}{0.75} -- 2.20.1 _______________________________________________ ptxdist mailing list [email protected]
