ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Newbie wants to make long tables
Date: Wed, 17 Sep 2003 00:05:36 +0200	[thread overview]
Message-ID: <5.2.0.9.1.20030917000128.01afc148@server-1> (raw)
In-Reply-To: <BB8BFEB7.15975%king@dircon.co.uk>

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
-------------------------------------------------------------------------

  reply	other threads:[~2003-09-16 22:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-20  6:44 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 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-08-18 12:23 Thomas Schrader
2003-08-19 15:49 ` Tobias Burnus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.2.0.9.1.20030917000128.01afc148@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).