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?

  • Why don't you force a page break with \newpage or \pagebreak? – Ayman Elmasry Feb 1 '12 at 14:19
  • 1
    You should add an MWE meta.tex.stackexchange.com/q/228/9241 – Ayman Elmasry Feb 1 '12 at 14:21
  • You don't want me to spam here with a 70-pages long table, believe me. – Alberto Santini Feb 2 '12 at 13:03
  • And to answer your first question: because Latex is not intended to work like this. – Alberto Santini Feb 2 '12 at 13:03
  • 1
    A MWE needn't be large, if \textheight is 4\baselineskip, and you have a row with three line p-entry, a 4 or 5 line table should be enough – David Carlisle Feb 2 '12 at 16:21

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.

  • 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 2 '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 2 '12 at 16:14

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.

  • 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 2 '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. – Yiannis Lazarides Feb 2 '12 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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