Hans,
Thanks very much. That works perfectly.
Nigel


From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Nigel King <nigel@nigelking.me.uk>
Sent: Monday, 6 December, 2010 13:13:39
Subject: Re: [NTG-context] bug in TABLE when there is a complex head

On 6-12-2010 9:39, Nigel King wrote:
> Hi Developers,
> Enclosed is a piece of code that demonstrates a bug in the NaturalTable environment when using a complex head in a multipage case. If you run the following code you will notice that not only does the head get repeated but also the first row of the body of the table. The cause appears to be [nr=2] in the head.
>
> I am using
> This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009) (format=cont-en 2010.4.14)  6 DEC 2010 08:32
> I do apologise if this is fixed in a later version. Thanks for a great program.
>
> \bTABLE[split=repeat]
> \bTABLEhead
> \bTR
>    \bTH[nr=2] head l\eTH
>    \bTH head r\eTH
> \eTR
> \bTR
>    \bTH head r\eTH
> \eTR
> \eTABLEhead
> \bTABLEbody
> \bTR\bTD first l\eTD\bTD first r\eTD\eTR
> \dorecurse{50}{\bTR\bTD subsequent l\eTD\bTD subsequent r\eTD\eTR}
> \eTABLEbody
> \eTABLE

put this in cont-new.tex:

\unprotect

\def\endtblrow
  {\kern\dimexpr\tbltblrightmargindistance-\tbltblcolumndistance\relax
  \crcr
  \noalign
    {\nointerlineskip
      \ifnum\tblrow>\noftblheadlines
        \ifnum\gettblnob\tblrow=\zerocount
          \allowbreak
        \fi
      \else
        \allowbreak % else no proper head split off
      \fi
      \bgroup % protect local vars
        \@@tblsplitafter
      \egroup
      \bgroup % protect local vars
        \scratchcounter\numexpr\tblrow+\plusone\relax
        \ifnum\scratchcounter>\noftblhdnxlines\relax
          \ifnum\scratchcounter<\maximumrow\relax

\doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
          \fi
        \fi
      \egroup}}

\protect

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                            | www.pragma-pod.nl
-----------------------------------------------------------------