Re: [NTG-context] Struggling with startuseMPgraphic and string argument!

2020-09-18 Thread Geert Verhaag
: \startuseMPgraphic{name}{s::lbl}    def mymacro (text lb) = pair a ; a := (3cm,3cm) ;label.top("String: " & str lb,a) ;    enddef ;    mymacro(\MPvariable{lbl}) ; \stopuseMPgraphic and this works too, but what if I introduce another text argument like: \startuseMPgraphic{

Re: [NTG-context] Struggling with startuseMPgraphic and string argument!

2020-09-18 Thread Hans Hagen
On 9/17/2020 9:41 PM, Geert Verhaag wrote: Hi ConTeXt users, That's indeed magic and it works! Hans, thanks for your prompt answer! But I would like to take this a step further, by introducing a macro within the start/stopuseMPgraphic structure like so: \startuseMPgraphic{name}{s::lbl

Re: [NTG-context] Struggling with startuseMPgraphic and string argument!

2020-09-17 Thread Geert Verhaag
Hi ConTeXt users, That's indeed magic and it works! Hans, thanks for your prompt answer! But I would like to take this a step further, by introducing a macro within the start/stopuseMPgraphic structure like so: \startuseMPgraphic{name}{s::lbl}   def mymacro (text lb) =     pair a ; a := (3cm

Re: [NTG-context] Struggling with startuseMPgraphic and string argument!

2020-09-17 Thread Hans Hagen
On 9/16/2020 4:32 PM, Geert Verhaag wrote: Hi, I'm trying to pass a string argument value to an MPgraphic but it doesn't seem to work: Tried the following: \startuseMPgraphic{name}{lbl}   pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ; \stopuseMPgraphic

[NTG-context] Struggling with startuseMPgraphic and string argument!

2020-09-16 Thread Geert Verhaag
Hi, I'm trying to pass a string argument value to an MPgraphic but it doesn't seem to work: Tried the following: \startuseMPgraphic{name}{lbl}   pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ; \stopuseMPgraphic \starttext   \useMPgraphic{name}{lbl=1} \stoptext The a

[NTG-context] Can someone explain the \startuseMPgraphic interface to me?

2020-05-19 Thread Gerben Wierda
In details.pdf, I encounter \startuseMPgraphic{mpos:par:columnset:shade} numeric h ; for i=1 upto nofmultipars : h := bbheight(p) ; if multikind[i] = "single" : fill multipars[i] topenlarged -.5h When I encounter that, I wonder: - where do nofmu

Re: [NTG-context] Using \startuseMPgraphic inside a textext() in METAPOST?

2020-04-27 Thread Hans Hagen
("\startuseMPgraphic[instance=doublefun]{followtokens}path RotPath ; RotPath := fullcircle ;\stopuseMPgraphic\followtokens{I am creating a line of text here}"); draw pic; \stopMPpage \stoptext But that does not work. Is there a way I can from within my METAPOST code get  string (TeX code) to follo

[NTG-context] Using \startuseMPgraphic inside a textext() in METAPOST?

2020-04-27 Thread Gerben Wierda
I am in METAPOST which is inside TeX and I’d like (in METAPOST, not in TeX) to let a string follow a path. Adapting from the MetaFun manual around page 250, I tried this: \starttext \startMPpage[instance=doublefun] pic p; p := textext("\startuseMPgraphic[instance=doublefun]{followtokens

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-21 Thread Jeong Dal
Dear Hans, I have not experienced a bottleneck when running ConTeXt. It is stable and fast. I am satisfied with ConTeXt except there are many features and commands which are not explained. Frankly speaking, I don’t need that much commands for my job. Also it is not the problem because there

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-20 Thread Hans Hagen
On 4/20/2020 4:40 PM, Jeong Dal wrote: Of course, it runs so fast that it is meaningless to shorten the runtime. It is my old habit to check the algorithmic efficiency. We share the same habit ... unfortunately there is not much performance to gain after all these years. Of course users are

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-20 Thread Jeong Dal
Dear Hans, Of course, it runs so fast that it is meaningless to shorten the runtime. It is my old habit to check the algorithmic efficiency. It is just my interest. Thank you for your concern. Best regards, Dalyoung

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Jeong Dal
Dear Aditya, Thank you for your link. It is good to see your nice code. I’ll see how to apply \startMPanimation … \stopMPanimation to my sample. Thank you again. Best regards, Dalyoung ___ If your question is of

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Hans Hagen
On 4/19/2020 9:02 PM, Jeong Dal wrote: Dear Wolfgang, I’d like to ask you one more. To make an animation, almost same graphics are drawn repeatedly. In my code, for example, The base figure(two circles, line, boundingbox) is fixed and only points are moved. But it draws the base figure every

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Jeong Dal
. Is there a way to draw the base figure once, and draw the points only at each frame? Thank you. Best regards, Dalyoung \startuseMPgraphic{inversionPoint}{n} vardef findPointD(expr C, Q, r) = numeric dist, ang; pair X, Y; dist := r**2/sqrt((xpart Q - xpart C)**2 + (ypart Q - ypart C)**2

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Aditya Mahajan
\startuseMPgraphic{inversionPoint}{n} vardef findPointD(expr C, Q, r) = numeric dist, ang; pair X, Y; dist := r**2/sqrt((xpart Q - xpart C)**2 + (ypart Q - ypart C)**2); ang := angle(Q - C); Y := C + dir(ang)*dist; Y enddef; numeric radius, now, move; pair A,B,C,P,Q; path p,q; radius

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Jeong Dal
Dear Wolfgang, Thank you for your help. It works fine. As you said, I need to use boundingbox for stable animation. Thank you again. Best regards, Dalyoung > 2020. 4. 19. 오후 4:19, Wolfgang Schuster > 작성: > > Jeong Dal schrieb am 19.04.2020 um 07:08: >> Dear all, >> I am trying to make an

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Wolfgang Schuster
Jeong Dal schrieb am 19.04.2020 um 07:08: Dear all, I am trying to make an animation using the animation module. But it draws 10 figures instead of creating animation. Is there anything I have to do more? You have to put each animation step in a frame environment. I recommend also to set the

[NTG-context] animation using \startuseMPgraphic

2020-04-18 Thread Jeong Dal
Dear all, I am trying to make an animation using the animation module. But it draws 10 figures instead of creating animation. Is there anything I have to do more? Or, is there a better way to do this? Thank you for reading. Best regards, Dalyoung \startuseMPgraphic{inversionPoint}{n} vardef

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Aditya Mahajan
On Mon, 11 Apr 2016, Alan BRASLAU wrote: By the way, we added colo-imp-crayola having some funky, hallucinogenic names (according to Hans) as well as colo-imp-ral. (The first might be of interest to Americans and the second to Europeans ;-) These are nice colors. For anyone interested, you

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Alan BRASLAU
myred][r=1] > > \startMPpage > fill fullcircle scaled 3cm withcolor \MPcolor{myred} ; > \stopMPpage > %% end example > > > The second part of the questions concerns metapost variables. > > %% begin example > \startuseMPgraphic{mycircle}{diameter,color}

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
However with the snippet below I see the default black with MPcolor and the >> wanted red with \MPvar. Thus? >> >> Hans van der Meer >> >> \starttext >> \startuseMPgraphic{example1}{color} >> pickup pencircle scaled 1mm; >> draw

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Aditya Mahajan
with MPcolor and the wanted red with \MPvar. Thus? Hans van der Meer \starttext \startuseMPgraphic{example1}{color} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPcolor{color}; This is looking for a color named 'color'. You need \MPcolor{

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
Hans van der Meer \starttext \startuseMPgraphic{example1}{color} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPcolor{color}; \stopuseMPgraphic \startuseMPgraphic{example2}{color} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Alan BRASLAU
On Mon, 11 Apr 2016 22:10:02 +0900 Jeong Dal wrote: > BTW, if I change “orange” to “red” or “green”, it is working fine. I > think that “orange” is not the predefined color. There is no color > “orange” in the MetaFun manual either. Defined MP colors are: color black, white,

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Wolfgang Schuster
Meer, Hans van der <mailto:h.vanderm...@uva.nl> 11. April 2016 um 15:30 Thanks Wolfgang. It appears my memory did some "wishful thinking" in wanting \startuseMPgraphic{name}{key=value}. Although that would have been nice. You get a document with the syntax of metapost related c

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
Thanks Wolfgang. It appears my memory did some "wishful thinking" in wanting \startuseMPgraphic{name}{key=value}. Although that would have been nice. Hans van der Meer On 11 Apr 2016, at 14:42, Wolfgang Schuster <schuster.wolfg...@gmail.com<mailto:schuster.wolfg...@gmail.co

[NTG-context] \startuseMPgraphic

2016-04-11 Thread Jeong Dal
. Best regards, Dalyoung > \starttext > \startuseMPgraphic{myname1}{color} > pickup pencircle scaled 1mm; > draw unitsquare scaled 1cm withcolor \MPvar{color}; > \stopuseMPgraphic > > \startuseMPgraphic{myname2}{color=red} > pickup pencircle scaled 1mm; > draw unit

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Wolfgang Schuster
Meer, Hans van der <mailto:h.vanderm...@uva.nl> 11. April 2016 um 10:35 I seem to remember the following variations in \startuseMPgraphic. (1) \startuseMPgraphic{name}{comma separated list of variables} (2) \startuseMPgraphic{name}{comma separated list of key=value pairs} In the second ca

[NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
I seem to remember the following variations in \startuseMPgraphic. (1) \startuseMPgraphic{name}{comma separated list of variables} (2) \startuseMPgraphic{name}{comma separated list of key=value pairs} In the second case one is able to set a default value to that variable, possibly

[NTG-context] parameters in startuseMPgraphic

2013-05-01 Thread Meer, H. van der
I used to pass (color) parameters to \startuseMPgraphic with: \startuseMPgraphic{square}{acolor} draw unitsquare withcolor \MPvar{acolor}; % or \MPcolor{acolor} In both cases I get the following error: metapost initializing instance 'metafun' using format 'metafun' metapost

Re: [NTG-context] parameters in startuseMPgraphic

2013-05-01 Thread Wolfgang Schuster
Am 01.05.2013 um 11:48 schrieb Meer, H. van der h.vanderm...@uva.nl: I used to pass (color) parameters to \startuseMPgraphic with: \startuseMPgraphic{square}{acolor} draw unitsquare withcolor \MPvar{acolor}; % or \MPcolor{acolor} In both cases I get the following error: metapost

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-11 Thread Alfredo Catalina
I've run first-setup.bat --modules=all and now it works. Thanks Wolfgang and Aditya!! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl /

[NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Alfredo Catalina
How can I setup a font -name, size, etc- inside a startuseMPgraphic environment? \startuseMPgraphic{map} \stopuseMPgraphic ___ If your question is of interest to others as well, please add an entry to the Wiki

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Wolfgang Schuster
Am 10.06.2012 um 16:25 schrieb Alfredo Catalina: How can I setup a font -name, size, etc- inside a startuseMPgraphic environment? \startuseMPgraphic{map} \stopuseMPgraphic - http://wiki.contextgarden.net/Command/defineMPinstance - http://wiki.contextgarden.net/Command/setupMPinstance

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Meer, H. van der
? Is there documentation somewhere? Thanks in advance, Hans van der Meer On 10 jun. 2012, at 17:25, Wolfgang Schuster wrote: Am 10.06.2012 um 16:25 schrieb Alfredo Catalina: How can I setup a font -name, size, etc- inside a startuseMPgraphic environment? \startuseMPgraphic{map} \stopuseMPgraphic

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Wolfgang Schuster
Am 10.06.2012 um 18:23 schrieb Meer, H. van der: Being interested I looked up these links in the garden. The information given there is scarce, however. The parameters 'extensions' and 'initializations' with values yes/no especially. What are they for? What is the effect of yes/no? What

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Alfredo Catalina
the font size but the font type is not palatino. thanks On Sun, Jun 10, 2012 at 5:25 PM, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 10.06.2012 um 16:25 schrieb Alfredo Catalina: How can I setup a font -name, size, etc- inside a startuseMPgraphic environment

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Wolfgang Schuster
Am 10.06.2012 um 18:40 schrieb Alfredo Catalina: I'm sorry but I don't know how to use them. I've tried \setupMPinstance [metafun] [textcolor=red] and got an undefined control sequence error. I've also tried \startMPenvironment [global] \usetypescript[palatino][ec]

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Alfredo Catalina
1. Do you use MkII or MkIV? 2. Do you want Palatino only for the metapost labels or also for the main font in the document? I am using MkIV. Whether it is possible I would like to use a different font for the metapost labels.

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Wolfgang Schuster
Am 10.06.2012 um 18:56 schrieb Alfredo Catalina: 1. Do you use MkII or MkIV? 2. Do you want Palatino only for the metapost labels or also for the main font in the document? I am using MkIV. Whether it is possible I would like to use a different font for the metapost labels.

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Alfredo Catalina
\setupbodyfont[pagella,11pt] %\setupMPinstance[metafun][textstyle=sans] \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,14pt]}] \starttext \input knuth \startMPcode draw textext(I’m different!) ; \stopMPcode \stoptext It gives an error: ! Undefined control

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Aditya Mahajan
On Sun, 10 Jun 2012, Alfredo Catalina wrote: \setupbodyfont[pagella,11pt] %\setupMPinstance[metafun][textstyle=sans] \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,14pt]}] \starttext \input knuth \startMPcode draw textext(I’m different!) ; \stopMPcode \stoptext It gives

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Alfredo Catalina
On Sun, Jun 10, 2012 at 7:14 PM, Aditya Mahajan adit...@umich.edu wrote You need to upgrade your ConTeXt installation. I installed context two weeks ago. I've just run mtxrun --selfupdate mtxrun --generate luatools --generate context --make and I've got the same error. Any ideas?

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Wolfgang Schuster
Am 10.06.2012 um 20:07 schrieb Alfredo Catalina: On Sun, Jun 10, 2012 at 7:14 PM, Aditya Mahajan adit...@umich.edu wrote You need to upgrade your ConTeXt installation. I installed context two weeks ago. I've just run mtxrun --selfupdate mtxrun --generate luatools --generate

