Re: [NTG-context] Table cell colo(u)rs

2011-11-25 Thread Hans Hagen

On 17-11-2011 14:05, Andreas Harder wrote:


On 16.11.2011, at 15:21, Pavneet Arora wrote:


Hello,

I am trying to do a simple cell background shading in a table using the example 
at the wiki:

http://wiki.contextgarden.net/Table

Unfortunately, I get an Undefined control sequence ... error:

! Undefined control sequence.

system  tex  error on line 4 in file tmp.tex: Undefined control sequence ...

1 \setupcolors[state=start]
2 \starttable[|l|l|]
3 \HL
4   \BL[1]\SR
5 \NC Command   \NC Meaning \NC\SR
6 \HL
7 \NC \tex{NC}  \NC next column \NC\FR
8 \NC \tex{NR}  \NC next row\NC\LR
9 \HL
10 \CL[green]\SR
11 \NC \tex{AR} \NC automatic row\NC\SR
12 \HL
13 \stoptable
14

recently read  \BL

l.4 \BL
   [1]\SR
?

Any suggestions?


I think the using \start- \stoptable is not recommended (MkIV) any more. 
Instead you can use

\starttabulate[|l|l|]
\CM[yellow] Command  \NCMeaning \NC\NR\FL
\NC \tex{NC} \NCnext column \NC\NR
\NC \tex{NR} \CM[green] next row\NC\NR
\NC \tex{HL} \CM[blue]  horizontal line \NC\NR\FL
\stoptabulate

Or as already suggested the \bTABLE … \eTABLE or the new xtable-environment.


table only supports colored lines now:

\starttext

\starttable[|l|l|]
\HL[red]
\NC Command \NC Meaning \NC\SR
\HL[blue,10]
\NC \tex{NC} \NC next column \NC\FR
\NC \tex{NR} \NC next row \NC \LR
\HL[green]
\NC \tex{AR} \NC automatic row \NC \SR
\HL
\stoptable

\starttabulate[|l|l|l|]
\HL[red]
\NC Command \NC Meaning \NC Whatever \NC\SR
\HL[blue,10]
\NC \tex{CC} \CC[blue] next column \NC last column \NC \NR
\NC \tex{CM} \CM[blue] next column \NC last column \NC \NR
\NC \tex{CL} \CL[blue] next column \NC last column \NC \NR
\NC \tex{CR} \CR[blue] next column \NC last column \NC \NR
\NC \tex{NC} \NC   next row\NC last column \NC \NR
\HL[green]
\NC \tex{NC} \NC automatic row \NC last column \NC \SR
\HL
\stoptabulate

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


[NTG-context] Table cell colo(u)rs

2011-11-17 Thread Pavneet Arora

Hello,

I am trying to do a simple cell background shading in a table using the example 
at the wiki:


http://wiki.contextgarden.net/Table

Unfortunately, I get an Undefined control sequence ... error:

! Undefined control sequence.

system   tex  error on line 4 in file tmp.tex: Undefined control 
sequence ...


 1 \setupcolors[state=start]
 2 \starttable[|l|l|]
 3 \HL
 4   \BL[1]\SR
 5 \NC Command  \NC Meaning \NC\SR
 6 \HL
 7 \NC \tex{NC} \NC next column \NC\FR
 8 \NC \tex{NR} \NC next row\NC\LR
 9 \HL
10 \CL[green]\SR
11 \NC \tex{AR} \NC automatic row\NC\SR
12 \HL
13 \stoptable
14

recently read \BL

l.4 \BL
   [1]\SR
?

Any suggestions?

advTHANKSance

--
-
- Pavneet Arora

Bespoke Spaces.  We build smart spaces.
www.bespokespaces.com  416.937.9276
___
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
___


Re: [NTG-context] Table cell colo(u)rs

