ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xtable
@ 2012-06-21 14:27 Meer, H. van der
  2012-06-22  8:53 ` xtable Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Meer, H. van der @ 2012-06-21 14:27 UTC (permalink / raw)
  To: ConTeXt NTG


[-- Attachment #1.1: Type: text/plain, Size: 265 bytes --]

Can one put individual horizontal and vertical lines between rows/columns in xtable? Just like for example \HL in \starttable?

The workings of parameter spaceinbetween on \startxtable remain a mystery to me. Can someone enlighten me?

Hans van der Meer




[-- Attachment #1.2: Type: text/html, Size: 1761 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: xtable
  2012-06-21 14:27 xtable Meer, H. van der
@ 2012-06-22  8:53 ` Wolfgang Schuster
  2012-06-22 10:00   ` xtable Meer, H. van der
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2012-06-22  8:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 21.06.2012 um 16:27 schrieb Meer, H. van der:

> Can one put individual horizontal and vertical lines between rows/columns in xtable? Just like for example \HL in \starttable?

You can use MetaPost to draw the rules but it’s awkward because you can make a setup like this

  \setuxptable[column][1][background=…]

which is only supported by natural tables. It would be simpler when stables had a counter like \currentxtablecolumn
which could be accessed to make a test like “if \currentxtablecolumn = 1 then … fi” but this isn’t the case.

> The workings of parameter spaceinbetween on \startxtable remain a mystery to me. Can someone enlighten me?

It inserts a space between each row, the amount of space is the same as \blank[…] would insert.

\starttext

\startxtable[spaceinbetween=line]
  \startxrow
    \startxcell A \stopxcell
    \startxcell B \stopxcell
  \stopxrow
  \startxrow
    \startxcell C \stopxcell
    \startxcell D \stopxcell
  \stopxrow
  \startxrow
    \startxcell E \stopxcell
    \startxcell F \stopxcell
  \stopxrow
\stopxtable

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: xtable
  2012-06-22  8:53 ` xtable Wolfgang Schuster
@ 2012-06-22 10:00   ` Meer, H. van der
  2012-06-22 10:48     ` xtable Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Meer, H. van der @ 2012-06-22 10:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 22 jun. 2012, at 10:53, Wolfgang Schuster wrote:

> 
> Am 21.06.2012 um 16:27 schrieb Meer, H. van der:
> 
>> Can one put individual horizontal and vertical lines between rows/columns in xtable? Just like for example \HL in \starttable?
> 
> You can use MetaPost to draw the rules but it’s awkward because you can make a setup like this
> 
>  \setuxptable[column][1][background=…]
> 
> which is only supported by natural tables. It would be simpler when stables had a counter like \currentxtablecolumn
> which could be accessed to make a test like “if \currentxtablecolumn = 1 then … fi” but this isn’t the case.

I see. No hope here. 

But I found some sort of solution which I communicate here. It is bit of a kludge but does more or less what I had in mind. The following macros do the work in my xml=>xtable module:
<table frameon="t,b"> also <thead> <tr> <td> and so on.

