with the attached minimal .tex example longtable produces a pagebreak just for the head line and for the caption. see .pdf file for the result.
is it possible to tell longtable to place at least 3 rows to each page? if yes, how?
if there is a other or better package than longtable, please let me know.
greetings
stefan
Document Classes ⇒ longtable with strange page break just for head line
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
longtable with strange page break just for head line
Hi Stefan,
perhaps the needspace package could be useful for you, for example:
For the documentation look inside needspace.sty.
Stefan
perhaps the needspace package could be useful for you, for example:
Code: Select all
\usepackage{needspace}
...
\needspace{8\baselineskip}
\begin{longtable}[h]{|c|c|}
...
Stefan
LaTeX.org admin
longtable with strange page break just for head line
Hi Stefan,
thanks for your answer. Unfortunately needspace does not help.
But I have found a solution with modifying longtable.sty. I must admit that I do not know exactly what I am doing.
But the results look much better for me.
Greetings
Stefan
Addition:
Ok, I found one other mistake in my example. Longtable places the caption like a simple row. So the caption has to be defined in \endfoot or \lastendfoot section. But this does not solve the problem. It seems, longtable does not take the size of lastendfoot into account while calculating the pagebreak.
thanks for your answer. Unfortunately needspace does not help.
But I have found a solution with modifying longtable.sty. I must admit that I do not know exactly what I am doing.

- \ifvoid\LT@foot\else
\advance\vsize-3\ht\LT@foot
\global\advance\@colroom-3\ht\LT@foot
\dimen@\pagegoal\advance\dimen@-3\ht\LT@foot\pagegoal\dimen@
\maxdepth\z@
\fi
Greetings
Stefan
Addition:
Ok, I found one other mistake in my example. Longtable places the caption like a simple row. So the caption has to be defined in \endfoot or \lastendfoot section. But this does not solve the problem. It seems, longtable does not take the size of lastendfoot into account while calculating the pagebreak.