summaryrefslogtreecommitdiff
path: root/sphinx/texinputs
diff options
context:
space:
mode:
authorJean-François B <2589111+jfbu@users.noreply.github.com>2023-01-06 23:52:19 +0100
committerGitHub <noreply@github.com>2023-01-06 23:52:19 +0100
commit7945aeb22d21aed44c03eb42c2a64e75c5e8166c (patch)
tree9080b080ebac7cc0adf20b8f0589f0f8fd8640b5 /sphinx/texinputs
parent77aaa8696a5554b68e9b7daf691ccd4943e7fe7b (diff)
downloadsphinx-git-7945aeb22d21aed44c03eb42c2a64e75c5e8166c.tar.gz
LaTeX: fix 5.1.0 bugs related to topic and contents boxes (#11102)
* Fix #11095 (PDF wrong placement of shadow of topic boxes since 5.1.0) * Fix #11096 (LaTeX shadowsize regression at 5.1.0) * Fix #11099 (shadowrule legacy sphinxsetup key vanished at 5.1.0) * Fix #11101 (LaTeX div.topic_padding of sphinxsetup had wrong name) * Add some checks that various sphinxsetup keys do not break PDF build * Update LaTeX docs * Update CHANGES * Can not use :dudir:`contents` has it links to wrong place
Diffstat (limited to 'sphinx/texinputs')
-rw-r--r--sphinx/texinputs/sphinx.sty25
-rw-r--r--sphinx/texinputs/sphinxlatexshadowbox.sty6
2 files changed, 18 insertions, 13 deletions
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index bf7bba2c9..618ee0b90 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -6,7 +6,7 @@
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{sphinx}[2023/01/03 v6.1.0 LaTeX package (Sphinx markup)]
+\ProvidesPackage{sphinx}[2023/01/06 v6.1.2 LaTeX package (Sphinx markup)]
% provides \ltx@ifundefined
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
@@ -436,7 +436,7 @@ will be set to white}%
\let\spx@topic@border@bottom\spx@topic@border@top
\let\spx@topic@border@left \spx@topic@border@top
\expandafter\let\expandafter\KV@sphinx@shadowrule
- \csname KV@sphinx@topic_border-width\endcsname
+ \csname KV@sphinx@div.topic_border-width\endcsname
\newif\ifspx@topic@border@open % defaults to false (legacy)
\define@key{sphinx}{div.topic_box-decoration-break}%
{\begingroup\edef\spx@tempa{#1}\expandafter\endgroup
@@ -445,11 +445,13 @@ will be set to white}%
\else\spx@topic@border@opentrue\fi}%
%
% MEMO: \sphinxshadowsep not used anywhere anymore in code base and to be removed
-\define@key{sphinx}{topic_padding-top}{\def\spx@topic@padding@top{#1}}
-\define@key{sphinx}{topic_padding-right}{\def\spx@topic@padding@right{#1}}
-\define@key{sphinx}{topic_padding-bottom}{\def\spx@topic@padding@bottom{#1}}
-\define@key{sphinx}{topic_padding-left}{\def\spx@topic@padding@left{#1}}
-\define@key{sphinx}{topic_padding}{%
+% Sadly the 5.1.0 definitions forgot the "div." part of the key names
+% Fixed at 6.1.2
+\define@key{sphinx}{div.topic_padding-top}{\def\spx@topic@padding@top{#1}}
+\define@key{sphinx}{div.topic_padding-right}{\def\spx@topic@padding@right{#1}}
+\define@key{sphinx}{div.topic_padding-bottom}{\def\spx@topic@padding@bottom{#1}}
+\define@key{sphinx}{div.topic_padding-left}{\def\spx@topic@padding@left{#1}}
+\define@key{sphinx}{div.topic_padding}{%
\def\spx@topic@padding@top {#1}%
\let\spx@topic@padding@right \spx@topic@padding@top
\let\spx@topic@padding@bottom\spx@topic@padding@top
@@ -460,7 +462,7 @@ will be set to white}%
\let\spx@topic@padding@bottom\spx@topic@padding@top
\let\spx@topic@padding@left \spx@topic@padding@top
\expandafter\let\expandafter\KV@sphinx@shadowsep
- \csname KV@sphinx@topic_padding\endcsname
+ \csname KV@sphinx@div.topic_padding\endcsname
%
\define@key{sphinx}{div.topic_border-top-left-radius}{\def\spx@topic@radius@topleft{#1}}
\define@key{sphinx}{div.topic_border-top-right-radius}{\def\spx@topic@radius@topright{#1}}
@@ -504,14 +506,15 @@ will be set to white}%
\spx@topic@box@shadow@setter 4pt 4pt {} \@nnil
% Suport for legacy shadowsize, the \sphinxshadowsize \dimen register
% is not used anymore and should not even be allocated in future
+% This definition was broken at 5.1.0 and fixed at 6.1.2
\define@key{sphinx}{shadowsize}{%
\edef\spx@topic@shadow@xoffset{\number\dimexpr#1\relax sp}%
\let\spx@topic@shadow@yoffset\spx@topic@shadow@xoffset
\ifdim\spx@topic@shadow@xoffset=\z@
- \spx@topic@box@withshadowtrue
+ \spx@topic@withshadowfalse
\else
- \spx@topic@box@withshadowfalse
- \spx@topic@box@shadow@insetfalse
+ \spx@topic@withshadowtrue
+ \spx@topic@insetshadowfalse
\fi
}%
\definecolor{sphinxTopicBorderColor}{rgb}{0,0,0}
diff --git a/sphinx/texinputs/sphinxlatexshadowbox.sty b/sphinx/texinputs/sphinxlatexshadowbox.sty
index 069526717..96146f0fc 100644
--- a/sphinx/texinputs/sphinxlatexshadowbox.sty
+++ b/sphinx/texinputs/sphinxlatexshadowbox.sty
@@ -1,7 +1,7 @@
%% TOPIC AND CONTENTS BOXES
%
% change this info string if making any custom modification
-\ProvidesFile{sphinxlatexshadowbox.sty}[2022/07/03 sphinxShadowBox]
+\ProvidesFile{sphinxlatexshadowbox.sty}[2023/01/06 sphinxShadowBox]
% Provides support for this output mark-up from Sphinx latex writer:
%
@@ -89,7 +89,9 @@
\fi
\ifspx@topic@withshadow
\ifspx@topic@insetshadow\else
- \ifdim\spx@topic@shadow@xoffset>\z@\hskip\spx@topic@shadow@xoffset\relax
+ % A strangely unnoticed 5.1.0 breakage of the legacy placement of the
+ % shadow was caused by a lacking minus sign here, fixed at 6.1.2
+ \ifdim\spx@topic@shadow@xoffset>\z@\hskip-\spx@topic@shadow@xoffset\relax
\fi
\fi
\fi