ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Table with metapost framing and colors
Date: Sat, 13 Sep 2003 23:48:20 +0200	[thread overview]
Message-ID: <5.2.0.9.1.20030913230718.02740448@localhost> (raw)
In-Reply-To: <3F6085A0.7000805@econ.muni.cz>

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

  reply	other threads:[~2003-09-13 21:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-11 14:24 Michal Kvasnicka
2003-09-13 21:48 ` Hans Hagen [this message]
2003-09-15  8:32   ` Michal Kvasnicka
2003-09-15 18:47     ` Hans Hagen

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=5.2.0.9.1.20030913230718.02740448@localhost \
    --to=pragma@wxs.nl \
    --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).