ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to apply a color or screen background to a tabulate (or table)cell?
@ 2002-04-18  6:11 Daniel Pittman
  2002-04-18  8:35 ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Pittman @ 2002-04-18  6:11 UTC (permalink / raw)


I would like to place a screen behind one cell of a table that I am
using at the moment. Ideally, rounding the corners of this screen would
also be possible, but I can live without that.

According to the comments in 'core-tbl.tex', color is to be done "as
required".  Is this accurate and, if so, is there no way to achieve
this?

Using \startbackrgound or \startframedtext both screw up the placement
of the text in the cell in fairly dramatic ways, most of the time, and
even when they work roughly right they only cover the text, not the full
height of the cell...

        Daniel

-- 
If you stick a knife nine inches into my back and pull it out
three inches, that is not progress.  Even if you pull it all the
way out, that is not progress...
        -- Malcolm X


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

* Re: How to apply a color or screen background to a tabulate (or table) cell?
  2002-04-18  6:11 How to apply a color or screen background to a tabulate (or table)cell? Daniel Pittman
@ 2002-04-18  8:35 ` Hans Hagen
  2002-04-18 12:12   ` How to apply a color or screen background to a tabulate (ortable) cell? Daniel Pittman
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2002-04-18  8:35 UTC (permalink / raw)
  Cc: ntg-context

At 04:11 PM 4/18/2002 +1000, you wrote:
>I would like to place a screen behind one cell of a table that I am
>using at the moment. Ideally, rounding the corners of this screen would
>also be possible, but I can live without that.

the most robust mechanism is bTABLE eTABLE which provides \framed features 
behind each cell

>According to the comments in 'core-tbl.tex', color is to be done "as
>required".  Is this accurate and, if so, is there no way to achieve
>this?
>
>Using \startbackrgound or \startframedtext both screw up the placement
>of the text in the cell in fairly dramatic ways, most of the time, and
>even when they work roughly right they only cover the text, not the full
>height of the cell...

If this works on your system, you can spend the rest of the day trying to 
figure out what happens here:

\starttext

\setupcolors[state=start]

\definepositionframed[w][background=color,backgroundcolor=yellow]
\definepositionframed[x][background=color,backgroundcolor=red]
\definepositionframed[y][background=color,backgroundcolor=green]
\definepositionframed[z][background=color,corner=round,backgroundcolor=blue]

\starttabulate[|c|c|c|]
\NC this is a small  \NC table            \NC in which we \NC \FR
\NC will demonstrate \NC that this        \NC positioning \NC \MR
\NC mechanism also   \NC works quite well \NC in tables   \NC \LR
\stoptabulate

\starttabulate[|c|c|c|]
\GFC[f:x] this is a small      \GTC      table            \NC     in which 
we \NC \FR
\NC       will demonstrate     \GFC[g:z] that this        \GTC[g] 
positioning \NC \MR
\GSC[e:y] mechanism also       \GTC[f]   works quite well \NC     in 
tables   \NC \LR
\stoptabulate

\starttabulate[|c|c|c|]
\GFC[f:x,d:w] this is a small  \GTC[d]   table            \NC     in which 
we \NC \FR
\NC           will demonstrate \GFC[g:z] that this        \GTC[g] 
positioning \NC \MR
\GSC[e:y]     mechanism also   \GTC[f]   works quite well \NC     in 
tables   \NC \LR
\stoptabulate

\starttabulate[|c|c|c|]
\XC[+f:x] this is a small  \XC      table            \NC     in which we 
\NC \FR
\NC      will demonstrate  \XC[+g:z] that this       \XC[-g] positioning 
\NC \MR
\XC[=e:y] mechanism also   \XC[-f]  works quite well \NC     in 
tables   \NC \LR
\stoptabulate

\starttabulate[|c|c|c|]
\XC[+f:x,+d:w] this is a small  \XC[-d]   table            \NC     in which 
we \NC \FR
\NC            will demonstrate \XC[+g:z] that this        \XC[-g] 
positioning \NC \MR
\XC[=e:y]       mechanism also  \XC[-f]   works quite well \NC     in 
tables   \NC \LR
\stoptabulate

