On Thu, 9 Aug 2007, Wolfgang Schuster wrote:

2007/8/9, Hamid Kamrani <[EMAIL PROTECTED]>:
Aditya,

In the example you give with CMID you have only two column preambles
whereas the table has 3 columns and if one adds the missing preamble
then one gets an error. Some how your new code breaks the calculation
for number of columns.

-Hamid

He forgot only to put a \NC before the \AR.

Sorry about that. I thought I pasted from a correctly running example.

Here is another attempt, which I feel is the cleanest way to go about this whole thing. Right now the skip between the columns is not configurable, but it should be possible to use the get the value of the skip.

The attached code typesets an example that Wolfgang had sent off-list. I have only changed two lines of the table.tex.

Aditya
\TracingFormats=2

\starttext
\unprotect
% SET VRULE: Invoked by the key "|"
\def\!tfSetVrule{%
  \!thToksEdef\!taRuleColumnTemplate={%
    \noexpand\hfil
    \noexpand\vrule
    \noexpand\!thWidth
    \ifnum \!tgCode=1
      \ifx \!tgValue\empty
        \the\LineThicknessFactor      % Default integer
      \else
        \!tgValue                     % User-specified integer
      \fi
      \!taLTU                         % \LineThicknessUnit
    \else
      \!tgValue                       % User-specified dimension
    \fi
    ####%
    \noexpand\hfil
    \the\!taRuleColumnTemplate%      % has \tabskips, when column number=0
    \ifnum\!taColumnNumber=\zerocount\else\tabskip2em\fi}%ADDED (should be 
configurable)
  \!tfAdjoinPriorColumn}

\def\!tfAdjoinPriorColumn{%
  \ifnum \!taColumnNumber=0
    \!taPreamble=\!taRuleColumnTemplate % New \tabskip may have been added
    \ifnum \TracingFormats>0
      \!tfShowRuleTemplate
    \fi
  \else
    \ifx\!tfRowOfWidths\empty  % no "w" keys specified yet, not even this col
    \else
      \!tfUpdateRowOfWidths
    \fi
    % Adjoin positioning glues to left and right of template
    \!thToksEdef\!taDataColumnTemplate={%
      \the \!taLeftGlue
      \the \!taDataColumnTemplate
      \the \!taRightGlue
      \tabskip\zeropoint}%ADDED
    \ifnum \TracingFormats>0
      \!tfShowTemplates
    \fi
    % Adjoin data- and rule-column templates to preamble
    \!thToksEdef\!taPreamble={%
      \the\!taPreamble
      &
      \the\!taDataColumnTemplate
      &
      \the\!taRuleColumnTemplate}
  \fi
%
% START NEW COLUMN
  \advance \!taColumnNumber 1
  % Initialize data-column template, restoring last "regular" tabskip
  % after a "once only" tabskip
  \if!taOnceOnlyTabskip
    \!thToksEdef\!taDataColumnTemplate={%
       ####\tabskip \the\!taLastRegularTabskip}
  \else
    \!taDataColumnTemplate{##}%
  \fi
  % Remaining initializations
  \!taRuleColumnTemplate{}% # is inserted by \SetVrule, or \SetAlternateVrule
  \!taLeftGlue{\hfil}%         % Default positioning is "center"
  \!taRightGlue{\hfil}%
  \!taMinimumColumnWidth=0pt
  \def\!tfWidthText{}%
  \!taOnceOnlyTabskipfalse    % Set true by key "o"
  \ReadFormatKeys}

\def\CM{\normalTABLEshortrule}

\protect



\starttable[s0|l|l|c|]
  \HL[3]
% \TABLEnoalign{\unprotect\showthe\!taPreamble\protect}
  \NC \Use3[c]{Kase-Ubersicht} \NC \AR
  \HL[2]
  \NC Kase                \NC Herkunftsland \NC Preis (Euro) \NC \AR
  \NC \CM                 \NC \CM           \NC \CM          \NC \DR
  \NC Edamer              \NC Holland       \NC 12.23        \NC \AR
  \NC Gouda               \NC Holland       \NC 9.34         \NC \AR
  \NC Emmentaler          \NC Allgau        \NC 2.34         \NC \AR
  \NC Andechser Bierkase  \NC Bayern        \NC 1.--         \NC \AR
  \HL[3]
\stoptable
\stoptext
___________________________________________________________________________________
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