[Tex/LaTex] Big tables with big items: pagebreaks within items

page-breakingtables

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:

\begin{longtable}{@{}p{\inoutwidth}@{\hspace{\columnsepx}}p{.35\commentwidth}@{\hspace{\columnsepx}}p{.65\commentwidth}@{}}

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?

Cheers!

Best Answer

The ConTeXt source. The image shows the first two pages

\definepapersize[DE][width=11cm,height=15cm]
\setuppapersize [DE][DE]
\setuplayout[width=10cm,height=12cm]
%\setuptabulate[split=no]

\starttext
\starttabulate[|c|p(5cm)|]
\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
\stoptabulate

\stoptext

enter image description here

Related Question