2011-11-17 Thread Christian
 Hello,
 
 I am trying to do a simple cell background shading in a table using the
 example at the wiki:
 
 http://wiki.contextgarden.net/Table
 
 Unfortunately, I get an Undefined control sequence ... error:
 
 ! Undefined control sequence.
 
 system   tex  error on line 4 in file tmp.tex: Undefined control
 sequence ...
 
   1 \setupcolors[state=start]
   2 \starttable[|l|l|]
   3 \HL
   4   \BL[1]\SR
   5 \NC Command   \NC Meaning \NC\SR
   6 \HL
   7 \NC \tex{NC}  \NC next column \NC\FR
   8 \NC \tex{NR}  \NC next row\NC\LR
   9 \HL
 10 \CL[green]\SR
 11 \NC \tex{AR}   \NC automatic row\NC\SR
 12 \HL
 13 \stoptable
 14
 
 recently read \BL
 
 l.4 \BL
 [1]\SR
 ?
 
 Any suggestions?

Well, not for this particular problem, it happens here, too.
But may I suggest the use of natural tables (aka TALBES)? I find them way 
more comfortable to use and the code is cleaner (to my eyes, at least).
This should get you going:

% Start of file
\setupTABLE[r][first][foregroundstyle={\ss \bf 
\color[white]},background=color,backgroundcolor=blue,framecolor=blue]
\setupTABLE[column][each][leftframe=off,rightframe=off]
\setupTABLE[column][1][align=right]
\setupTABLE[column][2][alignmentcharacter={.},aligncharacter=yes,align=middle,style={\color[red]}]
\chardef\characteralignmentmode=2
\starttext
\startplacetable[title=test]
\bTABLE
\bTR \bTH Category \eTH \bTH Data entry \eTH \eTR
\bTR \bTD First \eTD \bTD 35.12 \eTD \eTR
\bTR \bTD[background=color,backgroundcolor=red] Second \eTD \bTD 5.014 \eTD \eTR
\bTR[background=color,backgroundcolor=gray]
\bTD Total \eTD \bTD 110 \eTD
\eTR
\eTABLE
\stopplacetable
\stoptext
% End of file

More information:
http://wiki.contextgarden.net/TABLE
Many more examples:
http://www.pragma-ade.com/general/manuals/enattab.pdf

Cheers!

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


Re: [NTG-context] Table cell colo(u)rs

2011-11-17 Thread Andreas Harder

On 16.11.2011, at 15:21, Pavneet Arora wrote:

 Hello,
 
 I am trying to do a simple cell background shading in a table using the 
 example at the wiki:
 
 http://wiki.contextgarden.net/Table
 
 Unfortunately, I get an Undefined control sequence ... error:
 
 ! Undefined control sequence.
 
 system   tex  error on line 4 in file tmp.tex: Undefined control 
 sequence ...
 
 1 \setupcolors[state=start]
 2 \starttable[|l|l|]
 3 \HL
 4   \BL[1]\SR
 5 \NC Command \NC Meaning \NC\SR
 6 \HL
 7 \NC \tex{NC}\NC next column \NC\FR
 8 \NC \tex{NR}\NC next row\NC\LR
 9 \HL
 10 \CL[green]\SR
 11 \NC \tex{AR}   \NC automatic row\NC\SR
 12 \HL
 13 \stoptable
 14
 
 recently read \BL
 
 l.4 \BL
   [1]\SR
 ?
 
 Any suggestions?

I think the using \start- \stoptable is not recommended (MkIV) any more. 
Instead you can use

\starttabulate[|l|l|]
\CM[yellow] Command  \NCMeaning \NC\NR\FL
\NC \tex{NC} \NCnext column \NC\NR
\NC \tex{NR} \CM[green] next row\NC\NR
\NC \tex{HL} \CM[blue]  horizontal line \NC\NR\FL
\stoptabulate

Or as already suggested the \bTABLE … \eTABLE or the new xtable-environment.


Greeting
Andreas
___
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
___


Re: [NTG-context] Table cell colo(u)rs

2011-11-17 Thread Wolfgang Schuster

Am 17.11.2011 um 14:05 schrieb Andreas Harder:

 I think the using \start- \stoptable is not recommended (MkIV) any more. […]

I consider the table environment to be useful for short tables where I don’t 
want
any setups to adjust the vertical spacing which is easy here with \AR etc. but
for complicated layouts and tables with lots of texts tabulate and TABLE are
better suited.

 Or as already suggested the \bTABLE … \eTABLE or the new xtable-environment.

For short tables with a complex layout you can use \startTABLE.

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
___