5

With the longtable package one can create a table that spans over multiple pages. The problem is that it will never break a row in two: either it stays entirely in the current page or it is moved completely onto the next one.

But if your rows occupy on average 75% of the eight of a page, this means having one row per page, which is ugly. I would like single rows to be broken and split over multiple pages. How to do this?

As a bonus, I would also like to be able to use tabularx functionalities... is it asking too much?

Werner
  • 603,163

2 Answers2

5

For your bonus question, there are a couple of packages that combine TX and LT, I wrote one called ltxtable but there may be better ones by now.

As for big rows you don't say why they are big, if it is a big graphic then you are stumped. If it is a big paragraph, just put the first half of the paragraph in one row and then (after seeing where TeX breaks a line anyway) put the second half of the paragraph in the next row.

David Carlisle
  • 757,742
  • Yes, I've been using ltablex in this project now. You are right: the cell contents is text, so something that can be (quite) easily broken into different pages. Regarding your suggestion, again, this (caring about the position of things in one particular compiled file) is exactly what Latex users shouldn't do, isn't it?! – Alberto Santini Feb 02 '12 at 13:07
  • In an ideal world latex would always do the right thing and break tables and math automatically, but it doesn't attempt to do either so you have to break equations manually, and same for table rows. breqn automatically breaks math, at the price of implementing much of TeX math layout _in TeX. Doing the same for tables would be a big job. – David Carlisle Feb 02 '12 at 16:14
3

The obvious answer is to introduce a manual break, as what you are thinking is an optimum point differs from TeX's in-built strategies for page optimization.

Another way is to rethink the use of a table, a different structure (perhaps a list) or a strategy as employed in https://tex.stackexchange.com/a/42904/963 might be preferable. It all depends on the data that you have in the table.

yannisl
  • 117,160
  • This contrasts one of the purposes of Latex.. not to have to care about where pages end. What if at some point I want to add or remove more text to a row? Shall I adjust all the subsequent ones?! Also, the physical page height might change according to the paper format and even the medium (compiling to PDF vs compiling to HTML, etc.) – Alberto Santini Feb 02 '12 at 13:04
  • 1
    @AlbertoSantini It does if you introduce manual page breaks. However, a row of a table is something you normally want to keep together. My suggestion is a rethink of the structure of what you are doing, if you post a row example we maybe able to come up with something more useful. – yannisl Feb 02 '12 at 13:10