ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: Context List <ntg-context@ntg.nl>
Subject: Re: two table questions
Date: Mon, 31 May 1999 16:26:35 +0200	[thread overview]
Message-ID: <37529C1B.8AF4620C@wxs.nl> (raw)
In-Reply-To: <Pine.SGI.4.04.9905311215240.177895-100000@sono>

Matthew Baker wrote:

> ! Math formula deleted: Insufficient symbol fonts.

This has something to do with your local font setup, maybe taco knows
the answer? 

> Second question: I'm trying to use \BC and \BL to to colour cells in a
> table.  I'd like to have all cells in the first row in one colour, then
> most cells in the other rows in white but with a few in a third colour, eg

First a remark. Color support is not natural to tex. Although context
can do a rather decent job, sometimes color is tricky. In tables for
instance, I use a rather dirty trick: coloring rules that are stretched
by tex, skipping back and overlaying the text. The macros are hooked
into the table package (which is the only foreign piece of code in
context). When I find the time, I will rewrite the table package from
scratch, which will make things a bit more secure. Like always with
tables, anything interfering (noalign stuff) will break the mechanism
completely, especially because there is also automatic table breaking
across pages and error tracing (partially turned on by default) and
error recovery (as good as possible). 

Concerning your problem, I cross my fingers that the next hack will not
break other things. Change this in core-tab.tex and remake the format
(or put this code in cont-new.tex, but don't forget to delete that file
when you update). 

\def\TableBC%
  {\ifTABLEgrayline
     \normalTABLEquote
   \else
     \TABLEnoalign\bgroup
       \global\let\nextTABLEgrayline=\executeTABLEgrayline
\global\let\TABLEgrayline\empty
       \let\BL=\doTableBL
       \let\BC=\doTableBC
       \expandafter\doTableBC
   \fi}

\def\TableBL%
  {\TABLEnoalign\bgroup
     \global\let\nextTABLEgrayline=\executeTABLEgrayline
\global\let\TABLEgrayline\empty
     \let\BL=\doTableBL
     \let\CL=\doTableCL
     \let\RL=\doTableRL
     \let\BC=\doTableBC
     \doTableBL}

\def\TableCL%
  {\TABLEnoalign\bgroup
     \global\let\nextTABLEgrayline=\executeTABLEgrayline
\global\let\TABLEgrayline\empty
     \let\BL=\doTableBL
     \let\CL=\doTableCL
     \let\RL=\doTableRL
     \let\BC=\doTableBC
     \doTableCL}

\def\TableRL%
  {\TABLEnoalign\bgroup
     \global\let\nextTABLEgrayline=\executeTABLEgrayline
\global\let\TABLEgrayline\empty
     \let\BL=\doTableBL
     \let\CL=\doTableCL
     \let\RL=\doTableRL
     \let\BC=\doTableBC
     \doTableRL}

Here are your tables:

\setupcolors[state=start]

\starttable[|c|c|c|]
\HL
\VL A  \VL B      \VC[red] C  \VL\SR
\HL
\VL A1 \VL B1     \VC      B1 \VL\FR
\VL A3 \VL B3     \VC      B3 \VL\LR
\HL
\stoptable

\starttable[|c|c|c|]
\HL
\BL[c,red]            \BC             \SR
\VL A      \VL B      \VL C        \VL\SR
\HL
                                   \BR\FR
\VL A1     \VL B1     \VL B1       \VL\FR
                                   \BR\MR
\VL A1     \VL B1     \VL B1       \VL\MR
                                   \BR\LR
\VL A3     \VL B3     \VL B3       \VL\LR
\HL
\stoptable

\starttable[|c|c|c|]
\HL
\BL[c,red]            \BC             \SR
\VL A      \VL B      \VL C        \VL\SR
\HL
\BL[c,red]            \BC             \FR
\VL A1     \VL B1     \VL B1       \VL\FR
\VL A1     \VL B1     \VL B1       \VL\MR
\BL[c,red]            \BL[c,green]    \MR
\VL A1     \VL B1     \VL B1       \VL\MR
\BL[c,red]            \BL[c,green]    \MR
\VL A1     \VL B1     \VL B1       \VL\MR
\BL[c,red]            \BL[c,green]    \LR
\VL A3     \VL B3     \VL B3       \VL\LR
\HL
\stoptable

Or something along these lines. It is btw not (yet) possible to color
neigbouring cells. Sorry. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


  reply	other threads:[~1999-05-31 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-31 11:13 Matthew Baker
1999-05-31 14:26 ` Hans Hagen [this message]
1999-06-01  8:53 ` Taco Hoekwater

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=37529C1B.8AF4620C@wxs.nl \
    --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).