ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] The graph is not visible.
@ 2024-04-25 10:27 Fabrice Couvreur
  2024-04-25 11:31 ` [NTG-context] " Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: Fabrice Couvreur @ 2024-04-25 10:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2071 bytes --]

Hi,
I don't know if I can explain the problem I'm having. I made a project with
14 chapters. In each of them, there are graphics embedding metapost code. I
proceed as follows : I compile each chapter alone with lmtx then I compile
the project containing the 14 chapters. I didn't encounter any problems
except with a graphic from the last chapter. It is indeed in chapter 14 but
not in the project ! I give the code for this graph.
Thanks.
Fabrice

\startMPcode

               interim linejoin := mitered;
               interim ahangle := 30;
               numeric u, pi;

               pi = 3.141592653589793;
               u = 1.5cm;

               vardef graph_of_function (suffix f) (expr xmin, xmax, xsep) =
                  for x = xmin step xsep until xmax: (x, f(x)) .. endfor
(xmax, f(xmax))
               enddef ;

               vardef vline (suffix f, g) (expr x) = (x, min(f(x), g(x)))
-- (x, max(f(x),g(x))) enddef;

               vardef area_between_functions (suffix f, g)(expr a, b, xsep)
=
                  buildcycle(graph_of_function(f, a, b, xsep), vline(f, g,
b),
                  reverse graph_of_function(g, a, b, xsep), reverse
vline(f, g, a))
               enddef;

               vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0)
enddef ;
               vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax)
enddef ;


               xmin:=-pi/2; xmax := 3*pi/2;
               ymin := -1.5; ymax := 5;


               vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef;
               vardef g(expr x)=-exp(-x)*cos(x) enddef;
               path C_f, C_g;
               C_f = graph_of_function(f,xmin, xmax, .1);
               C_g = graph_of_function(g, xmin, xmax, .1);

               a := xpart(C_f intersectionpoint C_g);
               b := xpart(reverse C_f intersectionpoint reverse C_g);

               fill (area_between_functions(f, g, a, b, 0.1)) scaled u
withcolor 0.4[white, blue];
               draw C_f scaled u withcolor blue;
               draw C_g scaled u withcolor blue;


           \stopMPcode

[-- Attachment #1.2: Type: text/html, Size: 2843 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 10:27 [NTG-context] The graph is not visible Fabrice Couvreur
@ 2024-04-25 11:31 ` Taco Hoekwater
  2024-04-25 14:08   ` Fabrice Couvreur
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2024-04-25 11:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 99 bytes --]

H Fabrice,

You did not provide a good minimum test because the graph by itself renders fine:


[-- Attachment #2: fabr.pdf --]
[-- Type: application/pdf, Size: 7453 bytes --]

[-- Attachment #3: Type: text/plain, Size: 3117 bytes --]



Best wishes,
Taco
(if all else fails, you can replace \startMPcode with \startMPpage and generate a standalone graph that way)

> On 25 Apr 2024, at 12:27, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> 
> Hi,
> I don't know if I can explain the problem I'm having. I made a project with 14 chapters. In each of them, there are graphics embedding metapost code. I proceed as follows : I compile each chapter alone with lmtx then I compile the project containing the 14 chapters. I didn't encounter any problems except with a graphic from the last chapter. It is indeed in chapter 14 but not in the project ! I give the code for this graph.
> Thanks.
> Fabrice
> 
> \startMPcode
> 
>                interim linejoin := mitered;
>                interim ahangle := 30;
>                numeric u, pi;
>          
>                pi = 3.141592653589793;
>                u = 1.5cm;
>          
>                vardef graph_of_function (suffix f) (expr xmin, xmax, xsep) =
>                   for x = xmin step xsep until xmax: (x, f(x)) .. endfor (xmax, f(xmax))
>                enddef ;
> 
>                vardef vline (suffix f, g) (expr x) = (x, min(f(x), g(x))) -- (x, max(f(x),g(x))) enddef;
> 
>                vardef area_between_functions (suffix f, g)(expr a, b, xsep) =
>                   buildcycle(graph_of_function(f, a, b, xsep), vline(f, g, b), 
>                   reverse graph_of_function(g, a, b, xsep), reverse vline(f, g, a))
>                enddef;
> 
>                vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0) enddef ;
>                vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax) enddef ;
> 
>  
>                xmin:=-pi/2; xmax := 3*pi/2; 
>                ymin := -1.5; ymax := 5;
>           
> 
>                vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef;
>                vardef g(expr x)=-exp(-x)*cos(x) enddef;
>                path C_f, C_g;
>                C_f = graph_of_function(f,xmin, xmax, .1);
>                C_g = graph_of_function(g, xmin, xmax, .1);
> 
>                a := xpart(C_f intersectionpoint C_g); 
>                b := xpart(reverse C_f intersectionpoint reverse C_g);
> 
>                fill (area_between_functions(f, g, a, b, 0.1)) scaled u withcolor 0.4[white, blue];
>                draw C_f scaled u withcolor blue;
>                draw C_g scaled u withcolor blue;
>               
>           
>            \stopMPcode
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)



[-- Attachment #4: 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 11:31 ` [NTG-context] " Taco Hoekwater
@ 2024-04-25 14:08   ` Fabrice Couvreur
  2024-04-25 14:31     ` Hans Hagen
  2024-04-25 14:32     ` Taco Hoekwater
  0 siblings, 2 replies; 10+ messages in thread
From: Fabrice Couvreur @ 2024-04-25 14:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4764 bytes --]

Hi Taco,
I knew I wouldn't be able to explain what was happening.
The code works perfectly and the figure is clearly visible in the component
chapter-14 :

\startcomponent[chapter-14]
\startMPpage
...
\stopMPpage
\stopcomponent

But if I compile my project, it disappears !!

\startproduct[terminale-manual]
 \startbodymatter
      \component[chapter-1]
      \component[chapter-2]
      \component[chapter-3]
      \component[chapter-4]
      \component[chapter-5]
      \component[chapter-6]
      \component[chapter-7]
      \component[chapter-8]
      \component[chapter-9]
      \component[chapter-10]
      \component[chapter-11]
      \component[chapter-12]
      \component[chapter-13]
      \component[chapter-14]
    \stopbodymatter
\stopproduct

Le jeu. 25 avr. 2024 à 13:36, Taco Hoekwater <taco@bittext.nl> a écrit :

> H Fabrice,
>
> You did not provide a good minimum test because the graph by itself
> renders fine:
>
>
>
> Best wishes,
> Taco
> (if all else fails, you can replace \startMPcode with \startMPpage and
> generate a standalone graph that way)
>
> > On 25 Apr 2024, at 12:27, Fabrice Couvreur <fabrice1.couvreur@gmail.com>
> wrote:
> >
> > Hi,
> > I don't know if I can explain the problem I'm having. I made a project
> with 14 chapters. In each of them, there are graphics embedding metapost
> code. I proceed as follows : I compile each chapter alone with lmtx then I
> compile the project containing the 14 chapters. I didn't encounter any
> problems except with a graphic from the last chapter. It is indeed in
> chapter 14 but not in the project ! I give the code for this graph.
> > Thanks.
> > Fabrice
> >
> > \startMPcode
> >
> >                interim linejoin := mitered;
> >                interim ahangle := 30;
> >                numeric u, pi;
> >
> >                pi = 3.141592653589793;
> >                u = 1.5cm;
> >
> >                vardef graph_of_function (suffix f) (expr xmin, xmax,
> xsep) =
> >                   for x = xmin step xsep until xmax: (x, f(x)) .. endfor
> (xmax, f(xmax))
> >                enddef ;
> >
> >                vardef vline (suffix f, g) (expr x) = (x, min(f(x),
> g(x))) -- (x, max(f(x),g(x))) enddef;
> >
> >                vardef area_between_functions (suffix f, g)(expr a, b,
> xsep) =
> >                   buildcycle(graph_of_function(f, a, b, xsep), vline(f,
> g, b),
> >                   reverse graph_of_function(g, a, b, xsep), reverse
> vline(f, g, a))
> >                enddef;
> >
> >                vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0)
> enddef ;
> >                vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax)
> enddef ;
> >
> >
> >                xmin:=-pi/2; xmax := 3*pi/2;
> >                ymin := -1.5; ymax := 5;
> >
> >
> >                vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef;
> >                vardef g(expr x)=-exp(-x)*cos(x) enddef;
> >                path C_f, C_g;
> >                C_f = graph_of_function(f,xmin, xmax, .1);
> >                C_g = graph_of_function(g, xmin, xmax, .1);
> >
> >                a := xpart(C_f intersectionpoint C_g);
> >                b := xpart(reverse C_f intersectionpoint reverse C_g);
> >
> >                fill (area_between_functions(f, g, a, b, 0.1)) scaled u
> withcolor 0.4[white, blue];
> >                draw C_f scaled u withcolor blue;
> >                draw C_g scaled u withcolor blue;
> >
> >
> >            \stopMPcode
> >
> ___________________________________________________________________________________
> > 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
> >
> ___________________________________________________________________________________
>
> —
> Taco Hoekwater              E: taco@bittext.nl
> genderfluid (all pronouns)
>
>
>
> ___________________________________________________________________________________
> 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: 7683 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 14:08   ` Fabrice Couvreur
@ 2024-04-25 14:31     ` Hans Hagen
  2024-04-25 14:32     ` Taco Hoekwater
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2024-04-25 14:31 UTC (permalink / raw)
  To: Fabrice Couvreur, mailing list for ConTeXt users

