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

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

Open
jfbu opened this issue Aug 25, 2019 · 2 comments

Comments

@jfbu
Copy link

commented Aug 25, 2019

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|}
\caption{Long table before header\strut}

\endfirsthead

\endhead

\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

buglongtable.log
buglongtable.pdf

@jfbu

This comment has been minimized.

Copy link
Author

commented Aug 25, 2019

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

@jfbu

This comment has been minimized.

Copy link
Author

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:

  1. title then tabular then text paragraph,

  2. title then longtable then text paragraph,

give diverging results. Former case has indentation, latter case has no paragraph indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.