Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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