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.

Making a complicated table is a pain in LaTeX. I am using a longtable in my TeX and need to change the maximum number of rows in a page. Is there any way to set the maximum number of rows in a page?

share|improve this question
2  
The number of rows in your table will depend on your paper size, font size and other things such as text or headings on that page. If you need to get more rows, try to enlage the page with \enlargethispage{<length>} (e.g. 2\baselineskip) or (not recommended) use the geometry package to change your page layout for the longtable pages. This will make your document slightly inconsistent, but might be alight in an appendix or so. –  Martin H Jun 2 '11 at 16:43

1 Answer 1

It is true that the number of rows in your table depend on various parameters, such as the height of the page and of each row. However, you can always force a pace break at a given line by using \newpage or \pagebreak. You will have to add a \newpage command for each page you want to make by hand, which is OK if your table is not too long.

Alternatively, you can also make TeX insert a \newpage for you every n-th lines, add the following lines before your table:

\newcount\mylineno
\mylineno=0
\def\mynewline{%
  \global\advance\mylineno by 1
  \ifnum\mylineno=20
    \global\mylineno=0
    \\
    \newpage
  \else
    \\
  \fi
}

and replace every \\ in the table lines with a \mynewline. Replace the number 20 above with the number of lines you want in your table.

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.