A longtable does not issue \@nobreakfalse resulting in inconsistent spacing #173

Open
opened this issue Aug 25, 2019 · 2 comments

Brief outline of the bug

As longtable does not modify the \if@nobreak flag, the spacing after it and before next section title varies according to whether some contents before it provoked or not \@nobreakfalse.

Minimal example showing the bug

\RequirePackage{latexbug}

\documentclass{article}

\usepackage{longtable}

\def\TESTTABLE{%
\begin{longtable}[c]{|l|l|l|}

\endfoot

\endlastfoot

a
&
b
&
c
\\
\hline
1
&
2
&
3
\\
\hline
\end{longtable}
}

\def\SOMERULE{\smash{\rule{2pt}{40pt}}}
\begin{document}

\section{FOO1}

\TESTTABLE

\section{FOO2 is closer to \SOMERULE longtable than FOO3 will be}

AAA

\TESTTABLE

\section{FOO3 more distant \SOMERULE from long table than FOO2}

AAA

\end{document}

Log file (required) and possibly PDF file

referenced this issue Aug 25, 2019
Author

jfbu commented Aug 25, 2019 • edited

 This means mismatch between doing a longtable or doing a tabular in paragraph mode (with \centering). The different vertical spacing in output between the two cases is unexpected. (specific problem arose in context using titlesec but mwe here is core LaTeX only) edit: actually original problem originates in a context where some wrapper macros try hard to get same vertical spacing both with longtable and tabular table (or tabulary), hence when I say "unexpected", I mean "unexpected in this customized original context".
added the label Aug 26, 2019
referenced this issue Sep 1, 2019
Author

jfbu commented Sep 2, 2019

 A variant of this issue applies in case of positive \parindent (which is default in LaTeX, but was not in original context where the issue arose, due to usage of parskip package). The two situations: title then tabular then text paragraph, title then longtable then text paragraph, give diverging results. Former case has indentation, latter case has no paragraph indentation.