* [NTG-context] Problem with Metapost
@ 2024-11-03 15:48 Fabrice Couvreur
2024-11-03 16:03 ` [NTG-context] " Mikael Sundqvist
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Couvreur @ 2024-11-03 15:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1460 bytes --]
Hi,
I think I have never encountered this problem. Recently, I can no longer
have a succession of figures with Metapost; only the first one appears.
Thanks.
Fabrice
\starttext
\dorecurse{3}{\startMPcode
numeric u;
u = 0.5cm;
ymax = xmax = 7;
xmin = ymin = -1;
interim ahangle := 30;
z0 = (1u,1u);
z1 = (2u,3u);
z2 = (0,5u);
path xx, yy;
xx = ((xmin,0) -- (xmax,0)) scaled u;
yy = ((0,ymin) -- (0,ymax)) scaled u;
drawoptions(scaled .5 withcolor .7 white);
for i = ceiling ymin upto floor ymax: draw xx shifted (0,i*u);
endfor
for i = ceiling xmin upto floor xmax: draw yy shifted (i*u,0);
endfor
drawoptions();
path fuzz;
fuzz = z0 -- z1 -- z2 -- cycle;
fill fuzz withcolor 0.7[blue,white];
draw fuzz withcolor blue;
fill fuzz shifted(4u,1u) withcolor 0.7[blue,white];
draw fuzz shifted(4u,1u) withcolor blue;
drawoptions(withpen pencircle scaled 1pt);
drawarrow z0 -- z0 shifted (4u,1u);
drawarrow z1 -- z1 shifted (4u,1u);
drawarrow z2 -- z2 shifted (4u,1u);
drawoptions();
label("\im{\vec{v}}", (3.5u,3u));
label.llft("\im{A}",z0);
label.lrt("\im{B}",z0 shifted (4u,1u));
\stopMPcode}
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 2056 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: Problem with Metapost
2024-11-03 15:48 [NTG-context] Problem with Metapost Fabrice Couvreur
@ 2024-11-03 16:03 ` Mikael Sundqvist
2024-11-03 16:25 ` Fabrice Couvreur
0 siblings, 1 reply; 3+ messages in thread
From: Mikael Sundqvist @ 2024-11-03 16:03 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
you get an error of redundant equations. Try
numeric ymax,xmax ; ymax := 7 ; xmax := 7;
numeric xmin,ymin ; xmin :=-1 ; ymin := -1;
and it might work.
(It is a bit weird that ymax = 7 several times result in an error, but ... )
/Mikael
On Sun, Nov 3, 2024 at 4:47 PM Fabrice Couvreur
<fabrice1.couvreur@gmail.com> wrote:
>
> Hi,
> I think I have never encountered this problem. Recently, I can no longer have a succession of figures with Metapost; only the first one appears.
> Thanks.
> Fabrice
>
> \starttext
> \dorecurse{3}{\startMPcode
> numeric u;
> u = 0.5cm;
> ymax = xmax = 7;
> xmin = ymin = -1;
> interim ahangle := 30;
> z0 = (1u,1u);
> z1 = (2u,3u);
> z2 = (0,5u);
> path xx, yy;
> xx = ((xmin,0) -- (xmax,0)) scaled u;
> yy = ((0,ymin) -- (0,ymax)) scaled u;
> drawoptions(scaled .5 withcolor .7 white);
> for i = ceiling ymin upto floor ymax: draw xx shifted (0,i*u); endfor
> for i = ceiling xmin upto floor xmax: draw yy shifted (i*u,0); endfor
> drawoptions();
> path fuzz;
> fuzz = z0 -- z1 -- z2 -- cycle;
> fill fuzz withcolor 0.7[blue,white];
> draw fuzz withcolor blue;
> fill fuzz shifted(4u,1u) withcolor 0.7[blue,white];
> draw fuzz shifted(4u,1u) withcolor blue;
> drawoptions(withpen pencircle scaled 1pt);
> drawarrow z0 -- z0 shifted (4u,1u);
> drawarrow z1 -- z1 shifted (4u,1u);
> drawarrow z2 -- z2 shifted (4u,1u);
> drawoptions();
> label("\im{\vec{v}}", (3.5u,3u));
> label.llft("\im{A}",z0);
> label.lrt("\im{B}",z0 shifted (4u,1u));
>
> \stopMPcode}
>
>
> \stoptext
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: Problem with Metapost
2024-11-03 16:03 ` [NTG-context] " Mikael Sundqvist
@ 2024-11-03 16:25 ` Fabrice Couvreur
0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Couvreur @ 2024-11-03 16:25 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 3323 bytes --]
Hi Mikael,
It works, thank you very much.
Fabrice
Le dim. 3 nov. 2024 à 17:08, Mikael Sundqvist <mickep@gmail.com> a écrit :
> Hi,
>
> you get an error of redundant equations. Try
>
> numeric ymax,xmax ; ymax := 7 ; xmax := 7;
> numeric xmin,ymin ; xmin :=-1 ; ymin := -1;
>
> and it might work.
>
> (It is a bit weird that ymax = 7 several times result in an error, but ...
> )
>
> /Mikael
>
> On Sun, Nov 3, 2024 at 4:47 PM Fabrice Couvreur
> <fabrice1.couvreur@gmail.com> wrote:
> >
> > Hi,
> > I think I have never encountered this problem. Recently, I can no longer
> have a succession of figures with Metapost; only the first one appears.
> > Thanks.
> > Fabrice
> >
> > \starttext
> > \dorecurse{3}{\startMPcode
> > numeric u;
> > u = 0.5cm;
> > ymax = xmax = 7;
> > xmin = ymin = -1;
> > interim ahangle := 30;
> > z0 = (1u,1u);
> > z1 = (2u,3u);
> > z2 = (0,5u);
> > path xx, yy;
> > xx = ((xmin,0) -- (xmax,0)) scaled u;
> > yy = ((0,ymin) -- (0,ymax)) scaled u;
> > drawoptions(scaled .5 withcolor .7 white);
> > for i = ceiling ymin upto floor ymax: draw xx shifted
> (0,i*u); endfor
> > for i = ceiling xmin upto floor xmax: draw yy shifted
> (i*u,0); endfor
> > drawoptions();
> > path fuzz;
> > fuzz = z0 -- z1 -- z2 -- cycle;
> > fill fuzz withcolor 0.7[blue,white];
> > draw fuzz withcolor blue;
> > fill fuzz shifted(4u,1u) withcolor 0.7[blue,white];
> > draw fuzz shifted(4u,1u) withcolor blue;
> > drawoptions(withpen pencircle scaled 1pt);
> > drawarrow z0 -- z0 shifted (4u,1u);
> > drawarrow z1 -- z1 shifted (4u,1u);
> > drawarrow z2 -- z2 shifted (4u,1u);
> > drawoptions();
> > label("\im{\vec{v}}", (3.5u,3u));
> > label.llft("\im{A}",z0);
> > label.lrt("\im{B}",z0 shifted (4u,1u));
> >
> > \stopMPcode}
> >
> >
> > \stoptext
> >
> ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> > archive : https://github.com/contextgarden/context
> > wiki : https://wiki.contextgarden.net
> >
> ___________________________________________________________________________________
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 5353 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-03 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-03 15:48 [NTG-context] Problem with Metapost Fabrice Couvreur
2024-11-03 16:03 ` [NTG-context] " Mikael Sundqvist
2024-11-03 16:25 ` Fabrice Couvreur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).