[NTG-context] Natural Tables Cell Borders

Wolfgang Schuster schuster.wolfgang at googlemail.com
Wed Jan 6 12:54:23 CET 2010

Am 05.01.2010 um 04:02 schrieb Curiouslearn:

> Thanks Wolfgang. I am not yet proficient enough in Metapost or Context
> to understand your code. But will look at it more carefully later.
> Meanwhile, is there any further work going on on Natural Tables? Are
> there plans to introduce the ability to have borders of different
> thickness for the same cell through simple options.

A TeX based solution won't be possible without Hans but you can set
the values in TeX (\framed, \setupTABLE) and use them in MetaPost.

The following example show you what can be done.



%linecap := butt ;

numeric FrameOffset, LeftRuleThickness, RightRuleThickness, TopRuleThickness, BottomRuleThickness ;

FrameOffset         := \frameddimension{frameoffset}         ;
LeftRuleThickness   := \frameddimension{leftrulethickness}   ;
RightRuleThickness  := \frameddimension{rightrulethickness}  ;
TopRuleThickness    := \frameddimension{toprulethickness}    ;
BottomRuleThickness := \frameddimension{bottomrulethickness} ;

pair lt, rt, lb, rb ;

lt = (FrameOffset/2,OverlayHeight-FrameOffset/2) ;
rt = (OverlayWidth-FrameOffset/2,OverlayHeight-FrameOffset/2) ;
lb = (FrameOffset/2,FrameOffset/2) ;
rb = (OverlayWidth-FrameOffset/2,FrameOffset/2) ;

draw lt--rt withpen pencircle scaled TopRuleThickness    ;
draw lb--rb withpen pencircle scaled BottomRuleThickness ;
draw lb--lt withpen pencircle scaled LeftRuleThickness   ;
draw rb--rt withpen pencircle scaled RightRuleThickness  ;

setbounds currentpicture to OverlayBox ;


  [%\edef\topframeparameter   {\framedparameter\c!topframe   }%
   %\edef\leftframeparameter  {\framedparameter\c!leftframe  }%
   %\edef\rightframeparameter {\framedparameter\c!rightframe }%

  [   toprulethickness=\framedparameter{rulethickness},
%              topframe=on,
%           bottomframe=on,
%             leftframe=on,
%            rightframe=on,





        \bTD 1 \eTD
        \bTD 2 \eTD
        \bTD 3 \eTD
        \bTD 4 \eTD
        \bTD 5 \eTD
        \bTD 6 \eTD
        \bTD 7 \eTD
        \bTD 8 \eTD
        \bTD 9 \eTD




More information about the ntg-context mailing list