Skip to content

Commit

Permalink
Fix sphinx-doc#11101 (LaTeX div.topic_padding of sphinxsetup had wron…
Browse files Browse the repository at this point in the history
…g name)
  • Loading branch information
jfbu committed Jan 6, 2023
1 parent 7921058 commit 0448cb7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CHANGES
Expand Up @@ -4,9 +4,11 @@ Release 6.1.2 (in development)
Bugs fixed
----------

* #11099: LaTeX: shadowrule key of sphinxsetup causes PDF build to crash
* #11101: LaTeX: ``div.topic_padding`` key of sphinxsetup documented at 5.1.0 was
implemented with name ``topic_padding``
* #11099: LaTeX: ``shadowrule`` key of sphinxsetup causes PDF build to crash
since Sphinx 5.1.0
* #11096: LaTeX: shadowsize key of sphinxsetup causes PDF build to crash
* #11096: LaTeX: ``shadowsize`` key of sphinxsetup causes PDF build to crash
since Sphinx 5.1.0
* #11095: LaTeX: shadow of :dudir:`topic` and contents_ boxes not in page
margin since Sphinx 5.1.0
Expand Down
4 changes: 4 additions & 0 deletions doc/latex.rst
Expand Up @@ -1165,6 +1165,10 @@ Options for topic boxes:
| ``div.topic_padding-left``,
| ``div.topic_padding``,
again this is a single dimension. Its default is ``5pt``.
.. versionchanged:: 6.1.2
These keys had been implemented at 5.1.0 without ``div.`` in
their names.
- | ``div.topic_border-top-left-radius``,
| ``div.topic_border-top-right-radius``,
| ``div.topic_border-bottom-right-radius``,
Expand Down
15 changes: 9 additions & 6 deletions sphinx/texinputs/sphinx.sty
Expand Up @@ -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
Expand All @@ -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}}
Expand Down Expand Up @@ -504,6 +506,7 @@ 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
Expand Down

0 comments on commit 0448cb7

Please sign in to comment.