ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: Geert Dobbels <dobbels.geert@googlemail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: splitted xtable with repeating headers and placetable
Date: Sun, 5 Apr 2020 11:02:48 +0200	[thread overview]
Message-ID: <b59894ae-2b46-eb3b-ed68-391a9d4b995b@gmail.com> (raw)
In-Reply-To: <fd134e0d-295c-0140-97c6-b198951dfbf4@gmail.com>

Geert Dobbels schrieb am 05.04.2020 um 00:30:
> Wolfgang,
> 
> Below is what I think is the bare minimum to explain this question 
> (sorry for not doing it right from the beginning...)

Keep it up.

> As I said, with the code as it is below, the header is not repeated 
> after the first page, but the table is in the right place.
> 
> Replacing "split=yes" by "split=repeat" makes the header repeat 
> correctly but puts the beginning of the table on the next page, leaving 
> the first page nearly completely blank.

I already reported the problem on the dev-list. The reason is that
ConTeXt creates one big table and splits it afterwards in smaller
parts which fit on each page but when you use "split=repeat" the
part for the first page is too large to fit.

> In both cases, the "header=repeat" setting has no influence at all on 
> the behaviour and can be omitted without changing the results.
> 
> As I read in some other posts, sometimes putting the table in a float 
> can help, so I tried this (by removing the 3 "%" in the code below), but 
> there seems to be a conflict with the figure in the page header, and it 
> stops with an error message.

Don't use floats in the header or footer, they serve no purpose
and you can include images without it. Below is a solution
with nested frames but you can also use a table to create
the header layout.

> However, replacing the figure in the page header by a normal text 
> suddenly solves the problem: putting "split" in the setupfloat and 
> "header=repeat" in the setupxtable gives me a table with repeated 
> headers that starts exactly where I want it to start. Apparently in this 
> case, the "headers=repeat" is necessary. Unfortunately, I need a company 
> logo up in the page header, which is what causes the error for which I 
> have no explanation.

Here is a working version of your example but you have to a space
between the header and the page body (see headerdistance setting)
or reduce the height of the outer most frame (it uses at the moment
the height and width of the header area).

\setuppapersize[A4,landscape]

\setuplayout
   [location=middle,
    width=27.5cm,
    height=18cm,
    backspace=1cm,
    header=4cm,
    headerdistance=5mm]

\startsetups[header]
     \startframed[width=max,height=max,frame=off,offset=overlay]
         \startframed[height=1cm,width=max,frame=off]
             \userpagenumber
         \stopframed
         \par
         \startframed[height=3cm,width=max,offset=overlay]
             \startframed[width=0.25\hsize,height=max]
                 \externalfigure[dummy][height=1.9cm]
             \stopframed
             \startframed[width=0.50\hsize,height=max,] % 
frame=off,topframe=on,bottomframe=on
                 some text in the middle block
             \stopframed
             \startframed[width=0.25\hsize,height=max]
                 some text in the right block
             \stopframed
         \stopframed
     \stopframed
\stopsetups

\setupheadertexts[\directsetup{header}]

\startbuffer[tablerow]
     \startxrow
         \startxcell first \stopxcell
         \startxcell second \stopxcell
     \stopxrow
\stopbuffer

\startbuffer[table]
     \startxtable
         \startxtablehead[head]
             \getbuffer[tablerow]
         \stopxtablehead
         \startxtablebody
             \dorecurse{40}{\getbuffer[tablerow]}
         \stopxtablebody
     \stopxtable
\stopbuffer

\setupxtable
   [option=stretch,
    split=repeat,
    header=repeat,
    align=middle]

\setupxtable
   [head]
   [background=color,
    backgroundcolor=gray]

\starttext

\title{Table without float environment}

\samplefile{ward}

\getbuffer[table]

\title{Table with  float environment}

\samplefile{ward}

\startplacetable[location={none,split}]
     \getbuffer[table]
\stopplacetable

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2020-04-05  9:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 14:46 Geert Dobbels
2020-04-04 16:46 ` Pablo Rodriguez
2020-04-04 19:44 ` Wolfgang Schuster
2020-04-04 22:30   ` Geert Dobbels
2020-04-05  9:02     ` Wolfgang Schuster [this message]

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=b59894ae-2b46-eb3b-ed68-391a9d4b995b@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=dobbels.geert@googlemail.com \
    --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).