[NTG-context] Lua code and table

Hans Hagen j.hagen at xs4all.nl
Wed Feb 17 23:52:58 CET 2021


On 2/17/2021 10:26 PM, Wolfgang Schuster wrote:
> Fabrice Couvreur schrieb am 17.02.2021 um 18:40:
>> Hi,The code works, but is it possible to make it shorter ?
>> Thank you
>> Fabrice
>>
>>
>> \startuseMPgraphic{DiagonalRule}
>>     rulethickness := \frameddimension{rulethickness};
>>
>>     drawoptions(
>>       withpen pencircle scaled rulethickness
>>       withcolor \MPcolor{\framedparameter{framecolor}});
>>
>>     pair leftcorner, rightcorner, Leftcorner, Rightcorner;
>>     leftcorner  := (rulethickness, \overlayheight-rulethickness);
>>     rightcorner := (\overlaywidth-rulethickness, rulethickness);
>>     Leftcorner  := ( rulethickness, rulethickness);
>>     Rightcorner := 
>> (\overlaywidth-rulethickness,\overlayheight-rulethickness);
>>
>>     draw leftcorner -- rightcorner;
>>     draw Leftcorner -- Rightcorner;
>>   \stopuseMPgraphic
> 
> 
> \startuseMPgraphic{DiagonalRule}
>      drawoptions(
>          withpen pencircle scaled OverlayLineWidth
>          withcolor OverlayLineColor
>      );
> 
>      draw ulcorner OverlayBox -- lrcorner OverlayBox ;
>      draw llcorner OverlayBox -- urcorner OverlayBox ;
> \stopuseMPgraphic
Often this also works:

\startuseMPgraphic{DiagonalRule}
     draw image (
         draw ulcorner OverlayBox -- lrcorner OverlayBox ;
         draw llcorner OverlayBox -- urcorner OverlayBox ;
     )
         withpen pencircle scaled OverlayLineWidth
         withcolor OverlayLineColor ;
\stopuseMPgraphic


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


More information about the ntg-context mailing list