[NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-13 Thread Gerben Wierda
Suppose I have this code: \startMPpage vardef MyShape(expr w, h) = save pth; path pth ; save pic; picture pic; pth = fullsquare xysized (w, h); pic := image ( draw pth; % all kind of stuff here ); setbounds pic to pth; pic enddef ; picture s ; s := MyShape(4cm,

Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-13 Thread Taco Hoekwater
Hi, > On 13 Mar 2020, at 12:53, Gerben Wierda wrote: > > Suppose I have this code: > > > Can I reuse that varied across follow-up MPPages? Sure, put the vardef inside \startMPinclusions: \startMPinclusions vardef MyShape(expr w, h) = ... enddef ; \stopMPinclusions \startMPpage picture s

Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-13 Thread Aditya Mahajan
On Fri, 13 Mar 2020, Taco Hoekwater wrote: Hi, On 13 Mar 2020, at 12:53, Gerben Wierda wrote: Suppose I have this code: Can I reuse that varied across follow-up MPPages? Sure, put the vardef inside \startMPinclusions: or \startMPdefinitions ... \stopMPdefinitions (don't remember what

Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-13 Thread Gerben Wierda
Thank you. And if I want these in a separate file, what is the correct way to include them? > On 13 Mar 2020, at 13:24, Taco Hoekwater wrote: > > Hi, > > > >> On 13 Mar 2020, at 12:53, Gerben Wierda wrote: >> >> Suppose I have this code: >> >> >> Can I reuse that varied across follow-up

Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-13 Thread Hans Hagen
On 3/13/2020 2:33 PM, Aditya Mahajan wrote: On Fri, 13 Mar 2020, Taco Hoekwater wrote: Hi, On 13 Mar 2020, at 12:53, Gerben Wierda wrote: Suppose I have this code: Can I reuse that varied across follow-up MPPages? Sure, put the vardef inside \startMPinclusions: or \startMPdefinition