On 4/25/2024 4:08 PM, Fabrice Couvreur wrote:
> Hi Taco,
> I knew I wouldn't be able to explain what was happening.
> The code works perfectly and the figure is clearly visible in the 
> component chapter-14 :
> 
> \startcomponent[chapter-14]
> \startMPpage
> ...
> \stopMPpage
> \stopcomponent
> 
> But if I compile my project, it disappears !!
> 
> \startproduct[terminale-manual]
>   \startbodymatter
>        \component[chapter-1]
>        \component[chapter-2]
>        \component[chapter-3]
>        \component[chapter-4]
>        \component[chapter-5]
>        \component[chapter-6]
>        \component[chapter-7]
>        \component[chapter-8]
>        \component[chapter-9]
>        \component[chapter-10]
>        \component[chapter-11]
>        \component[chapter-12]
>        \component[chapter-13]
>        \component[chapter-14]
>      \stopbodymatter
> \stopproduct
-- compile with specific preceding chapters commented
-- when the interfering one is found, make a copy and strip till the 
problem is gone

it might be that you redefine something metapost

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 / 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 14:08   ` Fabrice Couvreur
  2024-04-25 14:31     ` Hans Hagen
@ 2024-04-25 14:32     ` Taco Hoekwater
  2024-04-25 14:55       ` Fabrice Couvreur
  1 sibling, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2024-04-25 14:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 25 Apr 2024, at 16:08, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> 
