diff --git a/CHANGES b/CHANGES index aa60b476b41..a633239e033 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,8 @@ Features added now each be styled as the other admonitions, i.e. possibly with a background color, individual border widths and paddings, possibly rounded corners, and optional shadow. See :ref:`additionalcss`. (refs: #11234) +* LaTeX: admonitions and :dudir:`topic` (and contents_) directives, + and not only :rst:dir:`code-block`, support ``box-decoration-break=slice``. Bugs fixed ---------- @@ -88,8 +90,6 @@ Bugs fixed since Sphinx 5.1.0 * #11095: LaTeX: shadow of :dudir:`topic` and contents_ boxes not in page margin since Sphinx 5.1.0 - - .. _contents: https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents * #11100: Fix copying images when running under parallel mode. Release 6.1.1 (released Jan 05, 2023) @@ -7376,3 +7376,5 @@ Previous versions The changelog for versions before 1.0 can be found in the file ``CHANGES.old`` in the source distribution or `at GitHub `__. + +.. _contents: https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents diff --git a/doc/latex.rst b/doc/latex.rst index ebde07333c3..2e1e0509046 100644 --- a/doc/latex.rst +++ b/doc/latex.rst @@ -1122,6 +1122,14 @@ Additional CSS-like ``'sphinxsetup'`` keys ``noteBgColor`` (or ``hintBgColor``, ...) also triggers usage of ``sphinxheavybox`` for :dudir:`note` (or :dudir:`hint`, ...). +.. versionadded:: 6.2.0 + + All "admonition" directives as well as :dudir:`topic` and contents_ now + support their respective ``box-decoration-break`` to be set to ``slice``. + Formerly, only :rst:dir:`code-block` did. It is undecided though if this + should inhibit the display of a bottom shadow, if set. Currently the shadow, + if set, is shown nevertheless but this is to be considered unstable. + Perhaps in future these 5.1.0 (and 6.2.0) novel settings will be optionally imported from some genuine CSS external file, but currently they have to be used via the ``'sphinxsetup'`` interface (or the ``\sphinxsetup`` LaTeX command @@ -1194,10 +1202,9 @@ forget the underscore separating the prefix from the property names. ``border-left-width`` and ``border-right-width`` both to ``0pt``. - ``_box-decoration-break`` can be set to either ``clone`` or - ``slice`` and configures the behavior at page breaks. It is currently - *ignored*: the behavior is as if ``clone`` had been specified. Except by - :rst:dir:`code-block` (i.e. for ``=pre``) which defaults to using - ``slice`` since 6.0.0 (former default was ``clone``). + ``slice`` and configures the behavior at page breaks. + It defaults to ``slice`` for :rst:dir:`code-block` (i.e. for ``=pre``) + since 6.0.0. For other directives the default is ``clone``. - | ``_padding-top``, | ``_padding-right``, | ``_padding-bottom``, diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index cf6e2ce2719..9b7b4e2ec2e 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -376,6 +376,8 @@ will be set to white}% \spx@tempa{spx@box@} {box_} {box_border-width}\fboxrule % Set default box-decoration-break style for codeblocks to slice \spx@pre@border@opentrue % new default at 6.0.0: slice, not clone +% 6.2.0 has added support for box-decoration-break=slice to all +% other directives, formerly the option setting was ignored for them. % Padding keys % diff --git a/sphinx/texinputs/sphinxlatexadmonitions.sty b/sphinx/texinputs/sphinxlatexadmonitions.sty index f23836c2df4..a19a32f92f9 100644 --- a/sphinx/texinputs/sphinxlatexadmonitions.sty +++ b/sphinx/texinputs/sphinxlatexadmonitions.sty @@ -138,6 +138,16 @@ \spx@boxes@fcolorbox{##1}% \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth }% + % 6.2.0 adds support for div._box-decoration-break=slice. + % (it is yet undecided if slice style should inhibit a bottom shadow) + \csname ifspx@\spx@noticetype @border@open\endcsname + \def\FirstFrameCommand + {\spx@boxes@fcolorbox@setup@openbottom\FrameCommand}% + \def\MidFrameCommand + {\spx@boxes@fcolorbox@setup@openboth \FrameCommand}% + \def\LastFrameCommand + {\spx@boxes@fcolorbox@setup@opentop \FrameCommand}% + \fi \savenotes % use a minipage if we are already inside a framed environment \ifspx@inframed diff --git a/sphinx/texinputs/sphinxpackageboxes.sty b/sphinx/texinputs/sphinxpackageboxes.sty index f1efbc4c05e..f9e09b58103 100644 --- a/sphinx/texinputs/sphinxpackageboxes.sty +++ b/sphinx/texinputs/sphinxpackageboxes.sty @@ -183,15 +183,16 @@ }% end of "no pict2e" branch %%%%%%%%%%%%%%%% -% Support of box-decoration-break +% Support of box-decoration-break=slice +% +% 6.2.0 has renamed and moved this here from sphinxlatexliterals.sty, +% to facilitate supporting box-decoration-break=slice for all directives, +% not only code-block. % -% 6.2.0 has renamed and moved this here from sphinxlatexliterals.sty. % It also modified when these post actions are executed, in order % for openboth to be able to trigger usage of fcolorbox@rectangle. % So now openbottom and opentop also take advantage of this possible % optimization. -% -% Currently only used by sphinxVerbatim, i.e. code-block directive. \def\spx@boxes@fcolorbox@setup@openbottom{% \spx@boxes@border@bottom \z@ \spx@boxes@radius@bottomright\z@ @@ -627,9 +628,8 @@ }% end of definition of \spx@boxes@borderpath@openbottom % MEMO: at 6.2.0, this is still needed. If the user has set some corner radius % to be positive and also both bottom and top border widths to be zero, this -% will be executed (and thus ignore the radii). But in the specific case of -% the MidFrameCommand of sphinxVerbatim under pre_box-decoration-break=slice -% (code-block is the only directive supporting it so far) the +% will be executed (and thus ignore the radii). But in the specific case of of +% a MidFrameCommand under box-decoration-break=slice context the % \spx@boxes@fcolorbox@setup@openboth will have triggered usage of % fcolorbox@rectangle, not fcolorbox@rounded, so this is not executed then. \def\spx@boxes@borderpath@openboth{%