Keep extreme tables on the same page as previous content
Hi, when you use extreme tables without a float environment but repeat the header the table always starts on a new page. %%%% begin example \starttext \samplefile{weisman} \blank \startxtable[header=repeat,split=repeat] \startxtablehead \startxrow \startxcell Table head \stopxcell \stopxrow \stopxtablehead \startxtablebody \dorecurse{100}{\startxrow \startxcell Table body \stopxcell \stopxrow} \stopxtablebody \stopxtable \stoptext %%%% end example The reason for this is the height set for the part of each page, on the first page ConTeXt uses a box with the height of \pagegoal forces a page break because the content doesn't fit. \setvalue{\??xtableflushsplit\v!repeat}% {\doloop {\clf_x_table_flush method {\v!split}% height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi \relax \ifcase\c_tabl_x_state \exitloop \else \page \fi}} While determining the available space is easy we need a method to ensure the table stays on the page when the user adds a vertical skip (e.g. \blank[...]) before the table because this can lead to another page break. Wolfgang
On 04/04/20 02:42, Wolfgang Schuster wrote:
Hi,
when you use extreme tables without a float environment but repeat the header the table always starts on a new page.
%%%% begin example \starttext
\samplefile{weisman}
\blank
\startxtable[header=repeat,split=repeat] \startxtablehead \startxrow \startxcell Table head \stopxcell \stopxrow \stopxtablehead \startxtablebody \dorecurse{100}{\startxrow \startxcell Table body \stopxcell \stopxrow} \stopxtablebody \stopxtable
\stoptext %%%% end example
I use \starttext \startxtable [split=repeat,header=repeat,footer=repeat] \startbuffer [header] ... \stopbuffer \startxtablehead \getbuffer [header] \stopxtablehead \startxtablenext \getbuffer [header] \stopxtablenext \startxtablebody ... \stopxtablebody \startxtablefoot ... \stopxtablefoot \stopxtable \stoptext without a float environment, and I do NOT get a spurious page break, so I do not understand what is happening in your sample above. Is it the \break (as you suggest)? In your example above, why not simply use a float environment: \startplacetable [location=force,number=no] \startxtable ... \stopxtable \stopplacetable Supplementary question. How might I produce/impose a page break at a certain point in a long table? Say that I may want to provoke a break before a certain \startxrow...\stopxrow Thanks -- Alan
On 4/4/20 6:44 PM, Alan Braslau wrote:
On 04/04/20 02:42, Wolfgang Schuster wrote:
Hi,
when you use extreme tables without a float environment but repeat the header the table always starts on a new page.
%%%% begin example \starttext
\samplefile{weisman}
\blank
\startxtable[header=repeat,split=repeat] \startxtablehead \startxrow \startxcell Table head \stopxcell \stopxrow \stopxtablehead [...]
I use
\starttext \startxtable [split=repeat,header=repeat,footer=repeat] \startbuffer [header] ... \stopbuffer [...] without a float environment, and I do NOT get a spurious page break, so I do not understand what is happening in your sample above. Is it the \break (as you suggest)?
Alan, I’m afraid that the spurious pagebreak comes when you have text before the xtable and the xtable has to be split in pages. Pablo -- http://www.ousia.tk
On 04/04/20 10:55, Pablo Rodriguez wrote:
I’m afraid that the spurious pagebreak comes when you have text before the xtable and the xtable has to be split in pages.
So, when one has text before, why NOT use \startplacetable...\stopplacetable? There are many advantages of using the table float environment, not the least of which is listing. -- Alan
On 4/4/20 7:29 PM, Alan Braslau wrote:
On 04/04/20 10:55, Pablo Rodriguez wrote:
I’m afraid that the spurious pagebreak comes when you have text before the xtable and the xtable has to be split in pages.
So, when one has text before, why NOT use \startplacetable...\stopplacetable? There are many advantages of using the table float environment, not the least of which is listing.
https://mailman.ntg.nl/pipermail/ntg-context/2020/097475.html contains a sample that doesn’t work with that pair of commands. I mean adding "split, repeat" to \startplacetable[]" moves the table to the second page and doesn’t split it.. If you have a fix for that sample, please reply to that thread. Pablo -- http://www.ousia.tk
participants (3)
-
Alan Braslau
-
Pablo Rodriguez
-
Wolfgang Schuster