# Is it possible to limit the number of pages a long table uses?

I have a table that is longer than one page but only by like half a page, and so am using longtable to break it into 2 pages. However, the problem that I'm running into is that based on where it is in the document, latex wants to start the table at the end of a page, have 2-3 rows on that page, fill the next full page, and then put 3-4 lines on a third page.

Is there a way to either require N lines to be on any page for longtable, or to limit the number of pages it can fill for a particular table?

• Thanks for the suggestions, I used Mico's suggestion of afterpage and it works great! – brady Feb 27 '15 at 16:40

You can include the first 10 (or 12 or whatever) lines of the table before the \endfirsthead (or before the \endlastfoot) commands and then they will stick together.
Or you can use \\* rather than \\ at the ends of the rows to discourage linebreaking.
Or (perhaps) you could use the needspace package and issue \clearpage if you are already near the bottom of the page.
Still another suggestion: Load the afterpage package and encase the longtable environment in an \afterpage{\begin{longtable}...\end{longtable} directive. This will ensure that the table always starts at the top of a page, thereby maximizing the likelihood that the longtable will fit on two (physical) pages.