ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Split Table Desperation - again!
@ 2006-06-21 22:22 Johannes Graumann
  2006-06-22  8:23 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Graumann @ 2006-06-21 22:22 UTC (permalink / raw)


Hello,

While the recent modifications to the split table mechanisms provided by
Hans help me out with my most annoying monster table using the XML mapping
code below (see
http://www.idyll.org:8081/JohSite/context/p46-50_split_working.pdf/view for
the typeset table; clearly to much whitespace, but everything is typeset
and page boundaries are honored) and several other -smaller- tables in the
same tome (see
http://www.idyll.org:8081/JohSite/context/p45_unsplit_working.pdf/view for
a typeset example), one medium-sized table that clearly should not be split
gets split none the less (see
http://www.idyll.org:8081/JohSite/context/p162-163_unnecessary_split.pdf/view) ...
and I have no idea why.

Puzzled and helpless, Joh

XML mapping code:

% 'table' - table definition
\defineXMLnested
  [table]
  [lines=auto]
  {
    \defineXMLsave[floattitle]
    \defineXMLsave[caption]
    \defineXMLsave[header]
    \defineXMLsave[body]
    \defineXMLsave[footer]
  }
  {
    \splitfloat[lines=\XMLop{lines}]
      {
        \expanded{%
          \placetable
            [\XMLpar{table}{location}{}]
            [\XMLpar{table}{label}{unknown}]
            {\select{caption}{\XMLflush{floattitle}
{{\bf\XMLflush{floattitle}} \XMLflush{caption}}}
        }
      }
      {
        \setupTABLE[row][1][topframe=on]
        \setupTABLE[row][last][bottomframe=on]
\bTABLE[frame=off,split=repeat,splitmethod=b,style={\switchtobodyfont[small]\setupinterlinespace[line=2.8ex]}]
          \bTABLEhead\XMLflush{header}\eTABLEhead
          \bTABLEbody\XMLflush{body}\eTABLEbody
          \bTABLEfoot\XMLflush{footer}\eTABLEfoot
        \eTABLE
      }
  }

% 'td' - table cell definition defaulting to single row/column, automatic
width determination, left alignment
\defineXMLnested
  [td]
  [rows=1,cols=1,width=,bottomframe=,topframe=,align=right]
  {
    \doifelse{\XMLop{width}}{}%
      {
        \doifelse{\XMLop{bottomframe}}{}%
          {
            \doifelse{\XMLop{topframe}}{}%
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols}]}}
             
{\expanded{\bTD[align=\XMLop{align},topframe=\XMLop{topframe},nr=\XMLop{rows},nc=\XMLop{cols}]}}
          }
          {
            \doifelse{\XMLop{topframe}}{}%
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols},bottomframe=\XMLop{bottomframe}]}}
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols},bottomframe=\XMLop{bottomframe},topframe=\XMLop{topframe}]}}
          }
      }
      {
        \doifelse{\XMLop{bottomframe}}{}%
          {
            \doifelse{\XMLop{topframe}}{}%
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols},width=\XMLop{width}]}}
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols},width=\XMLop{width},topframe=\XMLop{topframe}]}}
          }
          {
            \doifelse{\XMLop{topframe}}{}%
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols},width=\XMLop{width},bottomframe=\XMLop{bottomframe}]}}
             
{\expanded{\bTD[align=\XMLop{align},nr=\XMLop{rows},nc=\XMLop{cols},width=\XMLop{width},bottomframe=\XMLop{bottomframe},topframe=\XMLop{topframe}]}}
          }
      }
  }
  {\par\eTD}

% 'tr' - table row definition, defaulting to no bottomframe
\defineXMLnested
  [tr]
  [bottomframe=,rulethickness=0.5pt]
  {\doifelse{\XMLop{bottomframe}}{}%
    {\expanded{\bTR}}%
   
{\expanded{\bTR[bottomframe=\XMLop{bottomframe},rulethickness=\XMLop{rulethickness}]}}
  }
  {\eTR}

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

* Re: Split Table Desperation - again!
  2006-06-21 22:22 Split Table Desperation - again! Johannes Graumann
@ 2006-06-22  8:23 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2006-06-22  8:23 UTC (permalink / raw)


Johannes Graumann wrote:
> Hello,
>
> While the recent modifications to the split table mechanisms provided by
> Hans help me out with my most annoying monster table using the XML mapping
> code below (see
> http://www.idyll.org:8081/JohSite/context/p46-50_split_working.pdf/view for
> the typeset table; clearly to much whitespace, but everything is typeset
> and page boundaries are honored) and several other -smaller- tables in the
> same tome (see
> http://www.idyll.org:8081/JohSite/context/p45_unsplit_working.pdf/view for
> a typeset example), one medium-sized table that clearly should not be split
> gets split none the less (see
> http://www.idyll.org:8081/JohSite/context/p162-163_unnecessary_split.pdf/view) ...
> and I have no idea why.
>
>   
 some of your rows are quite high and since you want to repeat headers 
... this is how it works

(1) keep at least one row with a repeated header
(2) the same with a repeated footer
(3) when a combination of header/row/footer becomes too high for a page, 
ignore that fact and flush it (else we get a loop)

so, what you see is pretty natural

in your case, i'd try to make the last column wider so that less space 
gets lost and

(i can think of a way to let the text continue on too empty pages; needs 
some braincycles)

Hans

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

end of thread, other threads:[~2006-06-22  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21 22:22 Split Table Desperation - again! Johannes Graumann
2006-06-22  8:23 ` Hans Hagen

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