mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #10695: old LaTeX does not allow \@ifpackageloaded usage in body
This commit is contained in:
parent
afac558d09
commit
faccc21822
@ -685,6 +685,27 @@
|
|||||||
%% FRAMED ENVIRONMENTS
|
%% FRAMED ENVIRONMENTS
|
||||||
%
|
%
|
||||||
\RequirePackage{sphinxpackageboxes}
|
\RequirePackage{sphinxpackageboxes}
|
||||||
|
% This macro is possibly executed at begin document if the check
|
||||||
|
% whether radii setting options have been used turns out positive
|
||||||
|
\def\spx@RequirePackage@PictIIe{%
|
||||||
|
\IfFileExists{pict2e.sty}
|
||||||
|
{\RequirePackage{pict2e}}
|
||||||
|
{\PackageWarningNoLine{sphinx}{%
|
||||||
|
The package pict2e is required for rounded boxes.\MessageBreak
|
||||||
|
It does not seem to be available on your system.\MessageBreak
|
||||||
|
Options for setting radii will thus be ignored}%
|
||||||
|
\AtEndDocument{\PackageWarningNoLine{sphinx}{%
|
||||||
|
I issued a warning which may have gotten lost in the\MessageBreak
|
||||||
|
gigantic console output: pict2e.sty was not found,\MessageBreak
|
||||||
|
and radii setting options have been ignored}}%
|
||||||
|
\def\spx@boxes@fcolorbox@rounded{\spx@boxes@fcolorbox}%
|
||||||
|
}%
|
||||||
|
}%
|
||||||
|
% This at begin document will be executed after \spx@RequirePackage@PictIIe
|
||||||
|
\AtBeginDocument{%
|
||||||
|
\@ifpackageloaded{pict2e}{\let\spx@ifpackageloaded@pictiie\@firstoftwo}%
|
||||||
|
{\let\spx@ifpackageloaded@pictiie\@secondoftwo}%
|
||||||
|
}%
|
||||||
\input{sphinxlatexadmonitions.sty}
|
\input{sphinxlatexadmonitions.sty}
|
||||||
\input{sphinxlatexliterals.sty}
|
\input{sphinxlatexliterals.sty}
|
||||||
\input{sphinxlatexshadowbox.sty}
|
\input{sphinxlatexshadowbox.sty}
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
\ifdim\spx@boxes@radius@bottomleft >\z@0\fi
|
\ifdim\spx@boxes@radius@bottomleft >\z@0\fi
|
||||||
1\spx@boxes@fcolorbox{##1}%
|
1\spx@boxes@fcolorbox{##1}%
|
||||||
\else
|
\else
|
||||||
\@ifpackageloaded{pict2e}%
|
\spx@ifpackageloaded@pictiie
|
||||||
{\ifspx@boxes@insetshadow
|
{\ifspx@boxes@insetshadow
|
||||||
\spx@boxes@fcolorbox{##1}%
|
\spx@boxes@fcolorbox{##1}%
|
||||||
\else
|
\else
|
||||||
|
@ -164,7 +164,7 @@
|
|||||||
\ifdim\spx@pre@radius@bottomleft >\z@0\fi
|
\ifdim\spx@pre@radius@bottomleft >\z@0\fi
|
||||||
1\spx@boxes@fcolorbox{\box\z@}%
|
1\spx@boxes@fcolorbox{\box\z@}%
|
||||||
\else
|
\else
|
||||||
\@ifpackageloaded{pict2e}%
|
\spx@ifpackageloaded@pictiie
|
||||||
{\ifspx@pre@insetshadow
|
{\ifspx@pre@insetshadow
|
||||||
\spx@boxes@fcolorbox{\box\z@}%
|
\spx@boxes@fcolorbox{\box\z@}%
|
||||||
\else
|
\else
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
\ifdim\spx@topic@radius@bottomleft >\z@0\fi
|
\ifdim\spx@topic@radius@bottomleft >\z@0\fi
|
||||||
1\spx@boxes@fcolorbox{\box\z@}%
|
1\spx@boxes@fcolorbox{\box\z@}%
|
||||||
\else
|
\else
|
||||||
\@ifpackageloaded{pict2e}%
|
\spx@ifpackageloaded@pictiie
|
||||||
{\ifspx@topic@insetshadow
|
{\ifspx@topic@insetshadow
|
||||||
\spx@boxes@fcolorbox{\box\z@}%
|
\spx@boxes@fcolorbox{\box\z@}%
|
||||||
\else
|
\else
|
||||||
|
@ -72,22 +72,6 @@
|
|||||||
% if nothing else is changed (perhaps in future the title itself could be also
|
% if nothing else is changed (perhaps in future the title itself could be also
|
||||||
% rendered in a rounded box?)
|
% rendered in a rounded box?)
|
||||||
|
|
||||||
\def\spx@RequirePackage@PictIIe{%
|
|
||||||
\IfFileExists{pict2e.sty}
|
|
||||||
{\RequirePackage{pict2e}}
|
|
||||||
{\PackageWarningNoLine{sphinx}{%
|
|
||||||
The package pict2e is required for rounded boxes.\MessageBreak
|
|
||||||
It does not seem to be available on your system.\MessageBreak
|
|
||||||
Options for setting radii will thus be ignored}%
|
|
||||||
\AtEndDocument{\PackageWarningNoLine{sphinx}{%
|
|
||||||
I issued a warning which may have gotten lost in the\MessageBreak
|
|
||||||
gigantic console output: pict2e.sty was not found,\MessageBreak
|
|
||||||
and radii setting options have been ignored}}%
|
|
||||||
\def\spx@boxes@fcolorbox@rounded{\spx@boxes@fcolorbox}%
|
|
||||||
}%
|
|
||||||
}%
|
|
||||||
|
|
||||||
|
|
||||||
%//// \spx@boxes@fcolorbox
|
%//// \spx@boxes@fcolorbox
|
||||||
% This box will have the same baseline as its argument (which is typeset in
|
% This box will have the same baseline as its argument (which is typeset in
|
||||||
% horizontal mode). It takes into account four border widths parameters, four
|
% horizontal mode). It takes into account four border widths parameters, four
|
||||||
|
Loading…
Reference in New Issue
Block a user