> Hi Taco,
> I knew I wouldn't be able to explain what was happening.
> The code works perfectly and the figure is clearly visible in the component chapter-14 :

It is probably not related to the figure itself. Something may be different in this component compared to the other ones. I cannot really say, of course. Still, using external image instead of inline metapost may be fix it. Not elegant, but if it works it works!

Good luck,
Taco


> 
> \startcomponent[chapter-14]
> \startMPpage
> ...
> \stopMPpage
> \stopcomponent
> 
> But if I compile my project, it disappears !!
> 
> \startproduct[terminale-manual]
>  \startbodymatter
>       \component[chapter-1]
>       \component[chapter-2]
>       \component[chapter-3]
>       \component[chapter-4]
>       \component[chapter-5]
>       \component[chapter-6]
>       \component[chapter-7]
>       \component[chapter-8]
>       \component[chapter-9]
>       \component[chapter-10]
>       \component[chapter-11]
>       \component[chapter-12]
>       \component[chapter-13]
>       \component[chapter-14]
>     \stopbodymatter
> \stopproduct

— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)


___________________________________________________________________________________
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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 14:32     ` Taco Hoekwater
@ 2024-04-25 14:55       ` Fabrice Couvreur
  2024-04-25 21:12         ` Fabrice Couvreur
  0 siblings, 1 reply; 10+ messages in thread
From: Fabrice Couvreur @ 2024-04-25 14:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2270 bytes --]

Hi Hans and Taco,
@Hans, I compiled by commenting and uncommenting one component at a time;
it is component 5 which interferes with the metapost code of component 14
All I have to do now is find out what the cause is.
Fabrice

Le jeu. 25 avr. 2024 à 16:40, Taco Hoekwater <taco@bittext.nl> a écrit :

>
>
> > On 25 Apr 2024, at 16:08, Fabrice Couvreur <fabrice1.couvreur@gmail.com>
> wrote:
> >
> > Hi Taco,
> > I knew I wouldn't be able to explain what was happening.
> > The code works perfectly and the figure is clearly visible in the
> component chapter-14 :
>
> It is probably not related to the figure itself. Something may be
> different in this component compared to the other ones. I cannot really
> say, of course. Still, using external image instead of inline metapost may
> be fix it. Not elegant, but if it works it works!
>
> Good luck,
> Taco
>
>
> >
> > \startcomponent[chapter-14]
> > \startMPpage
> > ...
> > \stopMPpage
> > \stopcomponent
> >
> > But if I compile my project, it disappears !!
> >
> > \startproduct[terminale-manual]
> >  \startbodymatter
> >       \component[chapter-1]
> >       \component[chapter-2]
> >       \component[chapter-3]
> >       \component[chapter-4]
> >       \component[chapter-5]
> >       \component[chapter-6]
> >       \component[chapter-7]
> >       \component[chapter-8]
> >       \component[chapter-9]
> >       \component[chapter-10]
> >       \component[chapter-11]
> >       \component[chapter-12]
> >       \component[chapter-13]
> >       \component[chapter-14]
> >     \stopbodymatter
> > \stopproduct
>
> —
> Taco Hoekwater              E: taco@bittext.nl
> genderfluid (all pronouns)
>
>
>
> ___________________________________________________________________________________
> 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: 3625 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 14:55       ` Fabrice Couvreur
@ 2024-04-25 21:12         ` Fabrice Couvreur
  2024-04-26  7:20           ` Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: Fabrice Couvreur @ 2024-04-25 21:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3539 bytes --]

