ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Table with metapost framing and colors
@ 2003-09-11 14:24 Michal Kvasnicka
  2003-09-13 21:48 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Kvasnicka @ 2003-09-11 14:24 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

Dear Mr. Hagen.

I apologize that I bother you once more, but I really need your help 
(deadline for my document is quite soon). :-(

I have to follow a rather complex document design. According to it 
tables must be framed with two different lines: The outer frame must be 
thick and the inner thin. Moreover, a part of the header (the first row) 
must be black. I didn't know how to do it, so I used Metapost in a 
company with the overlay mechanism provided with the ConTeXt.  It works 
well, but:

1) When a cell has black background, it turns its frame from black to 
white. It's awfull. How can I switch this behavior off?
2) The frame of the first and last row doesn't fit precisely to frames 
of the rest rows. What's wrong? Are those cell of a different sizes? How 
can I improve it?

Many thanks for your kind help.
Your sincerely
Michal Kvasnicka

P.S. I include a minimal (but not a small, I apologize) example.


[-- Attachment #2: tableexample.tex --]
[-- Type: application/x-tex, Size: 4062 bytes --]

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

* Re: Table with metapost framing and colors
  2003-09-11 14:24 Table with metapost framing and colors Michal Kvasnicka
@ 2003-09-13 21:48 ` Hans Hagen
  2003-09-15  8:32   ` Michal Kvasnicka
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2003-09-13 21:48 UTC (permalink / raw)


At 16:24 11/09/2003 +0200, Michal Kvasnicka wrote:
>Dear Mr. Hagen.
>
>I apologize that I bother you once more, but I really need your help 
>(deadline for my document is quite soon). :-(
>
>I have to follow a rather complex document design. According to it tables 
>must be framed with two different lines: The outer frame must be thick and 
>the inner thin. Moreover, a part of the header (the first row) must be 
>black. I didn't know how to do it, so I used Metapost in a company with 
>the overlay mechanism provided with the ConTeXt.  It works well, but:
>
>1) When a cell has black background, it turns its frame from black to 
>white. It's awfull. How can I switch this behavior off?
>2) The frame of the first and last row doesn't fit precisely to frames of 
>the rest rows. What's wrong? Are those cell of a different sizes? How can 
>I improve it?
>
>Many thanks for your kind help.
>Your sincerely
>Michal Kvasnicka
>
>P.S. I include a minimal (but not a small, I apologize) example.

you can avoid the ugly def by :

\startsetups[table]

   \setupTABLE[frame=off, background={color,tabulka5}, backgroundcolor=white]
   \setupTABLE[column][1][background={color,tabulka2}]
   \setupTABLE[row][1,2][background={color,tabulka4}]
   \setupTABLE[column][last][background={color,tabulka8}]
   \setupTABLE[row][last][background={color,tabulka6}]
   \setupTABLE[1][1,2][background={color,tabulka1}]
   \setupTABLE[last][1,2][background={color,tabulka7}]
   \setupTABLE[last][last][background={color,tabulka9}]
   \setupTABLE[1][last][background={color,tabulka3}]
   \setupTABLE[column][2,4,6,8,10,12,14,16,18,20][backgroundcolor=svetleseda]
   \setupTABLE[column][3,5,7,9,11,13,15,17,19][backgroundcolor=tmaveseda]
   \setupTABLE[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20][1][backgroundcolor=black,color=white]
   \setupTABLE[1][1,2][backgroundcolor=white, color=black]

\stopsetups

\placetable[here][tab:spotrceny]{A Time Serie}{\setups[table]...}

however, i wonder if you really need all that mp code:

\defineframedcontent[SomeTable][offset=1pt,rulethickness=2pt]
\startframedcontent[SomeTable]
\setupTABLE[2][1][background=color,backgroundcolor=black,foregroundcolor=white]
\bTABLE
\bTR\bTD Date \eTD\bTD  Index CPI \eTD\eTR
\bTR\bTD jan 1991 \eTD\bTD 59.4 \eTD\eTR
\bTR\bTD feb 1991 \eTD\bTD 63.1 \eTD\eTR
\bTR\bTD mar 1991 \eTD\bTD 65.7 \eTD\eTR
\bTR\bTD $\vdots$ \eTD\bTD $\vdots$ \eTD\eTR
\bTR\bTD dec 1995 \eTD\bTD 112.5 \eTD\eTR
\eTABLE
\stopframedcontent

(\defineframedcontent is just a kind of preset framed text)
-------------------------------------------------------------------------
                                   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] 4+ messages in thread

* Re: Table with metapost framing and colors
  2003-09-13 21:48 ` Hans Hagen
@ 2003-09-15  8:32   ` Michal Kvasnicka
  2003-09-15 18:47     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Kvasnicka @ 2003-09-15  8:32 UTC (permalink / raw)


Wow.

If I knew this mechanism some time ago, I would same a lot of time. :-( 
It is great. Many thanks.

BTW, is it possile  to set a different rule-thickness for different part 
of the frame (e.g. leftframerulethikness=3pt etc.)? Is it possible to 
set this way also offset?

With many thanks
Michal Kvasnicka

> however, i wonder if you really need all that mp code:
>
> \defineframedcontent[SomeTable][offset=1pt,rulethickness=2pt]
> \startframedcontent[SomeTable]
> \setupTABLE[2][1][background=color,backgroundcolor=black,foregroundcolor=white] 
>
> \bTABLE
> \bTR\bTD Date \eTD\bTD  Index CPI \eTD\eTR
> \bTR\bTD jan 1991 \eTD\bTD 59.4 \eTD\eTR
> \bTR\bTD feb 1991 \eTD\bTD 63.1 \eTD\eTR
> \bTR\bTD mar 1991 \eTD\bTD 65.7 \eTD\eTR
> \bTR\bTD $\vdots$ \eTD\bTD $\vdots$ \eTD\eTR
> \bTR\bTD dec 1995 \eTD\bTD 112.5 \eTD\eTR
> \eTABLE
> \stopframedcontent
>
> (\defineframedcontent is just a kind of preset framed text)
> -------------------------------------------------------------------------
>                                   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
> -------------------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Table with metapost framing and colors
  2003-09-15  8:32   ` Michal Kvasnicka
@ 2003-09-15 18:47     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2003-09-15 18:47 UTC (permalink / raw)


At 10:32 15/09/2003 +0200, you wrote

>BTW, is it possile  to set a different rule-thickness for different part 
>of the frame (e.g. leftframerulethikness=3pt etc.)? Is it possible to set 
>this way also offset?

technically yes, but you may get funny effects due to the fact that the 
bunch of framed cells need to overlay

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] 4+ messages in thread

end of thread, other threads:[~2003-09-15 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-11 14:24 Table with metapost framing and colors Michal Kvasnicka
2003-09-13 21:48 ` Hans Hagen
2003-09-15  8:32   ` Michal Kvasnicka
2003-09-15 18:47     ` 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).