\definepositionframed[x][background=color,backgroundcolor=red]
\definepositionframed[y][background=color,backgroundcolor=green]
\definepositionframed[z][background=color,backgroundcolor=blue]

\starttabulate[|c|c|c|]
\GFC[f:x] this is a small  \NC       table            \NC     in which we 
\NC \FR
\NC       will demonstrate \GFC[g:z] that this        \GTC[g] positioning 
\NC \MR
\GSC[e:y] mechanism also   \GTC[f]   works quite well \NC     in 
tables   \NC \LR
\stoptabulate

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


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

* Re: How to apply a color or screen background to a tabulate (ortable) cell?
  2002-04-18  8:35 ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
@ 2002-04-18 12:12   ` Daniel Pittman
  2002-04-18 13:55     ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Pittman @ 2002-04-18 12:12 UTC (permalink / raw)


On Thu, 18 Apr 2002, Hans Hagen wrote:
> At 04:11 PM 4/18/2002 +1000, you wrote:
>>I would like to place a screen behind one cell of a table that I am
>>using at the moment. Ideally, rounding the corners of this screen
>>would also be possible, but I can live without that.
> 
> the most robust mechanism is bTABLE eTABLE which provides \framed
> features behind each cell

After grepping the sources heavily I found the ConTeXt XML module which
featured something like a clue as to how the [be]TABLE code worked. So,
I now have what I want. 

[...]

> If this works on your system, you can spend the rest of the day trying
> to figure out what happens here:

It did and, had it not made my head explode, I would have spent longer
at it.

[...]

> \GFC[f:x] 

I know that the 'f' is the symbolic name of the position and that 'x' is
the predefined background mentioned above. I couldn't work out exactly
what the set of macros for defining points did, though.

The XC macro seems to be some sort of helper and, based on the first
character, uses the previous column breaks internally.

The '=', or GSC, type seems to be devoted to picking the area of a
single cell, but it's non-functional for multi-line text. :(

The other two sets, [+-] and [><], seem to be identical in function.
I couldn't work out if there was *any* difference, though I suspect that
something subtle is going on that I didn't identify.

Finally, as I mentioned, trying to read the source to better understand
those macros made my brain melt. The ConTeXt sources scare me
occasionally -- there is /so/ much magic in there...

Anyway, I found that the [be]TABLE set work for me, so I use them.
I wouldn't mind getting some explanation of the use of the GSC, GFC and
GTC types, though.

...and it did shut me up for much of a day. ;)

        Daniel

-- 
It may sound strange coming from a research man, but an attempt to get too
many facts will often leave you without any real knowledge at all.
        -- Ernest Dichter


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

* Re: How to apply a color or screen background to a tabulate (or table) cell?
  2002-04-18 12:12   ` How to apply a color or screen background to a tabulate (ortable) cell? Daniel Pittman
@ 2002-04-18 13:55     ` Hans Hagen
  2002-04-18 14:48       ` How to apply a color or screen background to a tabulate (ortable) cell? Daniel Pittman
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2002-04-18 13:55 UTC (permalink / raw)
  Cc: ntg-context

At 10:12 PM 4/18/2002 +1000, Daniel Pittman wrote:

>I know that the 'f' is the symbolic name of the position and that 'x' is
>the predefined background mentioned above. I couldn't work out exactly
>what the set of macros for defining points did, though.

indeed it's specifying symbolic names and begin/end points; this permits 
spanning cells in quite strange ways.

>The '=', or GSC, type seems to be devoted to picking the area of a
>single cell, but it's non-functional for multi-line text. :(

ah, i must admit that i never really used it, it was more a test to see if 
it could work somehow

>The other two sets, [+-] and [><], seem to be identical in function.
>I couldn't work out if there was *any* difference, though I suspect that
>something subtle is going on that I didn't identify.
>
>Finally, as I mentioned, trying to read the source to better understand
>those macros made my brain melt. The ConTeXt sources scare me
>occasionally -- there is /so/ much magic in there...

be warned: most of the source is not meant for reading

>Anyway, I found that the [be]TABLE set work for me, so I use them.
>I wouldn't mind getting some explanation of the use of the GSC, GFC and
>GTC types, though.

S = siggle
F = from
T = to

if i remember right.

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


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

* Re: How to apply a color or screen background to a tabulate (ortable) cell?
  2002-04-18 13:55     ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
