For the book I am typesetting now I need a table environment with the following abilities:
- Span over multiple pages;
- Allow
\nopagebreak
between two lines - Do not ignore
\nopagebreak
before the beginning of the environment
Points 1 and 2 can be achieved with longtable
environment; but recently I bumped into the situation when the code:
\section{Some section}
\begin{longtable}{...}
...
leaves the section header on one page and starts to typeset longtable
on the next page. \nopagebreak
between \section
and \begin
does not help. I found the bug filed on longtable about 9 years ago, but it seems that no-one is interested, and I do not know TeX well enough to fix it myself.
I tried supertabular
package — it has the same problem, and stabular
which has points 1 and 3, but does not have point 2. Is there some way to make longtable
listen to \nopagebreak
? Or maybe there is some other package that supports all three points? Or will it be easier to just stack \hbox
s and \vbox
s in a desired way?
\\*
longtable macro (which prevents line break inside the table). A bit ugly, but works.\section
with\pagebreak
. I tried several things here, but even with an increased penalty and a modified longtable (La)TeX would break at that position.