On 9/9/2018 6:04 PM, Wolfgang Schuster wrote:
Hi,
the height variable in the EnglishRule graphic needs an assignment,
otherwise you get a error when there is a previous graphic which also
use height as a variable name.
meta-imp-txt.mkiv:
\startuniqueMPgraphic{EnglishRule}{height,width,color}
- height = \MPvar{height} ;
+ height := \MPvar{height} ;
x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ;
y1 = y3 = 0 ; y2 = -y4 = height/2 ;
fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ;
\stopuniqueMPgraphic
or just
\startuniqueMPgraphic{EnglishRule}{height,width,color}
x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ;
y1 = y3 = 0 ; y2 = -y4 = \MPvar{height}/2 ;
fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ;
\stopuniqueMPgraphic
Example (the graphic for the title page in the module documentation uses
height as variable):
\usemodule[module-basic]
\useMPlibrary[txt]
\startdocument
\useMPgraphic{EnglishRule}
\stopdocument
Wolfgang
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-context
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-context