10

I have a table where the data is in groups of 5 rows, so I'd like my longtable to have page breaks only between these five row groupings. Because there is text on the first page (prior to the table), the first page of the table may have fewer rows than the others. Is there an easy way to insert page breaks in the appropriate places in the table, or do I need to resort to manual placement?

10

In the longtable documentation, around p.10, there are

  • a \\* command that disallows page breaking after the current row
  • a \nopagebreak command for the start of a new row that disallows page breaking
  • a \nopagebreak[N] command, where N is 0, 1, 2, 3, or 4, that indicates the relative undesirability of a page break on the row

Simple example: enter image description here

\documentclass[12pt]{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{rc}
1 & a \\*
2 & b \\*
3 & c \\*
4 & d \\*
5 & e \\
6 & f \\*
7 & g \\*
8 & h \\*
9 & i \\*
10 & j \\
11 & k \\*
12 & l \\*
13 & m \\*
14 & n \\*
15 & o \\
16 & p \\*
17 & q \\*
18 & r \\*
19 & s \\*
20 & t \\
21 & u \\*
22 & v \\*
23 & w \\*
24 & x \\*
25 & y \\
26 & z \\*
27 & $\alpha$ \\*
28 & $\beta$ \\*
29 & $\gamma$ \\*
30 & $\delta$ \\
41 & $\ldots$ \\*
42 & $\ldots$ \\*
43 & $\ldots$ \\*
44 & $\ldots$ \\*
45 & $\ldots$ \\
46 & $\ldots$ \\*
47 & $\ldots$ \\*
48 & $\ldots$ \\*
49 & $\ldots$ \\*
50 & $\ldots$ \\
\end{longtable}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.