This question stems from Add text at an optional page-break only when breaking occurs and David Carlisle's excellent answer.

The question there was how to put text between tables when there is an (optional) page-break, e.g.

[ Table 1 ]
   Continued on next page
---- page break ----
   Continued from previous page
[ Table 2 ]

David's answer was to use a . The question I have here is if one has three or more tables, how can one insert custom text between each table when there is a page break between them. For example:

[ Table 1 ]
   The result of Table 1, XYZ, is carried over to the next page.
---- page break ----
   The result of Table 1 being: XYZ (for more details see the previous page)
[ Table 2 ]
   The conclusion of Table 2, XYZ, is used on the next page.
---- page break ----
   The conclusion of Table 2, being: XYZ, is calculated on the previous page.
[ Table 3 ]

The problem with the longtable is that the optional text must be identical between tables (i.e. one cannot customize it as between tables). Multiple longtable environments would overlap (i.e. a longtable for Table 1 + 2, and Table 2 + 3).

Is there a solution where one can have 'custom' optional text between tables that break across a page?

I would expect that a solution for tables could be extended to parboxes.

Thanks for reading.

  • 1
    As I commented on an answer on this site the other day, there isn't any great reason really for LT's headers to be fixed, it only really needs then to have fixed height (otherwise it's page breaking calculations would be upset) that and the syntax used by LT lending itself to setting the table head and saving it in a box rather than saving the commands in a macro to be reset. Perhaps.... – David Carlisle Mar 8 '12 at 20:10

Perhaps something like this, uses \label so takes a few iterations to stabilize, also this version doesn't react too kindly if there isn't space to fit the "continued on next page" bit under the table as it comes on the next page, then forces a page break. probably fixable but this will get you started




\expandafter\label\expandafter{\the\bt@count bt@count}%
\edef\@tempa{\csname r@\the\bt@count bt@count\endcsname}%
\edef\@tempb{\csname r@\the\bt@count bt@count\endcsname}%
\typeout{page break}%
\expandafter\label\expandafter{\the\bt@count bt@count}%



\breaktext{table one continues\ldots}{continued from before}


\breaktext{table two continues\ldots}{continued from before}


\breaktext{table three continues\ldots}{continued from before}


\breaktext{table four continues\ldots}{continued from before}



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.