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

2020-03-16 Thread Aditya Mahajan
On Mon, 16 Mar 2020, Gerben Wierda wrote: This worked when I was just doing METAPOST. Now, I am using my lua code to produce the METAPOST code that produces the pictures. And the picture itself is put in a file for METAPOST as follows: File test4-mplib-run-001.mp: % begin graphic: n=0 ;

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

2020-03-16 Thread Gerben Wierda
This worked when I was just doing METAPOST. Now, I am using my lua code to produce the METAPOST code that produces the pictures. And the picture itself is put in a file for METAPOST as follows: File test4-mplib-run-001.mp: % begin graphic: n=0 ; beginfig(1) ;

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

2020-03-14 Thread Gerben Wierda
> On 13 Mar 2020, at 14:59, Hans Hagen wrote: > > 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

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

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 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

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

[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 :=