New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #6668: LaTeX: Longtable before header has incorrect distance #6681
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.0 #6681 +/- ##
=======================================
Coverage 83.73% 83.73%
=======================================
Files 271 271
Lines 41020 41020
Branches 6002 6002
=======================================
Hits 34350 34350
Misses 5342 5342
Partials 1328 1328 Continue to review full report at Codecov.
|
@@ -119,7 +119,8 @@ | |||
{\dimexpr-\dp\strutbox | |||
-\spx@ifcaptionpackage{\abovecaptionskip}{\sphinxbaselineskip}% | |||
+\sphinxbelowcaptionspace\relax}% | |||
\def\sphinxatlongtableend{\prevdepth\z@\vskip\sphinxtablepost\relax}% | |||
\def\sphinxatlongtableend{\@nobreakfalse % latex3/latex2e#173 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sphinx LaTeX uses parskip
package which sets the paragraph indentation to zero. For the record, let me point out that this patch induces following change if paragraph indentation \parindent
is not zero:
After a section title, LaTeX suppresses the indentation of the first paragraph following it,
Without this patch, if a longtable immediately follows a section title, the LaTeX mechanism applies to suppress indentation of first text paragraph after longtable,
With this patch, in the title then longtable then text
situation, the text will get indented, rather.
I don't think we should worry about it, as anyhow Sphinx LaTeX defaults to setting \parindent
to 0pt
(btw, over the last few years some effort went into making various LaTeX code of Sphinx compatible with a non-zero \parindent
, which it was not formerly). And there are various easy means for advanced Sphinx LaTeX users to revert this, either e.g. by redefining \sphinxatlongtableend
or by using a modified longtable template file in their project.
Besides, this made me realize advanced Sphinx LaTeX users working with positive \parindent
currently face an inconsistency between cases title -> tabular -> text
and title -> longtable -> text
as in former case indentation applies but in latter case indentation does not apply.
With this patch it applies in both cases and the inconsistency is resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\sphinxattableend
is defined in sphinx.sty
as an identical copy of \sphinxatlongtableend
hence inherits the \@nobreakfalse
. This does not matter because the code for tabular
or tabulary
anyhow triggers the LaTeX paragraph builder hence does it already. Thus there was no need to give \sphinxattableend
a separate definition.
Bugfix
Relates
A longtable does not issue
\@nobreakfalse
resulting in inconsistent spacing latex3/latex2e#173Longtable before header has incorrect distance #6668