I am using LaTeX for creating PDF files automatically from within Python scripts. The documents I create basically consist of just one big table, which can span several pages. It consists of three parboxed columns. Each item can contain a longer text. So far so good.

At this moment I am using longtable like so:


Problem is, that even a single cell may contain so much text that it does not fit on one page. Which means I need a page break within an item, not only between items.

Well, ideally the table would only be broken between the rows. However, when one item exceeds the space available on a page, a page break would have to occur in the middle of the table row.

It's not trivial, because any or all of the table columns could contain a large portion of text inside one row. So a page break could impact on one or many columns.

The longtable I am using now put page breaks only between rows. If one row contains too much text, it just runs down the page and some text will be outside the page boundary thus invisible. Does not look nice.

Any ideas?


  • 2
    It sounds like tabular is not the right way to do this. If you have page breaks inside table cells, what is the table doing for you? Better to structure your data differently.
    – Seamus
    Commented Jan 26, 2011 at 12:36
  • It seems not possible to break a page in one tabular line. However, I'm still interested in it, if there is any method using something other than tabular or longtable etc.
    – Leo Liu
    Commented Jan 26, 2011 at 13:13

2 Answers 2


The ConTeXt source. The image shows the first two pages

\setuppapersize [DE][DE]

\NC 1.\NC \input knuth\NC\NR\HL % a new tab line
\NC 2.\NC \input knuth\NC\NR\HL
\NC 3.\NC \input knuth\NC\NR\HL
\NC 4.\NC \input knuth\NC\NR\HL
\NC 5.\NC \input knuth\NC\NR\HL


enter image description here

  • That looks interesting. I played with it, and it works. However, I would like to have page breaks within a table row only if that row does not fit on one page. If e.g. my 2nd table row does not fit on page one, but it is not larger than a page itself, I would like the page break between row 1 and 2 (and not in the middle of row 2). So I'd like to keep the rows intact and on the same page, only except if the row is simply too big to go on one page. In that case it can start immediately after the first row and then page-break where (and as many times as) necessary.
    – svenor
    Commented Jan 26, 2011 at 14:09
  • 1
    then you have to put the complete cell contents into a box and then measure its height and then decide for a pagebreak or not.
    – user2478
    Commented Jan 26, 2011 at 14:12

A general solution is only possible with ConTeXt. With LaTeX you can only improve the situation.

  • You can set every column as a single document with a textwidth of the current columnwidth. At the end you can insert the longtable with pdfpages, it allows pages side by side. But this only works for two pages.
  • You can insert manual \newpage with a \parfillskip=0pt in the last line where you insert the page break, then this line will be stretched to the whole column width. The manual page break does not show in the output:

    Some really nonsense text for the first column,
    where now is a problem with the page break
    some more text \\
    foo & bar
    Some really nonsense text for the first column,
    where \parfillskip=0pt & % for manual page break
    some more text \\
    now is a problem with the page break\\
    foo & bar
  • Can you give a hint of the solution in ConTeXt? Maybe in a different answer, so that we can upvote it separately. Commented Jan 26, 2011 at 13:20
  • Well, I didn't want to do manual pagebreaks, as when I'm compiling the TeX sources I don't know where manual page breaks are necessary or not.
    – svenor
    Commented Jan 26, 2011 at 13:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .