ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Newbie wants to make long tables
@ 2003-08-20  6:44 Thomas Schrader
  2003-08-21 21:29 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schrader @ 2003-08-20  6:44 UTC (permalink / raw)


Hi everybody,

I'm wondering how to break up long tables over several pages, 
automatically placing continuing headers and footers.

Thanks much for any help

Thomas

-- 

mailto laborator at web de

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-08-20  6:44 Newbie wants to make long tables Thomas Schrader
@ 2003-08-21 21:29 ` Hans Hagen
  2003-09-12  7:36   ` Nigel King
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2003-08-21 21:29 UTC (permalink / raw)


At 08:44 20/08/2003 +0200, you wrote:
>Hi everybody,
>
>I'm wondering how to break up long tables over several pages, 
>automatically placing continuing headers and footers.
>
>Thanks much for any help

this is supported in tabulate (by default), and can be turned on in the 
bTABLE mechanism (\setupTABLE[split=yes]) while (less robust) it's also 
available in \starttable by means of \starttables cum suis.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-08-21 21:29 ` Hans Hagen
@ 2003-09-12  7:36   ` Nigel King
  2003-09-13 20:54     ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Nigel King @ 2003-09-12  7:36 UTC (permalink / raw)


Hans,
I have been looking at core-ntb (dangerous bend for me) and I found
[b|e]TABLEhead, [b|e]TABLEbody and [b|e]TABLEfoot. I then put 2 + 2 together
and made 5. It doesn't work as I expected. Are Table heads and foots
available? TABLEbody gives no output and TABLEhead and TABLEfoot just place
themselves at the end of table (head first, foot next) rather than at the
beginning and end of each column. One version of my test code is below;

\bTABLEhead
\bTR \bTH Head 1 \eTH \bTH Head 2 \eTH \eTR
\eTABLEhead
\bTABLEfoot
\bTR \bTH Foot 1 \eTH \bTH Foot 2 \eTH \eTR
\eTABLEfoot
\bTABLE[split=yes]
\dorecurse{40}{\bTR \bTD left \eTD\bTD right \eTD \eTR}
\eTABLE

I have been looking forward to this feature for some time. If you work on
it, it would be nice to have the middle table breaks to have their own heads
and foots such that one can put 'continued' etc. into the table.

TIA
-- 
Nigel

> From: Hans Hagen <pragma@wxs.nl>
> At 08:44 20/08/2003 +0200, you wrote:
>> Hi everybody,
>> 
>> I'm wondering how to break up long tables over several pages,
>> automatically placing continuing headers and footers.
>> 
>> Thanks much for any help
> 
> this is supported in tabulate (by default), and can be turned on in the
> bTABLE mechanism (\setupTABLE[split=yes]) while (less robust) it's also
> available in \starttable by means of \starttables cum suis.
> 
> Hans

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-12  7:36   ` Nigel King
@ 2003-09-13 20:54     ` Hans Hagen
  2003-09-14 16:05       ` Nigel King
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2003-09-13 20:54 UTC (permalink / raw)


At 08:36 12/09/2003 +0100, you wrote:
>Hans,
>I have been looking at core-ntb (dangerous bend for me) and I found
>[b|e]TABLEhead, [b|e]TABLEbody and [b|e]TABLEfoot. I then put 2 + 2 together
>and made 5. It doesn't work as I expected. Are Table heads and foots
>available? TABLEbody gives no output and TABLEhead and TABLEfoot just place
>themselves at the end of table (head first, foot next) rather than at the
>beginning and end of each column. One version of my test code is below;
>
>\bTABLEhead
>\bTR \bTH Head 1 \eTH \bTH Head 2 \eTH \eTR
>\eTABLEhead
>\bTABLEfoot
>\bTR \bTH Foot 1 \eTH \bTH Foot 2 \eTH \eTR
>\eTABLEfoot
>\bTABLE[split=yes]
>\dorecurse{40}{\bTR \bTD left \eTD\bTD right \eTD \eTR}
>\eTABLE
>
>I have been looking forward to this feature for some time. If you work on
>it, it would be nice to have the middle table breaks to have their own heads
>and foots such that one can put 'continued' etc. into the table.

the following will repeat the head,

\bTABLE[split=repeat]
\bTABLEhead
\bTR \bTH Head 1 \eTH \bTH Head 2 \eTH \eTR
\eTABLEhead
\bTABLEfoot
\bTR \bTH Foot 1 \eTH \bTH Foot 2 \eTH \eTR
\eTABLEfoot
\bTABLEbody
\dorecurse{40}{\bTR \bTD left \eTD\bTD right \eTD \eTR}
\eTABLEbody
\eTABLE

since foots often contain sums or so, they are not repeated,

we could consider something

\bMIDDLE
\eMIDDLE

but it would require some close re-reading of the source code since the 
available size calculation is tricky (unless we limit sucn a middle to a 
one liner

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-13 20:54     ` Hans Hagen
@ 2003-09-14 16:05       ` Nigel King
  2003-09-14 22:43         ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Nigel King @ 2003-09-14 16:05 UTC (permalink / raw)


Hans,
Thank you very much for this it is excellent-I have a further question.

I have been trying to encourage page breaking on some lines rather than
others. Consider the following

\bTABLE[split=repeat]
\bTABLEhead
\bTR \bTH Head 1 \eTH \bTH Head 2 \eTH \eTR
\eTABLEhead
\bTABLEfoot
\bTR \bTH Foot 1 \eTH \bTH Foot 2 \eTH \eTR
\eTABLEfoot
\bTABLEbody
\dorecurse{40}{\bTR \bTD[nr=3] left \eTD\bTD right \eTD
\eTR\dorecurse{2}{\bTR\bTD right \eTD \eTR}}
\eTABLEbody
\eTABLE

Which is something like below

Left  right
      right
      right  <I want to encourage page breaking after here
Left  right
      right
      right


I have been trying to find a way to encourage page breaking at appropriate
points but have not found the way.

TIA
--
Nigel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-14 16:05       ` Nigel King
@ 2003-09-14 22:43         ` Hans Hagen
  2003-09-15 17:32           ` Willi Egger
  2003-09-15 22:41           ` Nigel King
  0 siblings, 2 replies; 12+ messages in thread
From: Hans Hagen @ 2003-09-14 22:43 UTC (permalink / raw)


At 17:05 14/09/2003 +0100, you wrote:
>Hans,
>Thank you very much for this it is excellent-I have a further question.
>
>I have been trying to encourage page breaking on some lines rather than
>others. Consider the following
>
>\bTABLE[split=repeat]
>\bTABLEhead
>\bTR \bTH Head 1 \eTH \bTH Head 2 \eTH \eTR
>\eTABLEhead
>\bTABLEfoot
>\bTR \bTH Foot 1 \eTH \bTH Foot 2 \eTH \eTR
>\eTABLEfoot
>\bTABLEbody
>\dorecurse{40}{\bTR \bTD[nr=3] left \eTD\bTD right \eTD
>\eTR\dorecurse{2}{\bTR\bTD right \eTD \eTR}}
>\eTABLEbody
>\eTABLE
>
>Which is something like below
>
>Left  right
>       right
>       right  <I want to encourage page breaking after here
>Left  right
>       right
>       right
>
>
>I have been trying to find a way to encourage page breaking at appropriate
>points but have not found the way.

\bTABLE[split=yes]
\bTR \bTD left \eTD\bTD right \eTD\eTR
\bTR[after=\pagina] \bTD left \eTD\bTD right \eTD\eTR
\bTR \bTD left \eTD\bTD right \eTD\eTR
\bTR \bTD left \eTD\bTD right \eTD\eTR
\bTR \bTD left \eTD\bTD right \eTD\eTR
\bTR \bTD left \eTD\bTD right \eTD\eTR
\eTABLE

i'll send you the adapted core-ntb in another mail

Hans


-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-14 22:43         ` Hans Hagen
@ 2003-09-15 17:32           ` Willi Egger
  2003-09-15 18:52             ` Hans Hagen
  2003-09-15 22:41           ` Nigel King
  1 sibling, 1 reply; 12+ messages in thread
From: Willi Egger @ 2003-09-15 17:32 UTC (permalink / raw)



> >Which is something like below
> >
> >Left  right
> >       right
> >       right  <I want to encourage page breaking after here
> >Left  right
> >       right
> >       right
> >
> >
> >I have been trying to find a way to encourage page breaking at
appropriate
> >points but have not found the way.
>
> \bTABLE[split=yes]
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR[after=\pagina] \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \eTABLE
>
> i'll send you the adapted core-ntb in another mail

When will this be included in the distribution?

Willi

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-15 17:32           ` Willi Egger
@ 2003-09-15 18:52             ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2003-09-15 18:52 UTC (permalink / raw)


At 19:32 15/09/2003 +0200, you wrote:

>When will this be included in the distribution?

some day soon

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-14 22:43         ` Hans Hagen
  2003-09-15 17:32           ` Willi Egger
@ 2003-09-15 22:41           ` Nigel King
  2003-09-16 22:05             ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: Nigel King @ 2003-09-15 22:41 UTC (permalink / raw)


Hans,
Thank you again for your speedy response.
> \bTABLE[split=yes]
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR[after=\pagina] \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \bTR \bTD left \eTD\bTD right \eTD\eTR
> \eTABLE
> 
> i'll send you the adapted core-ntb in another mail
Thanks received and installed
> 
> Hans
\pagina seems to be synonymous with \page at least \page appears to have the
same effect. I was hoping for [after={\page[bigpreference]}] but that does
not appear to work. [after={\page[yes]}] does the same as \page. It seems to
be just that the preference does not do anything.

I was also hoping for [split=repeat] but that stops [after=\pagina] from
doing anything.

Thanks again
-- 
Nigel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-09-15 22:41           ` Nigel King
@ 2003-09-16 22:05             ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2003-09-16 22:05 UTC (permalink / raw)


