[NTG-context] RE : upload / metafun

2020-12-15 Thread Joseph
HagenEnvoyé le :mardi 15 décembre 2020 10:35À : mailing list for ConTeXt usersObjet :[NTG-context] upload / metafun Hi, I uploaded a new lmtx. This time some work has been done at the metafun end. At the tex end we're working on some overload protection mechanism which involves tagging many macro so

[NTG-context] upload / metafun

2020-12-15 Thread Hans Hagen
Hi, I uploaded a new lmtx. This time some work has been done at the metafun end. At the tex end we're working on some overload protection mechanism which involves tagging many macro so that will take a while (most tagging is done but checking left over cases take time). So, I wondered if we

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Hans Hagen
back in the day, I would never try to use fonts for "drawing". Especially, math fonts, where every designer has a different idea of what the shape should look like. ah pictex memories ... drawing lines with cmr5 periods ... but actually, we can define a stable font with symbols in me

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Aditya Mahajan
On Thu, 10 Dec 2020, Hans Hagen wrote: > > dotlabel uses a pen to draw the dot, and I am not sure why it uses that > > rather > > than a path. Here is a (to me) simpler definition, where you can change the > > shape: > > just look in the pdf ... in your case the dot is a n point path while >

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Hans Hagen
it not conflict with the internal definitions of dotlabel in Metafun in some other place? Maybe it is safer for me to call it something like « dotshapelabel » ? In general, I agree. Redefining internal macros has the advantage that your code doesn't have to change. See, for example: it depends a bit

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Hans Hagen
On 12/10/2020 6:44 PM, Aditya Mahajan wrote: On Thu, 10 Dec 2020, Otared Kavian wrote: Hi all, In Metafun when representing a point I woul dlike to have some dots represented by a square (or even by another scalable symbol): for instance in the following I would like the dot at the point B

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Aditya Mahajan
with the internal definitions > of dotlabel in Metafun in some other place? > Maybe it is safer for me to call it something like « dotshapelabel » ? In general, I agree. Redefining internal macros has the advantage that your code doesn't have to change. See, for example: https://github.com/adity

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Otared Kavian
Hi Aditya, Thank you very much ! That's great indeed, you gave me an elegant solution. One more question, in order for me to understand a little more: when defining a new dotlabel as you do, might it not conflict with the internal definitions of dotlabel in Metafun in some other place? Maybe

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Aditya Mahajan
On Thu, 10 Dec 2020, Otared Kavian wrote: > Hi all, > > In Metafun when representing a point I woul dlike to have some dots > represented by a square (or even by another scalable symbol): for instance in > the following I would like the dot at the point B to be a square:

[NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Otared Kavian
Hi all, In Metafun when representing a point I woul dlike to have some dots represented by a square (or even by another scalable symbol): for instance in the following I would like the dot at the point B to be a square: \starttext \startMPcode draw (2cm,3cm) -- (3cm,5cm) ; dotlabel(textext

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Hans Hagen
On 12/9/2020 9:38 PM, Aditya Mahajan wrote: Or just redefine shortened to accept a pair! \startMPdefinitions primarydef p shortened d = reverse ( ( reverse (p enlonged -xpart paired(d)) ) enlonged -ypart paired(d) ) enddef ; \stopMPdefinitions patched but then also: primarydef p

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
Thanks Aditya! One can learn a lot with your answers ! In the Metafun manual I see enlonged but I did not know to use it. Best regards: Otared > On 9 Dec 2020, at 21:38, Aditya Mahajan wrote: > > On Wed, 9 Dec 2020, Otared Kavian wrote: > >> Hi Aditya, >> >> Tha

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Aditya Mahajan
On Wed, 9 Dec 2020, Otared Kavian wrote: > Hi Aditya, > > Thanks for the alternative method, which comes handy if one wishes to extend > the straight line by a different amount at either end: > > \starttext > \startMPcode >z1 = (1cm,3cm) ; >z2 = (5cm, 9cm) ; >z3 = 1cm * dir(angle

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
hows how wonderful Metafun >> is ! > > Or, if you want to use high school algebra: > > \starttext > \startMPcode >z1 = (1cm,3cm) ; >z2 = (5cm, 9cm) ; >z3 = 1cm * dir(angle (z2 - z1)) shifted z2; >draw z1 -- z3 ; >draw z1 -- z

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Aditya Mahajan
On Wed, 9 Dec 2020, Otared Kavian wrote: > Thanks a lot ! Indeed that does the job, which shows how wonderful Metafun is > ! Or, if you want to use high school algebra: \starttext \startMPcode z1 = (1cm,3cm) ; z2 = (5cm, 9cm) ; z3 = 1cm * dir(angle (z2 - z1)) shifted z2;

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
Hi Fabrice, Thanks a lot ! Indeed that does the job, which shows how wonderful Metafun is ! Best regards: Otared > On 9 Dec 2020, at 17:19, Fabrice L wrote: > > Hi, > >> Le 9 déc. 2020 à 10:57, Otared Kavian a écrit : >> >> Hi, >> >> I have a sil

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Fabrice L
on of the line and then compute by > hand the coordinates of the new end points, but I think there is a simpler > way in Metafun to do this. The shortened operation is the solution ! See MetaFun manual section 1.18 \starttext \startMPpage z1 = (1cm,3cm) ; z2 = (5cm, 9cm) ; draw (z1--z2) shortened -1

[NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
both the end points of this segment (that is in this example, a point before z1 and a point after z2 on the straight line) . Indeed it is possible to write the equation of the line and then compute by hand the coordinates of the new end points, but I think there is a simpler way in Metafun to do

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Keith McKay
Thanks Taco! I understand much better now. I think it's best to leave the units out until the drawing stage as you suggest. Thanks again Keith McKay On Fri, 27 Nov 2020, 08:30 Taco Hoekwater, wrote: > > > > On 26 Nov 2020, at 16:09, Keith McKay wrote: > > > > Hi, > > > > I have been using

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Taco Hoekwater
> On 26 Nov 2020, at 16:09, Keith McKay wrote: > > Hi, > > I have been using xpart and ypart to extract these values from pairs of > points in a path but I wasn't getting the correct result. I was expecting: > > pair (2cm, 11cm) to give xpart 2 and ypart 11 As explained by various people,

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
/First « //uniformdeviate(1) - 0.5// » could be modified to « //uniformdeviate(0.5)//»./ / / /To add noise, you can use the randomized function of Metafun. For exemple, you can write:/ / / /draw pp randomized 1cm ;/ / / That's true Fabrice but in this use case I wanted a random number between

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
e xpart 2 and ypart 11 However I was getting: pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096 After much head scratching and reading the MetaPost and MetaFun manuals, I realised that the units of xpart or ypart are in Postcript points or Big Points (bp), and 1 bp is 1/72 of an inch, and

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Fabrice L
hanks > Keith McKay First « uniformdeviate(1) - 0.5 » could be modified to « uniformdeviate(0.5)». To add noise, you can use the randomized function of Metafun. For exemple, you can write: draw pp randomized 1cm ; Fabrice. > > On 26/11/2020 15:19, Fabrice L wrote: >> Hi keith, >

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Hans Hagen
of points in a path but I wasn't getting the correct result. I was expecting: pair (2cm, 11cm) to give xpart 2 and ypart 11 However I was getting: pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096 After much head scratching and reading the MetaPost and MetaFun manuals, I realised that the un

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
result. I was expecting: pair (2cm, 11cm) to give xpart 2 and ypart 11 However I was getting: pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096 After much head scratching and reading the MetaPost and MetaFun manuals, I realised that the units of xpart or ypart are in Postcript points or Bi

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Hans Hagen
art 56.6929 and ypart 311.8096 After much head scratching and reading the MetaPost and MetaFun manuals, I realised that the units of xpart or ypart are in Postcript points or Big Points (bp), and 1 bp is 1/72 of an inch, and thus to get the values of xpart or ypart in cm I would have to

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Fabrice L
ypart 11 > > However I was getting: > > pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096 > > After much head scratching and reading the MetaPost and MetaFun manuals, I > realised that the units of xpart or ypart are in Postcript points or Big > Points (bp), and 1 bp is 1

[NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
ead scratching and reading the MetaPost and MetaFun manuals, I realised that the units of xpart or ypart are in Postcript points or Big Points (bp), and 1 bp is 1/72 of an inch, and thus to get the values of xpart or ypart in cm I would have to use a correction factor. I had made the assumpt

Re: [NTG-context] Current LMTX unable to compile file metafun-positioning.tex - error on line 240

2020-11-23 Thread Giulio Bertellini
Dear All Unable to compile metafun manual with current release of LMTX for linux X86_64 and RPI 4 (both Raspberry PI OS 32 bit and Manjaro Linux ARM 64). engine: luametatex version: 2.0802, functionality level: 20201118 tex error > tex error on line 240 in file metafun-positioning.

Re: [NTG-context] Combining modes and MetaFun

2020-09-06 Thread Jan Willem Flamma
Thank you Hans, this is exactly what I need. I will wikify the examples. Kind regards,Jan Willem Flamma  From: Hans HagenSent: Friday, 4 September 2020 15:09To: mailing list for ConTeXt users; Jan Willem FlammaSubject: Re: [NTG-context] Combining modes and MetaFun On 9/4/2020 2:20 PM, Jan Willem

Re: [NTG-context] Combining modes and MetaFun

2020-09-04 Thread Hans Hagen
On 9/4/2020 2:20 PM, Jan Willem Flamma wrote: Dear list members, Is it possible to combine modes and MetaFun? In the below MWE, the \doifmode construction does not work. Kind regards, Jan Willem Flamma === \enablemode[en] %\enablemode[nl] \starttext \startbuffer[square]     u := 2cm

[NTG-context] Combining modes and MetaFun

2020-09-04 Thread Jan Willem Flamma
Dear list members, Is it possible to combine modes and MetaFun? In the below MWE, the \doifmode construction does not work. Kind regards,Jan Willem Flamma ===\enablemode[en]%\enablemode[nl] \starttext \startbuffer[square]    u := 2cm ;    draw unitsquare scaled u ; drawdblarrow (0,-0.2u)..(u

Re: [NTG-context] A dumb question about MetaFun

2020-08-16 Thread Jairo A. del Rio
y > > > > draw unitsquare scaled 1cm shifted (xcm, ycm); > > > > Page 11 of the manual metafun-p.pdf is your friend here. My recent > conversation with Taco on this list will be usefull as well. > > Also: > > \starttext > \startMPpage > % puts the cente

Re: [NTG-context] A dumb question about MetaFun

2020-08-16 Thread Taco Hoekwater
> On 16 Aug 2020, at 21:09, Keith McKay wrote: > > Jairo > > Try > > draw unitsquare scaled 1cm shifted (xcm, ycm); > > Page 11 of the manual metafun-p.pdf is your friend here. My recent > conversation with Taco on this list will be usefull as well. Also:

Re: [NTG-context] A dumb question about MetaFun

2020-08-16 Thread Keith McKay
Jairo Try draw unitsquare scaled 1cm shifted (xcm, ycm); Page 11 of the manual metafun-p.pdf is your friend here. My recent conversation with Taco on this list will be usefull as well. Best Wishes Keith On 16/08/2020 18:06, Jairo A. del Rio wrote: Hi list! A simple question

[NTG-context] A dumb question about MetaFun

2020-08-16 Thread Jairo A. del Rio
Hi list! A simple question: is there an equivalent of thetextext for a normal picture (an "image(draw ... ;)")? I want to move the center of a picture to an specific point, like this: \startMPpage draw thetextext("\tttf hello", origin) ; draw unitsquare scaled 1cm; \stopMPpage The "hello" is

Re: [NTG-context] Two questions about color in MetaFun

2020-08-13 Thread Jairo A. del Rio
Using \MPcolor does it for me. Thank you very much, Aditya :) Jairo :) El jue., 13 de ago. de 2020 a la(s) 18:47, Aditya Mahajan (adit...@umich.edu) escribió: > On Thu, 13 Aug 2020, Jairo A. del Rio wrote: > > > Hi, list! I have two questions concerning MetaFun: > > >

Re: [NTG-context] Two questions about color in MetaFun

2020-08-13 Thread Aditya Mahajan
On Thu, 13 Aug 2020, Jairo A. del Rio wrote: > Hi, list! I have two questions concerning MetaFun: > > 1st: > > What is the correct way to pass a ConTeXt named color (e.g. xwi's "maroon") > to MetaFun. Using (with \usecolors[xwi] loaded in the preamble): > > w

[NTG-context] Two questions about color in MetaFun

2020-08-13 Thread Jairo A. del Rio
Hi, list! I have two questions concerning MetaFun: 1st: What is the correct way to pass a ConTeXt named color (e.g. xwi's "maroon") to MetaFun. Using (with \usecolors[xwi] loaded in the preamble): withcolor maroon does not work. I could copy-paste definitions from ConTeXt sources

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Jairo A. del Rio
Nice, I'm reading results right now. Thank you a lot, Hans. Jairo :) El dom., 9 de ago. de 2020 a la(s) 13:05, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 8/9/2020 8:03 PM, Jairo A. del Rio wrote: > > Oh, thank you a lot, Hans, that's a really cleaner way than mine. One > > more question, is

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Hans Hagen
On 8/9/2020 8:03 PM, Jairo A. del Rio wrote: Oh, thank you a lot, Hans, that's a really cleaner way than mine. One more question, is there something similar to EmWidth for \textwidth or \linewidth? Better, a better way to access TeX dimensions? Thank you again. When you grep for EmWidth ...

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Jairo A. del Rio
...@xs4all.nl) escribió: > On 8/9/2020 5:39 PM, Jairo A. del Rio wrote: > > Hi, list! I'm doing the following to scale squares and other stuff in > > MetaPost/MetaFun. Although the following kinda works (maybe I'm just > > lucky with this), I want to know how to do a better piece from

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Hans Hagen
On 8/9/2020 5:39 PM, Jairo A. del Rio wrote: Hi, list! I'm doing the following to scale squares and other stuff in MetaPost/MetaFun. Although the following kinda works (maybe I'm just lucky with this), I want to know how to do a better piece from it. I'm concerned with passing data from Lua

[NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Jairo A. del Rio
Hi, list! I'm doing the following to scale squares and other stuff in MetaPost/MetaFun. Although the following kinda works (maybe I'm just lucky with this), I want to know how to do a better piece from it. I'm concerned with passing data from Lua and TeX to Metapost and better ways to do

Re: [NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Fabrice Couvreur
Hello Taco Thank you so much ; I did not know the reverse operator. Fabrice Le jeu. 23 juil. 2020 à 11:56, Taco Hoekwater a écrit : > > > > On 23 Jul 2020, at 11:48, Fabrice Couvreur > wrote: > > > > Hello, > > I have a little problem with coloring an area (path b). > > Thanks for your help. >

Re: [NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Taco Hoekwater
> On 23 Jul 2020, at 11:48, Fabrice Couvreur > wrote: > > Hello, > I have a little problem with coloring an area (path b). > Thanks for your help. > Fabrice > > \starttext > \startMPcode > > path circle, p, q, b; > > circle = fullcircle xscaled 6cm yscaled 3.5cm; > p = (point 2 of

[NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Fabrice Couvreur
Hello, I have a little problem with coloring an area (path b). Thanks for your help. Fabrice \starttext \startMPcode path circle, p, q, b; circle = fullcircle xscaled 6cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2)

Re: [NTG-context] How to define an array of colors in Metafun

2020-06-20 Thread Hans Hagen
On 6/20/2020 4:48 PM, Otared Kavian wrote: Hi all, I have a family of graphs to draw in Metapost and I would like to attribute a different color to each of them according to the value of a certain variable. Assuming that the path mygraph(j) depends on the variable j, which is computed within

[NTG-context] How to define an array of colors in Metafun

2020-06-20 Thread Otared Kavian
Hi all, I have a family of graphs to draw in Metapost and I would like to attribute a different color to each of them according to the value of a certain variable. Assuming that the path mygraph(j) depends on the variable j, which is computed within a lua code and passed to Metapost, I wonder

Re: [NTG-context] Is it possible to have a rotated label in Metafun?

2020-05-25 Thread Hans Hagen
On 5/24/2020 10:41 AM, Otared Kavian wrote: Hi all, In a graph which I am trying to draw with LuaMetafun, I have a variable the values of which I want to show on the graph rotated 90 degrees (or whatever other value). Is it possible to do that? An example is: numeric a, u ; u :=

[NTG-context] Is it possible to have a rotated label in Metafun?

2020-05-24 Thread Otared Kavian
Hi all, In a graph which I am trying to draw with LuaMetafun, I have a variable the values of which I want to show on the graph rotated 90 degrees (or whatever other value). Is it possible to do that? An example is: numeric a, u ; u := 10mm ; a := 4.5 ; label.bot(a,

Re: [NTG-context] Arithmetic Overflow error in MetaFun

2020-05-17 Thread Keith McKay
Thanks for your help Hans and the pointer to the extended math library. Lots more to explore now. Best Wishes Keith On Sat, 16 May 2020, 20:46 Hans Hagen, wrote: > On 5/16/2020 4:48 PM, Keith McKay wrote: > > Answering my own problem here. > > > > I've just searched through the mailing list

Re: [NTG-context] Arithmetic Overflow error in MetaFun

2020-05-16 Thread Hans Hagen
On 5/16/2020 4:48 PM, Keith McKay wrote: Answering my own problem here. I've just searched through the mailing list archives and it seems that if I add [instance=doublefun] I do not get the Arithmetic Overflow error. Joy! fwiw, we have also instance=decimalfun concerning arithmic: in

Re: [NTG-context] Arithmetic Overflow error in MetaFun

2020-05-16 Thread Hans Hagen
in the Metafun and Metafont manuals but nothing jumps out at me. In the minimum working example below, this Arithmetic Overflow occurs when xord =13.5 but I can get the calculation to work if I separate out the equation and then add together, since it seems to be failing on the pow(xord,4

Re: [NTG-context] Arithmetic Overflow error in MetaFun

2020-05-16 Thread Keith McKay
with an Arithmetic Overflow error when calculating the x and y values for functions of the form: y = ax^4 + bx^3 + cx^2 + dx + e to which I then add a bit of randomness and other embellishments. I have had a look in the Metafun and Metafont manuals but nothing jumps out at me. In the minimum

[NTG-context] Arithmetic Overflow error in MetaFun

2020-05-16 Thread Keith McKay
Colleagues I'm having problems with an Arithmetic Overflow error when calculating the x and y values for functions of the form: y = ax^4 + bx^3 + cx^2 + dx + e to which I then add a bit of randomness and other embellishments. I have had a look in the Metafun and Metafont manuals but nothing

[NTG-context] Is this a MetaFun bug or intended behaviour?

2020-04-30 Thread Gerben Wierda
I wanted to use the macro simplified to remove duplicate points from a path, but it removes more than that: metapost log> (127,-107)..controls (117,-107) and (107,-107) metapost log> ..(97,-107)..controls (97,-130.34) and (97,-153.66) metapost log>

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-12 Thread Jeong Dal
ing math in mp, in lmtx (which has some extra metafun > features) we have some more math functions available: > > m_acos m_acosh m_asin m_asinh m_atan m_atantwo m_atanh m_cbrt m_ceil > m_copysign > m_cos m_cosh m_deg m_erf m_erfc m_exp m_exptwo m_expm m_fabs m_fdim m_floor

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-12 Thread Hans Hagen
Hi Dal, Thank you for your nice code. lua.MP.Whatever is something! just keep in mind that lua.MP is the user namespace and lua.mp (lowercase) the system one btw, as you're doing math in mp, in lmtx (which has some extra metafun features) we have some more math functions available

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-11 Thread Jeong Dal
Dear Hans, Thank you for your nice code. lua.MP.Whatever is something! Have a nice weekend. Best regards, Dalyoung > 2020. 4. 12. 오전 2:08, Hans Hagen 작성: > > On 4/11/2020 4:15 PM, Jeong Dal wrote: >> Dear all, >> The problem is solved by using the namespace of lua as below: >> I am not sure

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-11 Thread Hans Hagen
On 4/11/2020 4:15 PM, Jeong Dal wrote: Dear all, The problem is solved by using the namespace of lua as below: I am not sure what I did is the right way. If it is not the right way, please let me know. Thanks for reading. Best regards, Dalyoung \startluacode P={} combi = P function

[NTG-context] running lua in metafun and in ConTeXt

2020-04-11 Thread Jeong Dal
Dear all, The problem is solved by using the namespace of lua as below: I am not sure what I did is the right way. If it is not the right way, please let me know. Thanks for reading. Best regards, Dalyoung \startluacode P={} combi = P function P.fact (n) if n <= 0 then return 1

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-11 Thread Otared Kavian
s code to a ConTeXt file composed product > and components, > and using the second method, i.e. combi(n,r). The first method is still > working well. > The error message is as following: > > metapost log> loading metafun, including plain.mp version 1.004 for > metafun iv a

[NTG-context] running lua in metafun and in ConTeXt

2020-04-11 Thread Jeong Dal
, when I added this code to a ConTeXt file composed product and components, and using the second method, i.e. combi(n,r). The first method is still working well. The error message is as following: metapost log> loading metafun, including plain.mp version 1.004 for metafun iv and xl metapost

Re: [NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-10 Thread Gerben Wierda
As I only use one transparency method anyway I could also fix this by passing a numeric instead of a pair and use the standard withtransparency (I don’t like overriding a standard MetaFun method, one never knows what might break in future updates). vardef Foo( expr w, h, fillColor

Re: [NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-09 Thread Hans Hagen
On 4/9/2020 4:58 PM, Gerben Wierda wrote: \starttext \startMPpage[instance=doublefun] vardef Foo( expr w, h, fillColor, fillTransparency) =   show "FOO:", w, h, fillColor, fillTransparency;   save pic; picture pic;   save circ; path circ;   circ := (fullcircle xyscaled (h,h));   pic :=

[NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-09 Thread Gerben Wierda
I have refactored my code to use withtransparency and separate parameters for colors, sizes, transparency, etc. But I’m running into a problem. The fillTransparency parameter is a pair primary (as can be seen from the show command) Here is a pretty minimum example (in reality there are

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Henri Menke
my macros, so I > > can pass the colors with transparency using a single parameter. That should > > be possible if I understand the MetaFun manual (where I’ve copy-pasted this > > example from): > > > > \starttext > > \startMPpage[instance=doublefun] >

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Hans Hagen
en making vardef's one need to omit the final semi colon in order to apply more properties to the 'return value'. At some point I will update the metafun manual which means: remove old methods and exclusively use the new ones (currently the manual also discusses mpii while in context mkiv/lm

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Taco Hoekwater
Hi, Using multiple (text ) arguments in macros doesn’t work, you would need to convert all but the last argument into (expr ) somehow. That means that you probably cannot do a call like the one below at all. (I, at least, do not see how you could convert one of those transparent colours into

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Gerben Wierda
my macros, so I >>> can pass the colors with transparency using a single parameter. That should >>> be possible if I understand the MetaFun manual (where I’ve copy-pasted this >>> example from): >>> >>> \starttext >>> \startMPpage[instance=do

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Taco Hoekwater
an pass the colors with transparency using a single parameter. That should >> be possible if I understand the MetaFun manual (where I’ve copy-pasted this >> example from): >> >> \starttext >> \startMPpage[instance=doublefun] >> >> vardef SampleText (expr t

Re: [NTG-context] Why does this example from the MetaFun manual not work?

2020-04-09 Thread Gerben Wierda
Nobody? > On 8 Apr 2020, at 12:20, Gerben Wierda wrote: > > I would like to use the result of transparent() straight in my macros, so I > can pass the colors with transparency using a single parameter. That should > be possible if I understand the MetaFun manual (where I

[NTG-context] Why does this example from the MetaFun manual not work?

2020-04-08 Thread Gerben Wierda
I would like to use the result of transparent() straight in my macros, so I can pass the colors with transparency using a single parameter. That should be possible if I understand the MetaFun manual (where I’ve copy-pasted this example from): \starttext \startMPpage[instance=doublefun] vardef

Re: [NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda
> On 5 Apr 2020, at 15:24, Keith McKay wrote: > > Would sections 1.3, 1.18, 2.5 and 2.6 in the Metafun manual help? I used what is in 1.3 (though I actually used Peter Grogono’s PDF MetaPost: A Reference Manual <https://users.encs.concordia.ca/~grogono/Writings/mpref.pdf>

Re: [NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Keith McKay
Would sections 1.3, 1.18, 2.5 and 2.6 in the Metafun manual help? Keith On 05/04/2020 11:31, Gerben Wierda wrote: I think I saw a function in MetaFun somehwre that you could give a ‘hard’ path, i.e. (0,0) -- (0,1) — (1,1) and it would become a path with nicely rounded (part of a circle

Re: [NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda
5.04.2020 um 12:31: >> I think I saw a function in MetaFun somehwre that you could give a ‘hard’ >> path, i.e. (0,0) -- (0,1) — (1,1) and it would become a path with nicely >> rounded (part of a circle) corners (still straight lines), but I can’t find >> it anymore.

Re: [NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Wolfgang Schuster
Gerben Wierda schrieb am 05.04.2020 um 12:31: I think I saw a function in MetaFun somehwre that you could give a ‘hard’ path, i.e. (0,0) -- (0,1) — (1,1) and it would become a path with nicely rounded (part of a circle) corners (still straight lines), but I can’t find it anymore. I wrote my

[NTG-context] What was that 'rounding paths' metafun(?) function again?

2020-04-05 Thread Gerben Wierda
I think I saw a function in MetaFun somehwre that you could give a ‘hard’ path, i.e. (0,0) -- (0,1) — (1,1) and it would become a path with nicely rounded (part of a circle) corners (still straight lines), but I can’t find it anymore. I wrote my own, but it is giving me headaches so I’d like

Re: [NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Marcus Vinicius Mesquita
e 'scaled' > metapost log> > metapost log> loading metafun, including plain.mp version 1.004 for > metafun iv and xl > metapost log> > metapost log> >> unknown path D > metapost log> ! Isolated expression. > metapost lo

Re: [NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Hans Hagen
On 2/25/2020 6:34 PM, Jan-Erik Hägglöf wrote: The following code gives an error, my goal is to draw 4 different arrows but only three functions successfully. The error log shows metapost        > initializing number mode 'scaled' metapost log    > metapost log    > loading metafun,

Re: [NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Jan-Erik Hägglöf
successfully. > > The error log shows > > metapost> initializing number mode 'scaled' > metapost log> > metapost log> loading metafun, including plain.mp version 1.004 for > metafun iv and xl > metapost log> > metapost log> >&

[NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Jan-Erik Hägglöf
The following code gives an error, my goal is to draw 4 different arrows but only three functions successfully. The error log shows metapost> initializing number mode 'scaled' metapost log> metapost log> loading metafun, including plain.mp version 1.004 for metafun

Re: [NTG-context] How to use in Metafun, a function defined in Lua

2019-12-28 Thread Hans Hagen
On 12/28/2019 4:22 PM, Otared Kavian wrote: Hi all, I would like to use a math function defined in lua in Metafun in order to draw its graph, together with the graphs of some other functions. As a simple example consider the following: %%% begin lua-metafun-example.tex \startluacode

[NTG-context] How to use in Metafun, a function defined in Lua

2019-12-28 Thread Otared Kavian
Hi all, I would like to use a math function defined in lua in Metafun in order to draw its graph, together with the graphs of some other functions. As a simple example consider the following: %%% begin lua-metafun-example.tex \startluacode function document.myfunction(n,x

[NTG-context] Using lmtx and new metafun

2019-12-12 Thread Otared Kavian
Hi Aditya, Following your explanations in https://adityam.github.io/context-blog/post/new-metafun-interface/ I wrote an environment in order to display the graph of a function on a grid which can be adapted to each case. Assuming that I have an MPinstance named GridAxis (for example

Re: [NTG-context] Eofill extension (Metafun)

2019-12-09 Thread Fabrice Couvreur
Hello, Thank you for these explanations. Fabrice Le lun. 9 déc. 2019 à 03:21, Henri Menke a écrit : > On 12/9/19 10:02 AM, Fabrice Couvreur wrote: > > Hello, > > Is it possible to use the eofill extension in this code ? I tried without > > success. Thank you. > > No, eofill is basically just a

Re: [NTG-context] Eofill extension (Metafun)

2019-12-08 Thread Henri Menke
On 12/9/19 10:02 AM, Fabrice Couvreur wrote: Hello, Is it possible to use the eofill extension in this code ? I tried without success. Thank you. No, eofill is basically just a frontend for the PDF primitive eofill, which works on a single connected path that intersects itself. If that wasn't

[NTG-context] Eofill extension (Metafun)

2019-12-08 Thread Fabrice Couvreur
Hello, Is it possible to use the eofill extension in this code ? I tried without success. Thank you. Fabrice \starttext \startMPcode path carre, disque; carre = fullsquare scaled 200; disque = fullcircle scaled 200; draw carre numberstriped (.25,15,5) withcolor \MPcolor{magenta};

Re: [NTG-context] typo in metafun manual

2019-09-10 Thread Michael Hallgren
Le 2019-09-10 07:36, Damien Thiriet a écrit : Hi, There may be a typo in metafun manual, page 104 Hopefully the next explains a bit how it works (you can find explanations zon the internet). Sounds too Dutch for me… Looks like :). And 'the Internet' usually uppercase. mh Regards

[NTG-context] typo in metafun manual

2019-09-09 Thread Damien Thiriet
Hi, There may be a typo in metafun manual, page 104 Hopefully the next explains a bit how it works (you can find explanations zon the internet). Sounds too Dutch for me… Regards, Damien Thiriet ___ If your

Re: [NTG-context] metafun 2

2019-09-08 Thread Aditya Mahajan
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

Re: [NTG-context] metafun 2

2019-09-08 Thread Otared Kavian
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 k

Re: [NTG-context] metafun 2

2019-09-08 Thread Aditya Mahajan
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

[NTG-context] Fwd: metafun 2

2019-08-19 Thread Mikael P. Sundqvist
t I mention it since I did not see it > > in the pdf. > > no, but that is rather trivial to add > Good! > > > Again, it is very nice that you work on extending MetaPost/MetaFun > further!! > wel, mp is ... fun (and these extension are somewhat challenging) > > Hans &

Re: [NTG-context] metafun 2

2019-08-19 Thread Jorge Manuel
uot;, 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, li

Re: [NTG-context] metafun 2

2019-08-17 Thread Adam Reviczky
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: > >

Re: [NTG-context] metafun 2

2019-08-17 Thread Hans Hagen
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 ;

Re: [NTG-context] metafun 2

2019-08-16 Thread Alan Braslau
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 l

Re: [NTG-context] metafun 2

2019-08-16 Thread Adam Reviczky
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 >

<    1   2   3   4   5   6   7   8   9   10   >