From 9e9902cd5dcc616d359c8e3e4cf45c207300499d Mon Sep 17 00:00:00 2001 From: jfbu Date: Sun, 8 Jan 2017 18:01:34 +0100 Subject: [PATCH] Deprecate use of notice environment in LaTeX source. --- sphinx/texinputs/sphinx.sty | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 249e9ed9d..3180fa52d 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -786,10 +786,7 @@ \csname\@backslashchar color@#2\endcsname } % the main dispatch for all types of notices -\newenvironment{sphinxadmonition}{\begin{notice}}{\end{notice}} -% use of ``notice'' is for backwards compatibility and will be removed in -% future release; sphinxadmonition environment will be defined directly. -\newenvironment{notice}[2]{% #1=type, #2=heading +\newenvironment{sphinxadmonition}[2]{% #1=type, #2=heading % can't use #1 directly in definition of end part \def\spx@noticetype {#1}% % set parameters of heavybox/lightbox @@ -800,6 +797,16 @@ \begin{sphinx#1}{#2}} % in end part, need to go around a LaTeX's "feature" {\edef\spx@temp{\noexpand\end{sphinx\spx@noticetype}}\spx@temp} +% use of ``notice'' is for backwards compatibility and will be removed in +% Sphinx 1.7. +\newenvironment{notice} + {\AtEndDocument{\typeout +{**** DEPRECATION WARNING:^^J +This document was probably built with a Sphinx extension using ``notice''^^J +environment. At Sphinx 1.7, ``notice'' environment will be removed. Please^^J +report to extension author to use ``sphinxadmonition'' instead.^^J% +****}}% + \begin{sphinxadmonition}}{\end{sphinxadmonition}} % Allow the release number to be specified independently of the % \date{}. This allows the date to reflect the document's date and