@ 2002-04-18 14:48       ` Daniel Pittman
  2002-04-18 15:19         ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Pittman @ 2002-04-18 14:48 UTC (permalink / raw)


On Thu, 18 Apr 2002, Hans Hagen wrote:
> At 10:12 PM 4/18/2002 +1000, Daniel Pittman wrote:
> 
>>I know that the 'f' is the symbolic name of the position and that 'x'
>>is the predefined background mentioned above. I couldn't work out
>>exactly what the set of macros for defining points did, though.
> 
> indeed it's specifying symbolic names and begin/end points; this
> permits spanning cells in quite strange ways.

Yes. If I ever need to do a more complex graphical table thing, this
will be incredibly useful. It's been good to try and work it out. :)

[...]

>>Finally, as I mentioned, trying to read the source to better
>>understand those macros made my brain melt. The ConTeXt sources scare
>>me occasionally -- there is /so/ much magic in there...
> 
> be warned: most of the source is not meant for reading

I figure that it's the thing to do between reading the documentation and
asking on the mailing list -- about a third of the time it answers my
question, often because there are examples in the source.

So, if I didn't try then you would be even more bombarded by questions
than you are now. For example:

Is there any way to specify the inter-cell spacing of two columns when
using the bTABLE/eTABLE interface?

I tried the 'distance' argument to bTD but, sadly, it didn't work.

I also noted that this didn't do anything -- but didn't generate any
message. Should I expect an error if I give an illegal argument to a
ConTeXt command, at least in general?

        Daniel

-- 
All discarded lovers should be given a second chance, but with somebody else.
        -- Mae West


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

* Re: How to apply a color or screen background to a tabulate (or table) cell?
  2002-04-18 14:48       ` How to apply a color or screen background to a tabulate (ortable) cell? Daniel Pittman
@ 2002-04-18 15:19         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2002-04-18 15:19 UTC (permalink / raw)
  Cc: ntg-context

At 12:48 AM 4/19/2002 +1000, you wrote:
>On Thu, 18 Apr 2002, Hans Hagen wrote:
> > At 10:12 PM 4/18/2002 +1000, Daniel Pittman wrote:
> >
> >>I know that the 'f' is the symbolic name of the position and that 'x'
> >>is the predefined background mentioned above. I couldn't work out
> >>exactly what the set of macros for defining points did, though.
> >
> > indeed it's specifying symbolic names and begin/end points; this
> > permits spanning cells in quite strange ways.
>
>Yes. If I ever need to do a more complex graphical table thing, this
>will be incredibly useful. It's been good to try and work it out. :)
>
>[...]
>
> >>Finally, as I mentioned, trying to read the source to better
> >>understand those macros made my brain melt. The ConTeXt sources scare
> >>me occasionally -- there is /so/ much magic in there...
> >
> > be warned: most of the source is not meant for reading
>
>I figure that it's the thing to do between reading the documentation and
>asking on the mailing list -- about a third of the time it answers my
>question, often because there are examples in the source.
>
>So, if I didn't try then you would be even more bombarded by questions
>than you are now. For example:
>
>Is there any way to specify the inter-cell spacing of two columns when
>using the bTABLE/eTABLE interface?
>
>I tried the 'distance' argument to bTD but, sadly, it didn't work.

no, on the to do list, but you can play with

frameoffset=-3pt

and alike

>I also noted that this didn't do anything -- but didn't generate any
>message. Should I expect an error if I give an illegal argument to a
>ConTeXt command, at least in general?

i will implement that once my computer hits the 10 GHz boundary

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


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

end of thread, other threads:[~2002-04-18 15:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-18  6:11 How to apply a color or screen background to a tabulate (or table)cell? Daniel Pittman
2002-04-18  8:35 ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
2002-04-18 12:12   ` How to apply a color or screen background to a tabulate (ortable) cell? Daniel Pittman
2002-04-18 13:55     ` How to apply a color or screen background to a tabulate (or table) cell? Hans Hagen
2002-04-18 14:48       ` How to apply a color or screen background to a tabulate (ortable) cell? Daniel Pittman
2002-04-18 15:19         ` How to apply a color or screen background to a tabulate (or table) cell? 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).