On 3/19/2017 7:29 PM, Aditya Mahajan wrote:
On Sun, 19 Mar 2017, Aditya Mahajan wrote:
On Tue, 20 Dec 2016, Alan Braslau wrote:
On Mon, 19 Dec 2016 08:19:25 -0800 Aditya Mahajan
wrote: The ability to pass parameters to metapost has been around since the beginning. See the metafun manual for details (search for MPvar).
Hans has developed tools making it quite easy to pass data back and forth between MetaPost and lua. This is quite efficient, and it is being used more and more in the development of macro functionality.
I finally need to write a macro where I want to pass data from lua to metapost. I could not find an example in the source code showing this. Can someone show a basic example of how lua-metapost interface works or point me to the appropriate files in the source.
Found some information in the CLD manual. That is sufficient for the task at hand for me. But a pointer to a more detailed source will be welcome.
real low level \starttext \startluacode document.mydata = { foo = "foo", bar = 123 } \stopluacode \startMPcode draw fullcircle scaled lua("mp.print(document.mydata.bar)") ; draw textext (lua("mp.quoted(document.mydata.foo)")) ; \stopMPcode \stoptext i'll mail you the new chapter in the metafun manual ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------