Hi,
Here is the code that interferes with the graph from the last chapter but
why ?

 \startMPcode
             pickup pencircle xscaled 1;
             defaultfont  := "texgyrepagella-regular*default" ;
             defaultscale := 0.8 ;
             path circle, p, q, b;

             circle = fullcircle xscaled 5cm 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) of circle -- p -- subpath(6,8) of circle
--cycle);
             b = (reverse p -- subpath(2,6) of circle -- cycle);

             definecolor [ name = "mp:red", r = 1 ];
             definecolor [ name = "mp:blue", r = 0.54, g = 0.17, b = 0.89 ];

             fill q withcolor "mp:red" withtransparency(1,0.4) ;
             fill b withcolor "mp:blue" withtransparency(1,0.4) ;
             draw circle;
             draw p;

             label("$\overline{\text{A}}$",( 1.5cm,0));
             label("$\text{A}$",(-1.5cm,0));
             label.top("E",(0,1.85cm));
           \stopMPcode

Le jeu. 25 avr. 2024 à 16:55, Fabrice Couvreur <fabrice1.couvreur@gmail.com>
a écrit :

> Hi Hans and Taco,
> @Hans, I compiled by commenting and uncommenting one component at a time;
> it is component 5 which interferes with the metapost code of component 14
> All I have to do now is find out what the cause is.
> Fabrice
>
> Le jeu. 25 avr. 2024 à 16:40, Taco Hoekwater <taco@bittext.nl> a écrit :
>
>>
>>
>> > On 25 Apr 2024, at 16:08, Fabrice Couvreur <fabrice1.couvreur@gmail.com>
>> wrote:
>> >
>> > Hi Taco,
>> > I knew I wouldn't be able to explain what was happening.
>> > The code works perfectly and the figure is clearly visible in the
>> component chapter-14 :
>>
>> It is probably not related to the figure itself. Something may be
>> different in this component compared to the other ones. I cannot really
>> say, of course. Still, using external image instead of inline metapost may
>> be fix it. Not elegant, but if it works it works!
>>
>> Good luck,
>> Taco
>>
>>
>> >
>> > \startcomponent[chapter-14]
>> > \startMPpage
>> > ...
>> > \stopMPpage
>> > \stopcomponent
>> >
>> > But if I compile my project, it disappears !!
>> >
>> > \startproduct[terminale-manual]
>> >  \startbodymatter
>> >       \component[chapter-1]
>> >       \component[chapter-2]
>> >       \component[chapter-3]
>> >       \component[chapter-4]
>> >       \component[chapter-5]
>> >       \component[chapter-6]
>> >       \component[chapter-7]
>> >       \component[chapter-8]
>> >       \component[chapter-9]
>> >       \component[chapter-10]
>> >       \component[chapter-11]
>> >       \component[chapter-12]
>> >       \component[chapter-13]
>> >       \component[chapter-14]
>> >     \stopbodymatter
>> > \stopproduct
>>
>> —
>> Taco Hoekwater              E: taco@bittext.nl
>> genderfluid (all pronouns)
>>
>>
>>
>> ___________________________________________________________________________________
>> 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: 5614 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-25 21:12         ` Fabrice Couvreur
@ 2024-04-26  7:20           ` Taco Hoekwater
  2024-04-26  8:32             ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2024-04-26  7:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 25 Apr 2024, at 23:12, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> 
