mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: fix #6809
This commit is contained in:
parent
2e68d76244
commit
53ead2a0d9
2
CHANGES
2
CHANGES
@ -54,6 +54,8 @@ Bugs fixed
|
|||||||
* #6001: LaTeX does not wrap long code lines at backslash character
|
* #6001: LaTeX does not wrap long code lines at backslash character
|
||||||
* #6804: LaTeX: PDF build breaks if admonition of danger type contains
|
* #6804: LaTeX: PDF build breaks if admonition of danger type contains
|
||||||
code-block long enough not to fit on one page
|
code-block long enough not to fit on one page
|
||||||
|
* #6809: LaTeX: code-block in a danger type admonition can easily spill over
|
||||||
|
bottom of page
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -1290,12 +1290,26 @@
|
|||||||
\endOriginalVerbatim
|
\endOriginalVerbatim
|
||||||
\ifspx@inframed
|
\ifspx@inframed
|
||||||
\egroup % finish \sphinxVerbatim@ContentsBox vbox
|
\egroup % finish \sphinxVerbatim@ContentsBox vbox
|
||||||
|
\nobreak % update page totals
|
||||||
\ifdim\dimexpr\ht\sphinxVerbatim@ContentsBox+
|
\ifdim\dimexpr\ht\sphinxVerbatim@ContentsBox+
|
||||||
\dp\sphinxVerbatim@ContentsBox+
|
\dp\sphinxVerbatim@ContentsBox+
|
||||||
\ht\sphinxVerbatim@TitleBox+
|
\ht\sphinxVerbatim@TitleBox+
|
||||||
\dp\sphinxVerbatim@TitleBox>.9\textheight
|
\dp\sphinxVerbatim@TitleBox+
|
||||||
|
2\fboxsep+2\fboxrule+
|
||||||
|
% try to account for external frame parameters
|
||||||
|
\FrameSep+\FrameRule+
|
||||||
|
% Usage here of 2 baseline distances is empirical.
|
||||||
|
% In border case where code-block fits barely in remaining space,
|
||||||
|
% it gets framed and looks good but the outer frame may continue
|
||||||
|
% on top of next page and give (if no contents after code-block)
|
||||||
|
% an empty framed line, as testing showed.
|
||||||
|
2\baselineskip+
|
||||||
|
% now add all to accumulated page totals and compare to \pagegoal
|
||||||
|
\pagetotal+\pagedepth>\pagegoal
|
||||||
% long contents: do not \MakeFramed. Do make a caption (either before or
|
% long contents: do not \MakeFramed. Do make a caption (either before or
|
||||||
% after) if title exists. Continuation hints across pagebreaks dropped.
|
% after) if title exists. Continuation hints across pagebreaks dropped.
|
||||||
|
% FIXME? a bottom caption may end up isolated at top of next page
|
||||||
|
% (no problem with a top caption, which is default)
|
||||||
\spx@opt@verbatimwithframefalse
|
\spx@opt@verbatimwithframefalse
|
||||||
\def\sphinxVerbatim@Title{\noindent\box\sphinxVerbatim@TitleBox\par}%
|
\def\sphinxVerbatim@Title{\noindent\box\sphinxVerbatim@TitleBox\par}%
|
||||||
\sphinxVerbatim@Before
|
\sphinxVerbatim@Before
|
||||||
|
Loading…
Reference in New Issue
Block a user