Aditya Mahajan wrote:
On Sun, 8 Mar 2009, Wolfgang Schuster wrote:

Hi Hans,

natural tables are perfect to create tables with a fixed size for the cells but the syntax requires sometimes a lot of typing for small content and takes
to many lines of code in the document.

less code and more efficient too ... can you test this?

\def\startTABLE
  {\dosingleempty\dostartTABLE}

\def\dostartTABLE[#1]%
  {\bgroup
   \bTABLE[#1]%
   \let\NC\doTABLENC
   \let\NR\doTABLENR
   \let\bTR\relax
   \let\bTD\relax
   \let\bTH\relax
   \let\bTN\relax}

\def\stopTABLE
  {\eTABLE
   \egroup}

\newconditional\inTABLEnc

\unexpanded\def\doTABLENR
  {\eTR
   \setfalse\inTABLEnc}

\unexpanded\def\doTABLENC
  {\futurelet\next\dodoTABLENC}

\def\dodoTABLENC
  {\ifx\next\doTABLENR \else
     \expandafter\dododoTABLENC
   \fi}

\long\def\dododoTABLENC#1\NC
  {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi
   \parseTD[][]#1\eTD\NC}

watch the relaxing of the b commands, so that we catch mixed usage

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.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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to