> Hi,
> Here is the code that interferes with the graph from the last chapter but why ?

Because of this “path b”:
      
>              path circle, p, q, b;

which interferes with the assignment line from the other graphic code:

>              b := xpart(reverse C_f intersectionpoint reverse C_g);

because there “b” is a now a path, not a numeric.

Adding 

   numeric a,b;

fixes the problem in chapter 14. 

But why it does not affect chapters 6-13, that I do not understand.


— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)


___________________________________________________________________________________
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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-26  7:20           ` Taco Hoekwater
@ 2024-04-26  8:32             ` Aditya Mahajan
  2024-04-26 10:22               ` Fabrice Couvreur
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2024-04-26  8:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

On Fri, 26 Apr 2024, Taco Hoekwater wrote:

> 
> 
> > On 25 Apr 2024, at 23:12, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> > 
> > Hi,
> > Here is the code that interferes with the graph from the last chapter but why ?
> 
> Because of this “path b”:
>       
> >              path circle, p, q, b;
> 
> which interferes with the assignment line from the other graphic code:
> 
> >              b := xpart(reverse C_f intersectionpoint reverse C_g);
> 
> because there “b” is a now a path, not a numeric.
> 
> Adding 
> 
>    numeric a,b;
> 
> fixes the problem in chapter 14. 

Woundn't newnumeric be better? 

There are very few instances where I want variables defined in one block to be reused in another block. So, I almost always use

\startMPcode
begingroup;
....
endgroup;
\stopMPcode

to avoid such issues. 

Aditya

[-- 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] 10+ messages in thread

* [NTG-context] Re: The graph is not visible.
  2024-04-26  8:32             ` Aditya Mahajan
@ 2024-04-26 10:22               ` Fabrice Couvreur
  0 siblings, 0 replies; 10+ messages in thread
From: Fabrice Couvreur @ 2024-04-26 10:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2009 bytes --]

Hi,
Thanks for your help. I did several tests playing only with the code of
component 5 which interferes with that of component 14.

@Aditya
begingroup;
.....
endgroup;
does not work.

@Hans
save defaultfont, defaultscale;

maybe also:

save circle, p, q, b ;

I get an empty rectangle in place of the graph in composant 5.

@Taco
The solution that works is to add component 14 to the code

numeric a, b;

Fabrice


Le ven. 26 avr. 2024 à 10:45, Aditya Mahajan <adityam@umich.edu> a écrit :

> On Fri, 26 Apr 2024, Taco Hoekwater wrote:
>
> >
> >
> > > On 25 Apr 2024, at 23:12, Fabrice Couvreur <
> fabrice1.couvreur@gmail.com> wrote:
> > >
> > > Hi,
> > > Here is the code that interferes with the graph from the last chapter
> but why ?
> >
> > Because of this “path b”:
> >
> > >              path circle, p, q, b;
> >
> > which interferes with the assignment line from the other graphic code:
> >
> > >              b := xpart(reverse C_f intersectionpoint reverse C_g);
> >
> > because there “b” is a now a path, not a numeric.
> >
> > Adding
> >
> >    numeric a,b;
> >
> > fixes the problem in chapter 14.
>
> Woundn't newnumeric be better?
>
> There are very few instances where I want variables defined in one block
> to be reused in another block. So, I almost always use
>
> \startMPcode
> begingroup;
> ....
> endgroup;
> \stopMPcode
>
> to avoid such issues.
>
>
> Aditya___________________________________________________________________________________
> 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: 4550 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] 10+ messages in thread

end of thread, other threads:[~2024-04-26 10:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 10:27 [NTG-context] The graph is not visible Fabrice Couvreur
2024-04-25 11:31 ` [NTG-context] " Taco Hoekwater
2024-04-25 14:08   ` Fabrice Couvreur
2024-04-25 14:31     ` Hans Hagen
2024-04-25 14:32     ` Taco Hoekwater
2024-04-25 14:55       ` Fabrice Couvreur
2024-04-25 21:12         ` Fabrice Couvreur
2024-04-26  7:20           ` Taco Hoekwater
2024-04-26  8:32             ` Aditya Mahajan
2024-04-26 10:22               ` 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).