Re: [NTG-context] metafun 2
On Sun, 8 Sep 2019, Otared Kavian wrote: Hi Aditya, I wanted also to point out a typo on that page (two occurrences), namely "ploles" instead of "poles", in the explanations before the actual code. Thanks. Fixed. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Hi Aditya, As usual you show us a very nice and very clear example to taech nice features of ConTeXt: thank you so much! I wanted also to point out a typo on that page (two occurrences), namely "ploles" instead of "poles", in the explanations before the actual code. Best regard: > On 8 Sep 2019, at 10:42, Aditya Mahajan wrote: > > On Wed, 14 Aug 2019, Hans Hagen wrote: > >> Hi, >> >> In the process of providing an additional (more abstract) interface to some >> of the old and also new MetaFun code we wonder what kind of features users >> would like to see. >> >> http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf > > Finally got around to playing around with the new interface. Here is an > example of how to define new key-value driven macros in metapost: > > https://adityam.github.io/context-blog/post/new-metafun-interface/ > > Aditya > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On Wed, 14 Aug 2019, Hans Hagen wrote: Hi, In the process of providing an additional (more abstract) interface to some of the old and also new MetaFun code we wonder what kind of features users would like to see. http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf Finally got around to playing around with the new interface. Here is an example of how to define new key-value driven macros in metapost: https://adityam.github.io/context-blog/post/new-metafun-interface/ Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Thanks a lot for the new features. In my system this code don’t work. macOS Mojave This is LuaMetaTeX, Version 2.00.0 open source > level 1, order 1, name 'cont-yes.mkiv' system > system > ConTeXt ver: 2019.08.17 12:16 MKIV beta fmt: 2019.8.19 int: English/English \startMPcode{doublefun} draw lmt_function [ xmin = 0, xmax = 10, xstep = .05, ymin = -2, ymax = 2, xticks = "bottom", xsmall = 80, xlarge = 20, yticks = "left", ysmall = 40, ylarge = 4, code = "1.5 * math.cosd(240 * math.sqrt(x))", xlabels = "yes", ylabels = "yes", ycaption = "\strut\tfd \rotate[rotation=90]{vertical}", xcaption = "\strut\tfd horizontal", pointsymbol = "dot", pointsize = 4, pointcolor = "orange", sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm, ] xsized 8cm ; \stopMPcode The output error: loading metafun, including plain.mp version 1.004 for metafun iv and xl pages > flushing realpage 9, userpage 8, subpage 9 metapost log> ! Missing ':' has been inserted. metapost log> metapost log>addto metapost log> draw->addto metapost log> .currentpicture.if.picture(EXPR0):also(EXPR0)else:doublepath(EXPR… ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Hi Hans, Alan, This is really cool! Not sure how I missed this feature, works exactly for my use-case. Thanks a lot for pointing this out, I was able to find it in the MAPS as well. Cheers, Adam On Sat, Aug 17, 2019 at 9:52 AM Hans Hagen wrote: > On 8/17/2019 3:27 AM, Alan Braslau wrote: > > We have eofill in MP (in pdf/ps in fact) and that likely will do what > you need. > You forgot the MWD (Minimal Working Demo): > > \starttext > > \startMPpage > path p ; p := fullcircle scaled 1cm ; > path q ; q := fullcircle scaled .5cm ; > > nofill p ; > eofill q ; > \stopMPpage > > \stoptext > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On 8/17/2019 3:27 AM, Alan Braslau wrote: We have eofill in MP (in pdf/ps in fact) and that likely will do what you need. You forgot the MWD (Minimal Working Demo): \starttext \startMPpage path p ; p := fullcircle scaled 1cm ; path q ; q := fullcircle scaled .5cm ; nofill p ; eofill q ; \stopMPpage \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
We have eofill in MP (in pdf/ps in fact) and that likely will do what you need. Alan On Sat, 17 Aug 2019 00:31:38 +0100 Adam Reviczky wrote: > Hi Hans, > > One MetaPost feature that I was looking forward to is the ability to create > a fill between two shapes. > Something like a difference function of two path's. > > For logos I use the workaround with creating a path alongside the excluded > areas but it is always cumbersome. > > I have briefly mentioned it back here: > https://mailman.ntg.nl/pipermail/ntg-context/2011/056910.html > > Just for illustration purposes, if I wanted to fill the area in between two > circles: > > *path p ; > **p := fullcircle scaled 1cm ; > **path q ; > **q := fullcircle scaled .5cm ; > * > > Instead of creating a new path along both circles with: > > > *r := p -- reverse q -- cycle ;* > > It would be nice to have something like: > > *fill p excluding q ;* > > or something like that. > > I mainly have use-cases for differences in shapes, but filling the > intersection of two shapes would be the same idea. > > Thanks, > Adam > > > On Wed, Aug 14, 2019 at 10:57 AM Hans Hagen wrote: > > > Hi, > > > > In the process of providing an additional (more abstract) interface to > > some of the old and also new MetaFun code we wonder what kind of > > features users would like to see. > > > > http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf > > > > As a teaser I uploaded a MyWay document that shows some of what is > > coming. All is experimental but it shows the direction. We're talking > > ConTeXt LMTX here. For instance, > > > > draw lmt_outline [ > > content = "hello", > > kind = "reverse", > > fillcolor = "darkred", > > drawcolor = "darkblue", > > rulethickness = 1/2, > > ] ysized h shifted (3.75h,-1.25h) ; > > > > Wraps all the outline drawing in one macro with a set of options (there > > will be xml interface definitions for that). Or take: > > > > draw lmt_followtext [ > > content = "How well does it work {\bf 1}! ", > > path= (fullcircle scaled 4cm), > > trace = true, > > spread = true, > > ] ysized 5cm ; > > > > which is an easier interface to text along a curve. Arrows can be drawn > > with > > > > draw lmt_arrow [ > > kind= "draw", > > location= "middle", > > alternative = "curved", > > path= fullcircle > > scaled 3cm > > shifted (3.5cm,0cm), > > ] withcolor "darkblue" ; > > > > but of course the low level interface with its many variables for > > tweaking stays around. Other examples are shown in the mentioned document. > > > > So the question is: What do you miss in metapost support? Of course it > > should fit within the concept, so 'artistic freehand drawings' is not > > something that is likely to get interfaced. We are particularly > > interested in educational applications, if only because ConTeXt started > > out that way. > > > > Hans > > > > > > > > - > >Hans Hagen | PRAGMA ADE > >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > > - > > > > ___ > > If your question is of interest to others as well, please add an entry to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > > ___ > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Hi Hans, One MetaPost feature that I was looking forward to is the ability to create a fill between two shapes. Something like a difference function of two path's. For logos I use the workaround with creating a path alongside the excluded areas but it is always cumbersome. I have briefly mentioned it back here: https://mailman.ntg.nl/pipermail/ntg-context/2011/056910.html Just for illustration purposes, if I wanted to fill the area in between two circles: *path p ; **p := fullcircle scaled 1cm ; **path q ; **q := fullcircle scaled .5cm ; * Instead of creating a new path along both circles with: *r := p -- reverse q -- cycle ;* It would be nice to have something like: *fill p excluding q ;* or something like that. I mainly have use-cases for differences in shapes, but filling the intersection of two shapes would be the same idea. Thanks, Adam On Wed, Aug 14, 2019 at 10:57 AM Hans Hagen wrote: > Hi, > > In the process of providing an additional (more abstract) interface to > some of the old and also new MetaFun code we wonder what kind of > features users would like to see. > > http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf > > As a teaser I uploaded a MyWay document that shows some of what is > coming. All is experimental but it shows the direction. We're talking > ConTeXt LMTX here. For instance, > > draw lmt_outline [ > content = "hello", > kind = "reverse", > fillcolor = "darkred", > drawcolor = "darkblue", > rulethickness = 1/2, > ] ysized h shifted (3.75h,-1.25h) ; > > Wraps all the outline drawing in one macro with a set of options (there > will be xml interface definitions for that). Or take: > > draw lmt_followtext [ > content = "How well does it work {\bf 1}! ", > path= (fullcircle scaled 4cm), > trace = true, > spread = true, > ] ysized 5cm ; > > which is an easier interface to text along a curve. Arrows can be drawn > with > > draw lmt_arrow [ > kind= "draw", > location= "middle", > alternative = "curved", > path= fullcircle > scaled 3cm > shifted (3.5cm,0cm), > ] withcolor "darkblue" ; > > but of course the low level interface with its many variables for > tweaking stays around. Other examples are shown in the mentioned document. > > So the question is: What do you miss in metapost support? Of course it > should fit within the concept, so 'artistic freehand drawings' is not > something that is likely to get interfaced. We are particularly > interested in educational applications, if only because ConTeXt started > out that way. > > Hans > > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On Wed, Aug 14, 2019 at 10:18:19PM +1200, Henri Menke wrote: > I just wanted to ask, will LMTX and MetaFun remain valid implementations > of TeX and MetaPost or do we have to expect incompatibilities? If you mean “will luametatex pass the trip test”, the answer is probably no: LuaTeX already diverged from Knuth’s TeX in small ways, for example by allowing the first word of a paragraph to be hyphenated. Best, Arthur ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On 8/14/2019 4:58 PM, Mikael P. Sundqvist wrote: 1) 3d support. This is of course a very big request, but it would also be useful for many people. yes ... Alan and I are thinking of some (not that we came far yet) 2) About graphing, it would be nice to be able to do contour polots and density plots. I know I asked for contour plots some time ago, and there were some examples, but I don't think there was ever some built in support for it. Maybe that can be done "easy" with help of lua? I guess there exist good algorithms. spec needed ... as 'code' can be any function it's mostly a matter of what to pipe back to mp 3) (small) The possibility to have arrows in coordinate axes. I have not had the possibility to test the new features today, and maybe this is already built in (drawarrow?), but I mention it since I did not see it in the pdf. no, but that is rather trivial to add Again, it is very nice that you work on extending MetaPost/MetaFun further!! wel, mp is ... fun (and these extension are somewhat challenging) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On 8/14/2019 4:58 PM, Otared Kavian wrote: On 14 Aug 2019, at 16:53, Aditya Mahajan wrote: […] This looks like a typical .. vs -- issue. I think there is a way to change how the points are connected, but I'll have to look at the code again. Aditya Indeed, this seems the right explanation. @ Hans: would it be possible to change the connecting mechanism from .. to -- ? (Possibly by adding an option?) shape = "line" Thanks for your attention, Best regards: OK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Otared Kavian schrieb am 14.08.2019 um 16:58: On 14 Aug 2019, at 16:53, Aditya Mahajan wrote: […] This looks like a typical .. vs -- issue. I think there is a way to change how the points are connected, but I'll have to look at the code again. Aditya Indeed, this seems the right explanation. @ Hans: would it be possible to change the connecting mechanism from .. to -- ? (Possibly by adding an option?) draw lmt_function [ shape = "line", ... ] ; The argument for shape doesn't matter because only 'shape = "contour"' is checked to use .. as connector. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On Wed, Aug 14, 2019 at 11:55 AM Hans Hagen wrote: > Hi, > > In the process of providing an additional (more abstract) interface to > some of the old and also new MetaFun code we wonder what kind of > features users would like to see. > > http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf > > As a teaser I uploaded a MyWay document that shows some of what is > coming. All is experimental but it shows the direction. We're talking > ConTeXt LMTX here. For instance, > > draw lmt_outline [ > content = "hello", > kind = "reverse", > fillcolor = "darkred", > drawcolor = "darkblue", > rulethickness = 1/2, > ] ysized h shifted (3.75h,-1.25h) ; > > Wraps all the outline drawing in one macro with a set of options (there > will be xml interface definitions for that). Or take: > > draw lmt_followtext [ > content = "How well does it work {\bf 1}! ", > path= (fullcircle scaled 4cm), > trace = true, > spread = true, > ] ysized 5cm ; > > which is an easier interface to text along a curve. Arrows can be drawn > with > > draw lmt_arrow [ > kind= "draw", > location= "middle", > alternative = "curved", > path= fullcircle > scaled 3cm > shifted (3.5cm,0cm), > ] withcolor "darkblue" ; > > but of course the low level interface with its many variables for > tweaking stays around. Other examples are shown in the mentioned document. > > So the question is: What do you miss in metapost support? Of course it > should fit within the concept, so 'artistic freehand drawings' is not > something that is likely to get interfaced. We are particularly > interested in educational applications, if only because ConTeXt started > out that way. > > Hans > > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > Hi, this looks very promising!! Since you ask for feature requests: 1) 3d support. This is of course a very big request, but it would also be useful for many people. 2) About graphing, it would be nice to be able to do contour polots and density plots. I know I asked for contour plots some time ago, and there were some examples, but I don't think there was ever some built in support for it. Maybe that can be done "easy" with help of lua? I guess there exist good algorithms. 3) (small) The possibility to have arrows in coordinate axes. I have not had the possibility to test the new features today, and maybe this is already built in (drawarrow?), but I mention it since I did not see it in the pdf. Again, it is very nice that you work on extending MetaPost/MetaFun further!! /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
> On 14 Aug 2019, at 16:53, Aditya Mahajan wrote: > > […] > This looks like a typical .. vs -- issue. I think there is a way to change > how the points are connected, but I'll have to look at the code again. > > Aditya Indeed, this seems the right explanation. @ Hans: would it be possible to change the connecting mechanism from .. to -- ? (Possibly by adding an option?) Thanks for your attention, Best regards: OK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On Wed, 14 Aug 2019, Otared Kavian wrote: Hi Hans, Thank you very much for the new features! I haven't yet read all the mag-1104-mkiv.pdf where you explain some of them, but after modifying one of your examples, I noticed that some funtions get a strange graph, which is probably due to the fact that metafun2 is interpolating between points in a way which is not correct. For instance, in the following example (which is a slight modification of yours), the curve drawn is not a graph, in the sense that for some values of x it seems to be two or more values of y. How does metafun 2 traces the curve between two discretization points? Best regards: OK %%% begin draw-2.tex \starttext \startMPcode{doublefun} draw lmt_function [ xmin = 1.0, xmax = 2.5066283, xstep = .1, ymin = -2, ymax = 2, % xticks = "bottom", xsmall = 80, xlarge = 20, % yticks = "left", ysmall = 40, ylarge = 4, code = "1.5 * math.sin(2*x^2)", xlabels = "yes", ylabels = "yes", ycaption = "\strut\tfd \rotate[rotation=90]{vertical}", xcaption = "\strut\tfd horizontal", pointsymbol = "dot", pointsize = 4, pointcolor = "orange", sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm, ] xsized 8cm ; \stopMPcode \stoptext This looks like a typical .. vs -- issue. I think there is a way to change how the points are connected, but I'll have to look at the code again. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On 8/14/2019 4:22 PM, Otared Kavian wrote: Hi Hans, Thank you very much for the new features! I haven't yet read all the mag-1104-mkiv.pdf where you explain some of them, but after modifying one of your examples, I noticed that some funtions get a strange graph, which is probably due to the fact that metafun2 is interpolating between points in a way which is not correct. For instance, in the following example (which is a slight modification of yours), the curve drawn is not a graph, in the sense that for some values of x it seems to be two or more values of y. How does metafun 2 traces the curve between two discretization points? it doesn't, it just connects the dots, so, just use a smaller step, like xstep = .01 (The upcoming luagraph module will provide some interpolators so at some point we can hook these in.) (btw, there are a lot of extra math functions, also or complex numbers) Best regards: OK %%% begin draw-2.tex \starttext \startMPcode{doublefun} draw lmt_function [ xmin = 1.0, xmax = 2.5066283, xstep = .1, ymin = -2, ymax = 2, % xticks = "bottom", xsmall = 80, xlarge = 20, % yticks = "left", ysmall = 40, ylarge = 4, code = "1.5 * math.sin(2*x^2)", xlabels = "yes", ylabels = "yes", ycaption = "\strut\tfd \rotate[rotation=90]{vertical}", xcaption = "\strut\tfd horizontal", pointsymbol = "dot", pointsize = 4, pointcolor = "orange", sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm, ] xsized 8cm ; \stopMPcode \stoptext %%% end draw-2.tex Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Hi Hans, Thank you very much for the new features! I haven't yet read all the mag-1104-mkiv.pdf where you explain some of them, but after modifying one of your examples, I noticed that some funtions get a strange graph, which is probably due to the fact that metafun2 is interpolating between points in a way which is not correct. For instance, in the following example (which is a slight modification of yours), the curve drawn is not a graph, in the sense that for some values of x it seems to be two or more values of y. How does metafun 2 traces the curve between two discretization points? Best regards: OK %%% begin draw-2.tex \starttext \startMPcode{doublefun} draw lmt_function [ xmin = 1.0, xmax = 2.5066283, xstep = .1, ymin = -2, ymax = 2, % xticks = "bottom", xsmall = 80, xlarge = 20, % yticks = "left", ysmall = 40, ylarge = 4, code = "1.5 * math.sin(2*x^2)", xlabels = "yes", ylabels = "yes", ycaption = "\strut\tfd \rotate[rotation=90]{vertical}", xcaption = "\strut\tfd horizontal", pointsymbol = "dot", pointsize = 4, pointcolor = "orange", sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm, ] xsized 8cm ; \stopMPcode \stoptext %%% end draw-2.tex draw-2.pdf Description: Adobe PDF document > On 14 Aug 2019, at 11:54, Hans Hagen wrote: > > Hi, > > In the process of providing an additional (more abstract) interface to some > of the old and also new MetaFun code we wonder what kind of features users > would like to see. > > http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf > > As a teaser I uploaded a MyWay document that shows some of what is coming. > All is experimental but it shows the direction. We're talking ConTeXt LMTX > here. For instance, > >draw lmt_outline [ >content = "hello", >kind = "reverse", >fillcolor = "darkred", >drawcolor = "darkblue", >rulethickness = 1/2, >] ysized h shifted (3.75h,-1.25h) ; > > Wraps all the outline drawing in one macro with a set of options (there will > be xml interface definitions for that). Or take: > >draw lmt_followtext [ >content = "How well does it work {\bf 1}! ", >path= (fullcircle scaled 4cm), >trace = true, >spread = true, >] ysized 5cm ; > > which is an easier interface to text along a curve. Arrows can be drawn with > >draw lmt_arrow [ >kind= "draw", >location= "middle", >alternative = "curved", >path= fullcircle >scaled 3cm >shifted (3.5cm,0cm), >] withcolor "darkblue" ; > > but of course the low level interface with its many variables for tweaking > stays around. Other examples are shown in the mentioned document. > > So the question is: What do you miss in metapost support? Of course it should > fit within the concept, so 'artistic freehand drawings' is not something that > is likely to get interfaced. We are particularly interested in educational > applications, if only because ConTeXt started out that way. > > Hans > > > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On 8/14/2019 1:31 PM, Floris van Manen wrote: where can i find the steps to install lmtx next to my current context luatex ? http://pragma-ade.nl/install.htm - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
where can i find the steps to install lmtx next to my current context luatex ? .F pEpkey.asc Description: application/pgp-keys ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
On 8/14/2019 12:18 PM, Henri Menke wrote: Dear Hans, I just wanted to ask, will LMTX and MetaFun remain valid implementations of TeX and MetaPost or do we have to expect incompatibilities? It depends on how you define 'valid' ... we're downward compatible ... but LMTX will use features available in luametatex, so when that is the case some code will only be available in LMTX (unless i decide to backport some). Wrr the TeX part: LMTX is mostly MKIV but it might provide extra things (or different implementations). Wrr metapost: lmtx can do more advanced things. There is a split context code base. I expect most users to move on to lmtx anyway at some point. Maybe at some point the existing mkiv will be like mkii: frozen. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] metafun 2
Dear Hans, I just wanted to ask, will LMTX and MetaFun remain valid implementations of TeX and MetaPost or do we have to expect incompatibilities? Cheers, Henri On 14/08/19 9:54 PM, Hans Hagen wrote: > Hi, > > In the process of providing an additional (more abstract) interface to > some of the old and also new MetaFun code we wonder what kind of > features users would like to see. > > http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf > > As a teaser I uploaded a MyWay document that shows some of what is > coming. All is experimental but it shows the direction. We're talking > ConTeXt LMTX here. For instance, > > draw lmt_outline [ > content = "hello", > kind = "reverse", > fillcolor = "darkred", > drawcolor = "darkblue", > rulethickness = 1/2, > ] ysized h shifted (3.75h,-1.25h) ; > > Wraps all the outline drawing in one macro with a set of options (there > will be xml interface definitions for that). Or take: > > draw lmt_followtext [ > content = "How well does it work {\bf 1}! ", > path= (fullcircle scaled 4cm), > trace = true, > spread = true, > ] ysized 5cm ; > > which is an easier interface to text along a curve. Arrows can be drawn > with > > draw lmt_arrow [ > kind= "draw", > location= "middle", > alternative = "curved", > path= fullcircle > scaled 3cm > shifted (3.5cm,0cm), > ] withcolor "darkblue" ; > > but of course the low level interface with its many variables for > tweaking stays around. Other examples are shown in the mentioned document. > > So the question is: What do you miss in metapost support? Of course it > should fit within the concept, so 'artistic freehand drawings' is not > something that is likely to get interfaced. We are particularly > interested in educational applications, if only because ConTeXt started > out that way. > > Hans > > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___