\def\setframeparts#1#2#3{%
\doifinset{t}{#1}{#3[topframe=#2]}%
\doifinset{b}{#1}{#3[bottomframe=#2]}%
\doifinset{l}{#1}{#3[leftframe=#2]}%
\doifinset{r}{#1}{#3[rightframe=#2]}%
}
..#2 being \setupxtable or \setupframed, just as needed
\doifnot{\xmlatt{#1}{frameon}}{\empty}%
    {#2[frame=off]\setframeparts{\xmlatt{#1}{frameon}}{on}{#2}}%
\doifnot{\xmlatt{#1}{frameoff}}{\empty}%
    {#2[frame=on]\setframeparts{\xmlatt{#1}{frameoff}}{off}{#2}}%
..

> 
>> The workings of parameter spaceinbetween on \startxtable remain a mystery to me. Can someone enlighten me?
> 
> It inserts a space between each row, the amount of space is the same as \blank[…] would insert.
> 

Do I conclude correctly that the dimension of the space is fixed to what \blank[] does? 
I experimented with various values, but did not get much out of it.

Hans van der Meer



___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: xtable
  2012-06-22 10:00   ` xtable Meer, H. van der
@ 2012-06-22 10:48     ` Wolfgang Schuster
  2012-06-22 11:14       ` xtable Meer, H. van der
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2012-06-22 10:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.06.2012 um 12:00 schrieb Meer, H. van der:

> 
> On 22 jun. 2012, at 10:53, Wolfgang Schuster wrote:
> 
>> 
>> Am 21.06.2012 um 16:27 schrieb Meer, H. van der:
>> 
>>> Can one put individual horizontal and vertical lines between rows/columns in xtable? Just like for example \HL in \starttable?
>> 
>> You can use MetaPost to draw the rules but it’s awkward because you can make a setup like this
>> 
>> \setuxptable[column][1][background=…]
>> 
>> which is only supported by natural tables. It would be simpler when stables had a counter like \currentxtablecolumn
>> which could be accessed to make a test like “if \currentxtablecolumn = 1 then … fi” but this isn’t the case.
> 
> I see. No hope here. 
> 
> But I found some sort of solution which I communicate here. It is bit of a kludge but does more or less what I had in mind. The following macros do the work in my xml=>xtable module:
> <table frameon="t,b"> also <thead> <tr> <td> and so on.
> 
> \def\setframeparts#1#2#3{%
> \doifinset{t}{#1}{#3[topframe=#2]}%
> \doifinset{b}{#1}{#3[bottomframe=#2]}%
> \doifinset{l}{#1}{#3[leftframe=#2]}%
> \doifinset{r}{#1}{#3[rightframe=#2]}%
> }
> ..#2 being \setupxtable or \setupframed, just as needed
> \doifnot{\xmlatt{#1}{frameon}}{\empty}%
>    {#2[frame=off]\setframeparts{\xmlatt{#1}{frameon}}{on}{#2}}%
> \doifnot{\xmlatt{#1}{frameoff}}{\empty}%
>    {#2[frame=on]\setframeparts{\xmlatt{#1}{frameoff}}{off}{#2}}%
> ..

Can make a working minimal example. As you use xml as input language it’s no problem to save some settings and apply them later to each cell which will allow you to set different values for the frames.

You should also know that each xtable cell is a framed (it uses the \framed code) like natural tables and \setupxtable accepts the same arguments as \setupframed.

>>> The workings of parameter spaceinbetween on \startxtable remain a mystery to me. Can someone enlighten me?
>> 
>> It inserts a space between each row, the amount of space is the same as \blank[…] would insert.
> 
> Do I conclude correctly that the dimension of the space is fixed to what \blank[] does? 
> I experimented with various values, but did not get much out of it.

I’m sorry but I was wrong, the “spaceinbetween” value isn’t passed to \blank but context expects here something like “spaceinbetween={\vskip <dimension>}”. I can send a patch to Hans because a internal blank would be allow you to write “spaceinbetween=1cm” or “spaceinbetween=2*line”.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: xtable
  2012-06-22 10:48     ` xtable Wolfgang Schuster
@ 2012-06-22 11:14       ` Meer, H. van der
  0 siblings, 0 replies; 5+ messages in thread
From: Meer, H. van der @ 2012-06-22 11:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1365 bytes --]


On 22 jun. 2012, at 12:48, Wolfgang Schuster wrote:

You should also know that each xtable cell is a framed (it uses the \framed code) like natural tables and \setupxtable accepts the same arguments as \setupframed.

I knew already, which is what me did develop the macros. No need to give complete examples, I think. The intention was to give you an impression of the solution, just in case you should be curious.
Using a macro argument for the \setup.. is meant to apply this code to both xtable and framed.


The workings of parameter spaceinbetween on \startxtable remain a mystery to me. Can someone enlighten me?

It inserts a space between each row, the amount of space is the same as \blank[…] would insert.

Do I conclude correctly that the dimension of the space is fixed to what \blank[] does?
I experimented with various values, but did not get much out of it.

I’m sorry but I was wrong, the “spaceinbetween” value isn’t passed to \blank but context expects here something like “spaceinbetween={\vskip <dimension>}”. I can send a patch to Hans because a internal blank would be allow you to write “spaceinbetween=1cm” or “spaceinbetween=2*line”.

I would very much appreciate that. It seems most natural to have a dimension here and thenit will work in the same manner as columndistance. Thanks in advance.

Hans van der Meer



[-- Attachment #1.2: Type: text/html, Size: 4208 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2012-06-22 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-21 14:27 xtable Meer, H. van der
2012-06-22  8:53 ` xtable Wolfgang Schuster
2012-06-22 10:00   ` xtable Meer, H. van der
2012-06-22 10:48     ` xtable Wolfgang Schuster
2012-06-22 11:14       ` xtable Meer, H. van der

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