At 23:41 15/09/2003 +0100, you wrote:
>Hans,
>Thank you again for your speedy response.
> > \bTABLE[split=yes]
> > \bTR \bTD left \eTD\bTD right \eTD\eTR
> > \bTR[after=\pagina] \bTD left \eTD\bTD right \eTD\eTR
> > \bTR \bTD left \eTD\bTD right \eTD\eTR
> > \bTR \bTD left \eTD\bTD right \eTD\eTR
> > \bTR \bTD left \eTD\bTD right \eTD\eTR
> > \bTR \bTD left \eTD\bTD right \eTD\eTR
> > \eTABLE
> >
> > i'll send you the adapted core-ntb in another mail
>Thanks received and installed
> >
> > Hans
>\pagina seems to be synonymous with \page at least \page appears to have the
>same effect. I was hoping for [after={\page[bigpreference]}] but that does
>not appear to work. [after={\page[yes]}] does the same as \page. It seems to
>be just that the preference does not do anything.
>
>I was also hoping for [split=repeat] but that stops [after=\pagina] from
>doing anything.

the next solution is quite ugly but seems to work; i wonder what happens in 
boundary cases

\def\splittblbox#1% #1 <> 0/2
   {\ifinsidefloat
      \unvbox#1%
    \else
      % spacing between rows gets lost in split
      \setbox4\vbox
        {\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}}%
      \setbox2\vbox
        {}%
      \dorecurse\noftblheadlines
        {\setbox0\vsplit#1 to \lineheight
         \setbox2\vbox{\unvcopy2\unvcopy0}}%
      \ifcase\noftblheadlines\else\unvcopy2\fi
      \donefalse
      \doloop
        {\setbox0\vsplit#1 to \lineheight
         \ifdim\pagegoal<\maxdimen
           \setbox0\vbox{\unvbox0}%
           \dimen0\ht0
           \advance\dimen0\ht4
           \advance\dimen0\pagetotal
           \ifdim\dimen0>\pagegoal
             \bgroup \pagina \egroup % make sure that local vars are kept
             \ifcase\noftblheadlines\else\unvcopy2\fi
           \fi
         \fi
         \ifdone
           \doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}%
         \fi
         \unvbox0
         % old solution: \allowbreak
         % start of forced break handling for Nigel King
         \bgroup
         \scratchcounter\recurselevel
         \advance\scratchcounter\noftblheadlines
         \setupTBLcell{\number\scratchcounter}1
         \ifx\@@tblsplitafter\relax\else
           \scratchcounter\realpageno
           \@@tblsplitafter
           \ifnum\scratchcounter<\realpageno
             \ifcase\noftblheadlines\else\unvcopy2\fi
           \fi
         \else
           \allowbreak
         \fi
         \egroup
         % so far for the repeated head after forced break
         \ifvoid#1 \exitloop \else \donetrue \fi}%
    \fi}

works ok for :

% \bTABLE[split=repeat]
%   \bTABLEhead
%     \bTR \bTH lxxxeft \eTH\bTD right \eTD\eTR
%   \eTABLEhead
%   \bTABLEbody
%     \dorecurse{100}{\bTR[after={\pagina[bigpreference]}] \bTD left 
\eTD\bTD right \eTD\eTR}
%     \dorecurse{100}{\bTR\bTD left \eTD\bTD right \eTD\eTR}
%   \eTABLEbody
% \eTABLE

As said, an ugly, not so wel tested, patch

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Newbie wants to make long tables
  2003-08-18 12:23 Thomas Schrader
@ 2003-08-19 15:49 ` Tobias Burnus
  0 siblings, 0 replies; 12+ messages in thread
From: Tobias Burnus @ 2003-08-19 15:49 UTC (permalink / raw)


Hi,

On Mon, 18 Aug 2003, Thomas Schrader wrote:
> I'm wondering how to break up long tables over several pages,
> automatically placing continuing headers and footers.

How about

\starttablehead
\NC a \NC b \NC\SR
\stoptablehead

\starttabletail
\NC A \NC B \NC\SR
\stoptabletail

\starttables[|l|l|]
\NC 1 \NC 11 \NC\SR
\stoptables


Tobias

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Newbie wants to make long tables
@ 2003-08-18 12:23 Thomas Schrader
  2003-08-19 15:49 ` Tobias Burnus
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schrader @ 2003-08-18 12:23 UTC (permalink / raw)


Hi everybody,

I'm wondering how to break up long tables over several pages, 
automatically placing continuing headers and footers.

Thanks much for any help

Thomas Schrader

--

mailto laborator at web de

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-09-16 22:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20  6:44 Newbie wants to make long tables Thomas Schrader
2003-08-21 21:29 ` Hans Hagen
2003-09-12  7:36   ` Nigel King
2003-09-13 20:54     ` Hans Hagen
2003-09-14 16:05       ` Nigel King
2003-09-14 22:43         ` Hans Hagen
2003-09-15 17:32           ` Willi Egger
2003-09-15 18:52             ` Hans Hagen
2003-09-15 22:41           ` Nigel King
2003-09-16 22:05             ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2003-08-18 12:23 Thomas Schrader
2003-08-19 15:49 ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).