Skip to content
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

Merged
merged 2 commits into from Sep 6, 2019

Conversation

@jfbu jfbu added this to the 2.3.0 milestone Sep 1, 2019
@codecov
Copy link

codecov bot commented Sep 1, 2019

Codecov Report

Merging #6681 into 2.0 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcba6b6...d51142b. Read the comment docs.

@@ -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
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@jfbu jfbu merged commit e944a55 into sphinx-doc:2.0 Sep 6, 2019
@jfbu jfbu deleted the latex_6668 branch September 6, 2019 08:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant