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?

6
  • Why don't you force a page break with \newpage or \pagebreak? Feb 1, 2012 at 14:19
  • 1
    You should add an MWE meta.tex.stackexchange.com/q/228/9241 Feb 1, 2012 at 14:21
  • You don't want me to spam here with a 70-pages long table, believe me. Feb 2, 2012 at 13:03
  • And to answer your first question: because Latex is not intended to work like this. Feb 2, 2012 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 Feb 2, 2012 at 16:21

2 Answers 2

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.

2
  • 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?! Feb 2, 2012 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. Feb 2, 2012 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.

2
  • 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.) Feb 2, 2012 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. Feb 2, 2012 at 13:10

You must log in to answer this question.

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