diff options
author | Jean-François B <2589111+jfbu@users.noreply.github.com> | 2023-03-13 15:10:33 +0100 |
---|---|---|
committer | Jean-François B <2589111+jfbu@users.noreply.github.com> | 2023-03-13 17:28:49 +0100 |
commit | ff32c15ce007c4db680d83ed96b34db47607da03 (patch) | |
tree | 691baa084ff112683ee95918d9f3d7c67762aa1c | |
parent | 8b7758160e878739a9a5ee33d2be41883c56706c (diff) | |
download | sphinx-git-ff32c15ce007c4db680d83ed96b34db47607da03.tar.gz |
LaTeX: comments following up on regression fix commit in sphinxShadowBox
-rw-r--r-- | sphinx/texinputs/sphinx.sty | 24 | ||||
-rw-r--r-- | sphinx/texinputs/sphinxlatexadmonitions.sty | 1 | ||||
-rw-r--r-- | sphinx/texinputs/sphinxlatexliterals.sty | 16 |
3 files changed, 27 insertions, 14 deletions
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 4706a139f..9f5418fd6 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -504,10 +504,15 @@ will be set to white}% \begingroup\edef\spx@tempa{##1}\expandafter\endgroup \ifx\spx@tempa\spxstring@none #2% - % MEMO: at 5.1.0 and up to 6.2.0, an \edef+\dimexpr was used here. - % Expansion is now delayed to time of use as for the other dimensions - % handled above. This is synced with the added \dimexpr...\relax - % encapsulation in sphinxpackageboxes.sty's \spx@boxes@fcolorbox@setup. + % MEMO: at 5.1.0 and up to 6.2.0, an \edef with \number\dimexpr was + % used here. Since 6.2.0, expansion is delayed to time of use as for + % the other dimensions handled above. This is synced with an added + % encapsulation in \dimexpr...\relax by the "setup" from + % sphinxpackageboxes.sty. An induced regression had to be fixed in + % the sphinxShadowBox environment as it was using in an \ifdim the + % \spx@topic@shadow@yoffset macro, now holding by default 4pt+\z@ + % rather than an already digested 262144sp. The +\z@ is in case ##2 + % is empty. \else #1% \def#6{##1}\def#7{##2+\z@}% \if\relax\detokenize{##3}\relax#4\else#3\fi @@ -528,14 +533,17 @@ will be set to white}% \spx@tempa{spx@attention@}{div.attention_} \spx@tempa{spx@danger@} {div.danger_} \spx@tempa{spx@error@} {div.error_} -\spx@tempa{spx@box@} {box_}% new at 6.2.0 +\spx@tempa{spx@box@} {box_} % Support for legacy shadowsize (topic/contents) % This definition was broken due to a typo at 5.1.0 and got fixed at 6.1.2 +% MEMO: at 6.2.0 this no longer does \number\dimexpr in an \edef. Reason is to +% keep in sync with div.topic_box-shadow handling of xoffset and yoffset. +% Attention in particular to \ifdim context, we add a \dimexpr to the one here. \define@key{sphinx}{shadowsize}{% - \edef\spx@topic@shadow@xoffset{\number\dimexpr#1\relax sp}% + \def\spx@topic@shadow@xoffset{#1}% \let\spx@topic@shadow@yoffset\spx@topic@shadow@xoffset - \ifdim\spx@topic@shadow@xoffset=\z@ + \ifdim\dimexpr\spx@topic@shadow@xoffset=\z@ \spx@topic@withshadowfalse \else \spx@topic@withshadowtrue @@ -567,7 +575,7 @@ will be set to white}% \spx@tempa{spx@attention@} \spx@tempa{spx@danger@} \spx@tempa{spx@error@} -\spx@tempa{spx@box@}% new at 6.2.0 +\spx@tempa{spx@box@} % \def\spx@tempa#1{% #1 = macro prefix \expandafter\spx@tempb diff --git a/sphinx/texinputs/sphinxlatexadmonitions.sty b/sphinx/texinputs/sphinxlatexadmonitions.sty index 12dbcd647..f23836c2d 100644 --- a/sphinx/texinputs/sphinxlatexadmonitions.sty +++ b/sphinx/texinputs/sphinxlatexadmonitions.sty @@ -118,6 +118,7 @@ % The 5.1.0 default calculation of padding parameters maintains PDF output % identical to legacy behaviour, as long as padding is not set by user. \setlength{\FrameSep}{0.5\dimexpr\spx@boxes@padding@top+\spx@boxes@padding@bottom\relax}% + % "setup" macro has prepared the \spx@boxes@... dimen registers \advance\spx@image@maxheight -\dimexpr\spx@boxes@border@top+\spx@boxes@border@bottom +\spx@boxes@padding@top+\spx@boxes@padding@bottom diff --git a/sphinx/texinputs/sphinxlatexliterals.sty b/sphinx/texinputs/sphinxlatexliterals.sty index 821883668..c4902ff2f 100644 --- a/sphinx/texinputs/sphinxlatexliterals.sty +++ b/sphinx/texinputs/sphinxlatexliterals.sty @@ -682,7 +682,8 @@ % the top padding (better visually) \ifspx@opt@verbatimwithframe\else % but we must now check if there is a background color - \ifspx@pre@withbackgroundcolor\else-\spx@pre@padding@top\fi + % MEMO: "fcolorbox@setup" will have been done by time of use + \ifspx@boxes@withbackgroundcolor\else-\spx@boxes@padding@top\fi \fi % caption package adds \abovecaptionskip vspace, remove it \spx@ifcaptionpackage{-\abovecaptionskip}{}\relax}% @@ -692,7 +693,8 @@ {\nointerlineskip\kern\dimexpr\dp\strutbox \ifspx@opt@verbatimwithframe\else % but we must now check if there is a background color - \ifspx@pre@withbackgroundcolor\else-\spx@pre@padding@bottom\fi + % MEMO: "fcolorbox@setup" will have been done by time of use + \ifspx@boxes@withbackgroundcolor\else-\spx@boxes@padding@bottom\fi \fi \spx@ifcaptionpackage{-\abovecaptionskip}{}\relax \sphinxVerbatim@Title}% @@ -805,10 +807,12 @@ \dp\sphinxVerbatim@ContentsBox+ \ht\sphinxVerbatim@TitleBox+ \dp\sphinxVerbatim@TitleBox+ - \spx@pre@padding@top+ - \spx@pre@padding@bottom+ - \ifspx@opt@verbatimwithframe \spx@pre@border@top+ - \spx@pre@border@bottom+\fi + % 6.2.0 uses here the dimen registers from sphinxpackageboxes.sty, + % they got setup by \spx@verb@boxes@fcolorbox@setup + \spx@boxes@padding@top+ + \spx@boxes@padding@bottom+ + \ifspx@opt@verbatimwithframe \spx@boxes@border@top+ + \spx@boxes@border@bottom+\fi % try to account for external frame parameters % MEMO: this is because the sphinxheavybox (for warning admonitions) % environment sets \FrameSep and \FrameRule |