Re: [NTG-context] Change font in \startuseMPgraphic

2012-06-10 Thread Alfredo Catalina
On Sun, Jun 10, 2012 at 9:29 PM, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Do you use TeXLive or the ConTeXt Suite (installation from the context wiki)? ConTeXt Suite ___ If your question is of

Re: [NTG-context] mfun-004.tex \startuseMPgraphic

2005-12-19 Thread Hans Hagen
David Arnold wrote: Hans, In mfun-004.tex, I find: \startuseMPgraphic{axis} tickstep := 1cm ; ticklength := 2mm ; drawticks unitsquare xscaled 4cm yscaled 3cm shifted (-1cm,-1cm) ; tickstep := tickstep/2 ; ticklength := ticklength/2 ; drawticks unitsquare xscaled 4cm yscaled 3cm

[NTG-context] special characters and \startuseMPgraphic{FunnyFrame}

2004-05-03 Thread Helmut Schwertner
] \enableregime[windows] \setuppapersize[a4][a4] \setupoutput[pdftex] \pdfcompresslevel=0 \runMPgraphicstrue \setupcolors[state=start] \startuseMPgraphic{FunnyFrame} picture p; numeric w, h, o; p:=textext.rt(\MPstring{FunnyFrame}); w:=OverlayWidth; h:=OverlayHeight; o:=BodyFontSize; p:=p shifted (2o,h