0

I have seen, from experiment provoked by another question here, that it is possible to use longtable inside a tcolorbox... but you lose most of the benefits of longtable (and I want to use a longtabulary based on a comment David made years ago anyway).

As I understand it, tcolorbox works by examining the content of the box, then decides if it can fit everything in a single page (with the box around it), otherwise it outputs what it can on the first page and then goes into a loop of "if the rest fits, do last part, else put what I can as a middle part and repeat with remainder". Longtable, on the other hand, interacts with the page breaking code (i.e. doesn't just allow the table to break, but actually changes how the page breaking works)... this is part of why it does not work with multiple columns (twocolumn document option or multicols environment).

Is there a way to integrate these two great packages to get the best features of both?

Am I naive in thinking it might be as simple as "render the entire table, including the various headers and footers, then split up to fit the space available in each section, applying the appropriate bits at each section"?

Keith Davies
  • 745
  • 4
  • 16
  • Longtable does a lot more than just create a breakable \vbox, and presumably you want to retain those features. If you calculate the actual space available inside tcolorbox, you can create a special document contining only the longtable. See https://tex.stackexchange.com/questions/469547/wrap-text-beside-longtable/469725?r=SearchResults&s=3|21.9790#469725 for details. – John Kormylo Jun 27 '20 at 15:09
  • I do want those other features, but described poorly how I expected they would be retained. It looks like this approach would work if the \longtable aligned to the page boundaries, but if I'm not mistaken starting the table partway down the page will not give the results I want because each page of the embedded PDF is the same size. It'll almost certainly force a new page where I don't want it, or will overfill the current page. – Keith Davies Jun 27 '20 at 18:26
  • You can still do it with unaligned pages, but it involves adding space on the first page and cropping the first and last pages with \includegraphics. – John Kormylo Jun 28 '20 at 14:02

0 Answers0