You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One observes sometimes large voids at bottom of pages. This is a relatively rare and delicate phenomenon.
After some analysis, it is due to interaction between two LaTeX packages: parskip and titlesec due to the fact we load the latter with option nobottomtitles*. See #6633 which introduced its use.
(we could produce a pure LaTeX example using only parskip and titlesec as Sphinx does and dropping all Sphinx LaTeX support files).
Sphinx uses parskip with [=v1] option but the issue can be reproduced without it (minimal reproducer has to be modified a bit because vertical whitespace chnages).
EDIT: actually parskip is not involved in this issue (we were fooled because suppressing it made the issue go away in our tests, but this is simply consequence of modified vertical spacing). Thanks @dbitouze.
In the above example if we toggle two sections we see there was ample room to fit entirely the one which was pushed to next page.
The issue was observed in a real-life project (with a 2000+ pages PDF) and the gap was even more spectacular but it is delicate to reproduce exactly if not using the exact same contents.
(for the sake of the screenshots, the openany option was added and a page was added so that I could get my PDF viewer to display the pages by 2 as above)
I don't think parskip has anything to do with this issue: even without it, the problem remains. One solution is to reduce the length of \bottomtitlespace, which by default is .2\textheight, e.g. as follows:
The cause is simply that the default of titlesec under nobottomtitles* appears to require that there is at least 0.2\textheight space available for not moving section title to next page. I.e. for Sphinx default with letterpaper, and 1in margins, this is a whopping 1.8in (4.57cm), and with a4paper this is 4.92cm (1.94in). These dimensions are enormous.
Fortunately we can customize this by reassigning the titlesec parameter \bottomtitlespace. It does not seem to make any sense to let it be a multiple of \textheight, an absolute dimension (or a relative one related to \baselineskip) makes much more sense.
jfbu
added a commit
to jfbu/sphinx
that referenced
this issue
Aug 27, 2024
Describe the bug
One observes sometimes large voids at bottom of pages. This is a relatively rare and delicate phenomenon.
After some analysis, it is due to interaction between two LaTeX packages:
parskip
andtitlesec
due to the fact we load the latter with optionnobottomtitles*
. See #6633 which introduced its use.(we could produce a pure LaTeX example using only
parskip
andtitlesec
as Sphinx does and dropping all Sphinx LaTeX support files).Sphinx uses
parskip
with[=v1]
option but the issue can be reproduced without it (minimal reproducer has to be modified a bit because vertical whitespace chnages).EDIT: actually
parskip
is not involved in this issue (we were fooled because suppressing it made the issue go away in our tests, but this is simply consequence of modified vertical spacing). Thanks @dbitouze.In the above example if we toggle two sections we see there was ample room to fit entirely the one which was pushed to next page.
The issue was observed in a real-life project (with a 2000+ pages PDF) and the gap was even more spectacular but it is delicate to reproduce exactly if not using the exact same contents.
(for the sake of the screenshots, the openany option was added and a page was added so that I could get my PDF viewer to display the pages by 2 as above)
How to Reproduce
index.rst
isEnvironment Information
Sphinx extensions
none
Additional context
No response
The text was updated successfully, but these errors were encountered: