[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
With Okular, it works !

Le dim. 12 mai 2024 à 17:55, Hans Hagen  a écrit :

> On 5/12/2024 5:36 PM, Fabrice Couvreur wrote:
> > Sorry for the comment !
> > I use Evince
> so how about okular or mupdf
>
> -
>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
>
> ___
>
___
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
___


[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
Sorry for the comment !
I use Evince

Le dim. 12 mai 2024 à 17:30, Hans Hagen  a écrit :

> On 5/12/2024 3:57 PM, Fabrice Couvreur wrote:
> > Hi,
> > When I want to draw the curve which corresponds to n=60 (blue curve), it
> > doesn't seem possible: I don't understand.
> > Thanks
> > Fabrice
> >
> >   \startMPpage[offset=1DK]
> >
> >numeric u;
> >u = 6cm;
> >
> >interim linejoin := mitered;
> >interim ahangle := 30;
> >
> >path xx, yy;
> >xx = ( (-0.3,0) -- 1.4 right) scaled u;
> >yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;
> >
> >def compute_curve(suffix f)(expr xmin, xmax, xinc) =
> >((xmin,f(xmin))
> >for x=xmin+xinc step xinc until xmax:
> > .. (x,f(x))
> >endfor)
> >enddef;
> >
> >
> >for i = 1 upto 4:
> >
> >vardef f(expr x) =x+exp(-i*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;
> >
> >draw curve;
> >
> >endfor;
> >
> >vardef f(expr x) =x+exp(-6*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;
> >
> >draw curve;
> >
> >vardef f(expr x) =x+exp(-15*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;
> >
> >draw curve;
> >
> >
> >vardef f(expr x) =x+exp(-60*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not
> > drawn
>
> best put a comment before the ->>>>>>>
>
> >draw curve withcolor blue;
> >
> >
> >drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
> >drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;
> >
> >
> >label.urt("A",(0,1u));
> >
> >draw xx;
> >draw  yy;
> >
> >draw (1u,0) -- (1u,1.8u);
> >
> >
> >label.llft("0",(0,0));
> >
> > vardef mark_y_axis(expr value, name) =
> >  save p; pair p; p = value * u * up;
> >  draw (left--right) scaled 1 shifted p;
> >  label.lft(name, p shifted 2 left);
> >enddef;
> >
> >for a = 1 upto 1:
> >  mark_y_axis(a, "");
> >endfor
> >
> > mark_y_axis(1, "$1$");
> >
> >
> >   vardef mark_x_axis(expr value, name) =
> > save p; pair p; p = value * u * right;
> > draw (up--down) scaled 1 shifted p;
> > label.bot(name, p shifted 2 down);
> >   enddef;
> >
> >   for a = 1 upto 1:
> > mark_x_axis(a, "");
> >   endfor
> >
> >   mark_x_axis(1, "$1$");
> >
> >
> >path rectangle;
> >rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) --
> > (1.3u,1.4u) -- (-0.3u,1.4u)--cycle;
> >
> >clip currentpicture to rectangle;
> >   \stopMPpage
> >
> your exp usage:
>
>exp(-60*-0.4)
>
> if you see what huge numbers come out of that, like
>
> -51.006602 11100558579.857309 l
> -50.989594 11034154639.123087 l
> -50.972586 10968147929.149401 l
> -50.955579 10902536073.687559 l
> -50.938571 10837316710.703716 l
>
> you could imagine a viewer crapping out on that because no matter what
> one clips it still is 'kind of drawn', so what viewer do you use?
>
> 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
>
> ___
>
___
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
___


[NTG-context] Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it
doesn't seem possible: I don't understand.
Thanks
Fabrice

 \startMPpage[offset=1DK]

  numeric u;
  u = 6cm;

  interim linejoin := mitered;
  interim ahangle := 30;

  path xx, yy;
  xx = ( (-0.3,0) -- 1.4 right) scaled u;
  yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;

  def compute_curve(suffix f)(expr xmin, xmax, xinc) =
  ((xmin,f(xmin))
  for x=xmin+xinc step xinc until xmax:
   .. (x,f(x))
  endfor)
  enddef;


  for i = 1 upto 4:

  vardef f(expr x) =x+exp(-i*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

  draw curve;

  endfor;

  vardef f(expr x) =x+exp(-6*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

  draw curve;

  vardef f(expr x) =x+exp(-15*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

  draw curve;


  vardef f(expr x) =x+exp(-60*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not
drawn

  draw curve withcolor blue;


  drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
  drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;


  label.urt("A",(0,1u));

  draw xx;
  draw  yy;

  draw (1u,0) -- (1u,1.8u);


  label.llft("0",(0,0));

   vardef mark_y_axis(expr value, name) =
save p; pair p; p = value * u * up;
draw (left--right) scaled 1 shifted p;
label.lft(name, p shifted 2 left);
  enddef;

  for a = 1 upto 1:
mark_y_axis(a, "");
  endfor

   mark_y_axis(1, "$1$");


 vardef mark_x_axis(expr value, name) =
   save p; pair p; p = value * u * right;
   draw (up--down) scaled 1 shifted p;
   label.bot(name, p shifted 2 down);
 enddef;

 for a = 1 upto 1:
   mark_x_axis(a, "");
 endfor

 mark_x_axis(1, "$1$");


  path rectangle;
  rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) --
(1.3u,1.4u) -- (-0.3u,1.4u)--cycle;

  clip currentpicture to rectangle;
 \stopMPpage
___
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
___


[NTG-context] Re: The graph is not visible.

2024-04-26 Thread Fabrice Couvreur
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  a écrit :

> On Fri, 26 Apr 2024, Taco Hoekwater wrote:
>
> >
> >
> > > On 25 Apr 2024, at 23:12, Fabrice Couvreur <
> fabrice1.couvr...@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
>
> ___
>
___
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
___


[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
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 
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  a écrit :
>
>>
>>
>> > On 25 Apr 2024, at 16:08, 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 :
>>
>> 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: t...@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
>>
>> ___
>>
>
___
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
___


[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
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  a écrit :

>
>
> > On 25 Apr 2024, at 16:08, 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 :
>
> 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: t...@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
>
> ___
>
___
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
___


[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
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  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 
> 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: t...@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
&

[NTG-context] The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
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
___


[NTG-context] Re: lmt_shade fails

2024-02-19 Thread Fabrice L
Dear Keith,

> Le 18 févr. 2024 à 11:44, Keith McKay  a écrit :
> 
> Hi all
> I went to use the lmt_shade function and it fails with two error messages. 
> the first one is:
> 
> metafun > log > error: Not a cycle
> 
> followed by lots of trace messages, then:
> 
> metafun > log > That contour should have ended with '.. cycle' or '& 
> cycle'. So I'll not change
> anything just now.
> 
> The MWE I used is as follows:
> 
> \starttext
> \startMPpage
> definecolor [ name = "MyColor3", r = uniformdeviate(1), g = 
> uniformdeviate(1), b = uniformdeviate(1) ] ;
> definecolor [ name = "MyColor4", r = uniformdeviate(1), g = 
> uniformdeviate(1), b = uniformdeviate(1) ] ;
> draw lmt_shade [
> path = fullsquare scaled 5cm,
> direction = "up",
> alternative = "linear",
> colors = { "red", "green" },
> ];
> \stopMPpage
> \stoptext
>  I'm using:
> 
> system  > ConTeXt  ver: 2024.02.14 13:38 LMTX  fmt: 2024.2.15  int: 
> english/english
> 
> on a mac mini M1.
> 
> Any thougths?
> 

On an Mac running  ConTeXt  ver: 2023.09.26 18:19 LMTX  fmt: 2023.12.11 , this 
works perfectly. 
> Best wishes
> 
> Keith McKay
> 
Fabrice.
> ___
> 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
___


[NTG-context] Re: Chemnitz, Leipzig, Call for Poster

2024-01-11 Thread Fabrice L
Dear list, dear Hraban,

> Le 7 janv. 2024 à 13:58, Henning Hraban Ramm  a écrit :
> 
> Am 07.01.24 um 17:11 schrieb garulfo:
>> does this kind of poster would make sense ?
>> https://wiki.contextgarden.net/Cover_Pages#Poster_01_-_proposal_for_Libre_Planet_2021
> 
> Thank you, that looks good but it’s not what I had in mind.
> 
> I meant a poster _about_ ConTeXt, not only made with our toolset (I have a 
> stack of books for that). Maybe something about typography.
> 
> Here’s how the DANTE booth at FrOSCon 2023 looked like:
> https://yemaya.fiee.net/s/qTkeXAmXmJeosJc
> (The “mindmap” diagram on the left shows projects supported by DANTE, in the 
> middle a drawing by Duane Bibby, on the right a Tux with its TikZ source code 
> in the back.)
> We also had posters that show the architecture of TeX/LaTeX, but they were 
> seriously outdated.
> 
> Some elements that might fit:
> – some example code (like from Mikael’s BachoTeX presentation)
> – anatomy of a word and a formula (with all those little boxes and measures), 
> maybe also in Arabic
> – dodo & cow drawings from Mikael’s math manual
> – overview of layout areas (I re-made Sietse’s drawing from the wiki for my 
> book)
> - workflow diagrams
> – parts of LuaMetaTeX
> – artwork by Eçir Baff (art-aleatoire.com)
> – Hans’ recent christmas card / memory game artwork
> 
> But I don’t want just a wild collection of stuff, there should be something 
> connecting them. It should be interesting to look at as well as basic 
> information about ConTeXt.
> Hraban
> 

The suite ConTeXt/Metafun is so powerful, and can do so much different things, 
as already mentioned, that it can be difficult to present it in a coherent way. 
Perhaps this angle is that Context is a real Swiss Army knife: not only can it 
do lots of different things, it can do them very very well! 
You can take (and or I can provide in PDF of) any artwork from 
art-aleatoire.com <http://art-aleatoire.com/>, and if you wish/need I can 
contribute to an « art » part ! 

Fabrice.___
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
___


[NTG-context] Re: 2024

2024-01-02 Thread Fabrice L
Dear Hans,

> Le 2 janv. 2024 à 05:35, Hans Hagen via ntg-context  a 
> écrit :
> 
> On 1/1/2024 3:33 PM, vm via ntg-context wrote:
>> On 01/01/2024 13:28, Hans Hagen wrote:
>>> Of course it screams metapost but tex and lua are also involved. See it as 
>>> compensation for the lack of an end-of-year update. The last page of the 
>>> result has a bit of explanation.
>> Beautiful indeed !
>> (And thank you for all the good work)
>> Is the puzzle generator somewhere hidden to be found within the context 
>> module tree?
> It's not that much code but I need to add a keyword interface. It's also 
> something we might play with a little at this years meeting so ...
> 
> (I added a gray scale option for tyhose without color printer.)
> 
> Here's a big one (the xmas card):
> 
> http://www.pragma-ade.nl/ctx-group-2023.pdf
> 
> Hans

This is very beautiful, and inspiring ! 
Seems like a coded message from the past, or the future ! 
Fabrice. 

> 
> -
>  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
> ___

___
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
___


[NTG-context] Re: Size of subscript notations

2023-12-29 Thread Fabrice Couvreur
Perhaps the size should be even smaller because I personally find it still
a little large.

PS : In a thread, I thought I read that you had written a document on the
use of mathematics with ConTeXt, true or false?

Le ven. 29 déc. 2023 à 16:14, Mikael Sundqvist  a écrit :

> Great, all is good then. (Or?)
>
> /Mikael
>
> On Fri, Dec 29, 2023 at 5:07 PM Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> wrote:
>
>> Well, actually I get the same thing .
>> [image: test.png]
>>
>> Le ven. 29 déc. 2023 à 16:00, Mikael Sundqvist  a
>> écrit :
>>
>>> Hi,
>>>
>>> On Fri, Dec 29, 2023 at 4:49 PM Fabrice Couvreur
>>>  wrote:
>>> >
>>> > Thank you for your suggestion but in the following example the
>>> operational symbol is too big as well as the number 1.
>>> >
>>> > \mapfontsize[modern][script] [.4]
>>> > \mapfontsize[modern][scriptscript][.2]
>>> >
>>> > \setupbodyfont[modern,12pt]
>>> >
>>> > \startTEXpage[offset=1DK]
>>> >   \m{z_{n+1}}
>>> > \stopTEXpage
>>>
>>> Strange, here it looks OK. Maybe something that will be solved when
>>> there is an update then.
>>>
>>> /Mikael
>>>
>>> ___
>>> 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
>>
>> ___
>>
>
> ___
> 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
___


[NTG-context] Re: Size of subscript notations

2023-12-29 Thread Fabrice Couvreur
Well, actually I get the same thing .
[image: test.png]

Le ven. 29 déc. 2023 à 16:00, Mikael Sundqvist  a écrit :

> Hi,
>
> On Fri, Dec 29, 2023 at 4:49 PM Fabrice Couvreur
>  wrote:
> >
> > Thank you for your suggestion but in the following example the
> operational symbol is too big as well as the number 1.
> >
> > \mapfontsize[modern][script] [.4]
> > \mapfontsize[modern][scriptscript][.2]
> >
> > \setupbodyfont[modern,12pt]
> >
> > \startTEXpage[offset=1DK]
> >   \m{z_{n+1}}
> > \stopTEXpage
>
> Strange, here it looks OK. Maybe something that will be solved when
> there is an update then.
>
> /Mikael
>
> ___
> 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
___


[NTG-context] Re: Size of subscript notations

2023-12-29 Thread Fabrice Couvreur
Thank you for your suggestion but in the following example the operational
symbol is too big as well as the number 1.

\mapfontsize[modern][script] [.4]
\mapfontsize[modern][scriptscript][.2]

\setupbodyfont[modern,12pt]

\startTEXpage[offset=1DK]
  \m{z_{n+1}}
\stopTEXpage

Le ven. 29 déc. 2023 à 14:47, Mikael Sundqvist  a écrit :

> Hi,
>
> On Fri, Dec 29, 2023 at 3:17 PM Fabrice Couvreur
>  wrote:
> >
> > Hi,
> > To type my lessons or other, I use the Modern font in 12 pt or 11 pt. I
> find that the subscript notations are a little too big : how can I improve
> this ?
> > Thanks
> > Fabrice
> >
> > \m{ \forall n \in N, z_{n+1}=\frac{i}{3}z_n}
>
> you could try something like (here with too small numbers only to show...)
>
> \mapfontsize[modern][script] [.4]
> \mapfontsize[modern][scriptscript][.2]
>
> \setupbodyfont[modern,10pt]
>
> \startTEXpage[offset=1DK]
> \m{3^{2^3}}
> \stopTEXpage
>
> I hope it helps.
>
> /Mikael
>
> ___
> 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
___


[NTG-context] Size of subscript notations

2023-12-29 Thread Fabrice Couvreur
Hi,
To type my lessons or other, I use the Modern font in 12 pt or 11 pt. I
find that the subscript notations are a little too big : how can I improve
this ?
Thanks
Fabrice

\m{ \forall n \in N, z_{n+1}=\frac{i}{3}z_n}
___
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
___


[NTG-context] About framedtext

2023-12-13 Thread Fabrice Couvreur
Hi,
Is this a bug or not ?
The key to coloring the background of the text seems to no longer work.
Thanks
Fabrice

\definecolor[MyColorC][s=0.8784]
  \definecolor[MyColorD][m=0.27,y=1]
  \definecolor[ColorA][0.8(white)]
  \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
  \definecolor[MyColorA][.75(MyColorB,white)]

  \defineframed
  [FrameTitle]
  [frame=off,
   foregroundstyle=\bfx\ss,
   foregroundcolor=white,
   background=color,
   backgroundcolor=MyColorD,
   location=depth]

  \defineframedtext
  [FramedText]
  [offset=0.25em,
   style=\ss,
   toffset=\zeropoint,
   background=color,
   backgroundcolor=MyColorA,
   foregroundstyle={\switchtobodyfont[9pt]},
   align={right, broad},
   frame=off,
   corner=00,
   radius=0.5em,
   width=10cm]

  \definedescription
  [Info]
  [before=,
   after=,
   text=Info,
   title=no,
   width=fit,
   distance=0.5em,
   headcommand=\FrameTitle,
   alternative=serried]

\starttext
   \startFramedText[width=5cm]
\startInfo
 \input{ward}
\stopInfo
\stopFramedText
\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
___


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Fabrice Couvreur
Hi Wolfgang,
I'm reading this thread and I'm interested because I type a lot of text
with mathematical formulas.
In fact, I find that \dfrac{} creates unsightly leading space and that
\frac{} is too small. What is the difference between \frac{} and \tfrac{} ?
Fabrice

Le sam. 9 déc. 2023 à 14:00, Henning Hraban Ramm  a écrit :

> Am 09.12.23 um 14:43 schrieb Wolfgang Schuster:
> > anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:
> > \startlines
> > \type{\frac{1}{3}}: \m{\frac{1}{3}}
> > \type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
> > \type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
> > \type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
> > \type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
> > \type{\frac{1}{3}}: \m{\frac{1}{3}}
> > \type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
> > \type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
> > \type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
> > \type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
> > \stoplines
>
> There’s also \vulgarfraction{1}{3} (but probably not suitable for your
> application).
>
> Hraban
>
>
> ___
> 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
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-04 Thread Fabrice L
Dear Emanuel,

> Le 2 déc. 2023 à 12:08, Emanuel Han via ntg-context  a 
> écrit :
> 
> Hi Mikael,
> 
> here's a very simple mwe for the label(textext()) issue. On page 1, the text 
> "Word 1" should be drawn in position z1. On page 2, the same text in the same 
> position should be visible, and the text "Mot 2" in position p2 should be 
> added. And so on.
> 
> \startMPinclusions
> 
> picture p[];
>  path TheFrame ;
>  TheFrame := fullsquare scaled 5in ;
>  
>  z1 = (60,40);
>  z2 = (40,90); 
>  z3 = (10,70);
> 
> p1:=image(
> label(textext("Word 1"), z1);
> );
> 
> p2:=image(
> label(textext("Mot 2"), z2);
> );
> 
> p3:=image(
> label(textext("Parola 3"), z3);
> );
> 
> \stopMPinclusions
> 
> \starttext
> 
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]  
>  currentime := #1 ;
>  % Just for learning :
>  draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
>  draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
>  for k=1 upto currentime: draw p[k]; endfor
>  setbounds currentpicture to TheFrame ;
> 
>  desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
>  currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>  
> \stopMPpage
> }
> 
> \stoptext
> 
> On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> Hi Emanuel,
> 
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
> 
> addto currentpicture also p1;
> 
> where you want it.
> 
> /Mikael
> 
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
> 
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
> >> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> >>
> >> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> >>
> >> \definefontfeature
> >> [fea]
> >> [mode=node,language=dflt,script=arab,
> >> init=yes,
> >> medi=yes,
> >> fina=yes,
> >> isol=yes,
> >> calt=yes,
> >> rlig=yes,
> >> tlig=yes,
> >> trep=yes,
> >> curs=yes,
> >> kern=yes,
> >> mark=yes
> >> ]
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsy

[NTG-context] Re: externalfigure crashed

2023-12-03 Thread Fabrice Couvreur
Hi Hans,
It works, thank you very much.

Le sam. 2 déc. 2023 à 16:24, Hans Hagen  a écrit :

> On 12/2/2023 4:57 PM, Fabrice Couvreur wrote:
> > Hi Hans,
> > I have the same problem and definitely need to use \externalfigure[]
> > this weekend. In which file should this patch be added ?
> > Thanks.
> cont-new.mkxl
>
> -
>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
>
> ___
>
___
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
___


[NTG-context] Re: externalfigure crashed

2023-12-02 Thread Fabrice Couvreur
Hi Hans,
I have the same problem and definitely need to use \externalfigure[] this
weekend. In which file should this patch be added ?
Thanks.
Fabrice

Le ven. 24 nov. 2023 à 17:16, Hans Hagen via ntg-context 
a écrit :

> On 11/22/2023 10:02 PM, Hans van der Meer via ntg-context wrote:
> > Here too, I find 'undefined' from \meaning\expandeddetokenize
> \ifdefined\expandeddetokenize\else
> \let\expandeddetokenize\detokenize
> \fi
>
> will do for now ... i can't upload a new installer .. pending the built;
> the advantage is that i can do some experiments that would otherwise
> break the current version (making compact font mode very close to
> normal, pdf signing, adapting to the latest validation, math magick,
> etc); so fixes have to wait (but are done anyway)
>
> 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
>
> ___
>
___
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
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-27 Thread Fabrice L
Hi,

It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
multiple times. Here is an example which build an animation of a particle 
moving according to a Brownian motion. 

Fabrice.

% 8< ---

\usecolors[crayola]
\setupMPinstance

\starttext

% We can put in the inclusions the material we will use at each page, to 
declare things only one time.
\startMPinclusions
 % the frame of the video ;
 path TheFrame ;
 TheFrame := fullsquare scaled 5in ;

 randomseed := 53 ;
 path TheBrownianMotion ;
 pair Coordinate[];
 Coordinate[0] := (0,0);
 TheBrownianMotion := Coordinate[0] ;
 variance := 10 ;
\stopMPinclusions

\dorecurse{600}{ % Frame

\setupMPpage[background=color, backgroundcolor=SpringGreen]
\startMPpage[pagestate=start]

 currentime := #1 ;
 % Just for learning :
 draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
 draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;

Coordinate[currentime] := Coordinate[currentime-1] + 
%(normaldeviate*variance,normaldeviate*variance) ;
  ((uniformdeviate(1)-0.5)*variance,(uniformdeviate(1)-0.5)*variance) ;
TheBrownianMotion := for p=0 upto (currentime-1) :
  Coordinate[p] .. endfor Coordinate[currentime] ;

draw TheBrownianMotion withpen pencircle scaled .01in withcolor blue ;
draw Coordinate[currentime] withpen pencircle scaled .10in withcolor red ;

setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage

} 

\stoptext
% 8< ---



> Le 27 nov. 2023 à 13:49, Emanuel Han via ntg-context  a 
> écrit :
> 
> How can I achieve multipage metapost output from ConTeXt? The result should 
> be a multipage pdf. It contains just a metapost graphic per page. The graphic 
> has always the same bounding box and evolves from page to page: Some elements 
> to be drawn are added, and some others would ideally also be removed, while 
> keeping elements which has already been drawn on previous pages. I can manage 
> when it is not possible to remove elements (in that case I'll just cover them 
> with a covering element).
> 
> I saw that it is possible to achieve my goal with standalone metapost, as 
> described here: 
> https://tex.stackexchange.com/questions/471662/mptopdf-is-multipage-output-pdf-possible
> But I'll need to achieve this with Metapost inside ConTeXt because I use 
> labels in Metapost which print text in Japanese, Korean , Arabic and Roman 
> script: Thanks to ConTeXt, I can define appropriate fonts for each script. 
> All this works already in my working example.
> 
> The only unsolved problem is to ship out multiple pages.
> 
> For the minimal working example, I didn't remove the font defining part, 
> because having 4 different fonts is a condition of my use case. The graphic 
> on the other hand is some simple dummy nonsense graphic not from my project. 
> The graphic is in the provided example drawn as a summing up of layered 
> drawing steps (6 steps, to be precise), so no removing is implemented here 
> (because I don't know how that would be done). If each of the figures 1 to 6 
> of my mwe can be put alone on a page, I'd be already very happy. Now, they're 
> put on top of each other all on the same single page, also on top of figure 0.
> 
> The desired multipage pdf will be used in presentation mode of a pdf viewer 
> and skipped forward and backward from page to page (that is from drawing step 
> to drawing step).
> 
> mwe:
> 
> \enableregime[utf] % enable unicoded input
> 
> \definefontfamily [RomanFont] [rm] [calluna]
> 
> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> 
> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> 
> \definefontfeature
>  [fea]
>  [mode=node,language=dflt,script=arab,
>   init=yes,
>   medi=yes,
>   fina=yes,
>   isol=yes,
>   calt=yes,
>   rlig=yes,
>   tlig=yes,
>   trep=yes,
>   curs=yes,
>   kern=yes,
>   mark=yes
> ]
> 
> \starttypescript [serif] [notonaskharabic]
>  \definefontsynonym [notonaskharabic-Light]   [name:notonaskharabic]  
>   [features=fea]
>  \definefontsynonym [notonaskharabic-Bold][name:notonaskharabic]  
>   [features=fea]
>  \definefontsynonym [notonaskharabic-Italic]  [name:notonaskharabic]  
>   [features=fea]
>  \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic]  
>   [features=fea]
> \stoptypescript
> 
> \starttypescript [serif] [notonaskharabic]
>  \usetypescript[serif][fallback]
>  \definefontsynonym [Serif]   [notonaskharabic-Light] 
>   [features=fea]
>  \definefontsynonym [SerifItalic]

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-21 Thread Fabrice Couvreur
Hi Fabrice,
Exactly, thanks for the correction.
Fabrice

Le lun. 20 nov. 2023 à 19:43, Fabrice L  a écrit :

> Hi,
>
> Fabrice, you have a problem with the definition of the path b: this path
> include q and b. To see this, replace your lines with :
>
>draw q anglestriped (1,45,2) withcolor cyan;
>draw b anglestriped (1,45,2) withcolor red;
>
> And you will see that the path b is drawn twice : once in red, once in
> cyan. So if you change your instructions to :
>
>draw q anglestriped (1,45,2) withcolor cyan;
>draw r anglestriped (1,45,2) withcolor cyan;
>
> This will correct the problem, because each path is now drawn only once.
>
> Fabrice.
>
> Le 20 nov. 2023 à 14:47, Fabrice Couvreur  a
> écrit :
>
> Hi Otared,
> It's true that the color seems identical.
> Thanks.
> Fabrice
>
> Le dim. 19 nov. 2023 à 21:55, Otared Kavian  a écrit :
>
>> Hi Fabrice,
>>
>> It seems to me the colors are the same, although they may appear
>> different at first sight because the « with » of the lines are different
>> (the width is larger in the lower rectangle).
>>
>> I attach the PDF created with your code.
>>
>> Best regards: Otared
>>
>>
>>
>> On 19 Nov 2023, at 18:56, Fabrice Couvreur 
>> wrote:
>>
>> Hi,
>> I don't understand why the hatching of the two rectangles is not the same
>> color.
>> Thanks for your help.
>> Fabrice
>>
>> \starttext
>> \setupbodyfont[8pt]
>> \startMPcode
>>path p, q, r, b ;
>>
>>z[0] = (2cm,0cm) ;
>>z[1] = (2cm,2cm) ;
>>z[2] = (0cm,2cm) ;
>>
>>p := unitsquare xyscaled (9cm, 5cm) ;
>>q := llcorner p--z[0]--z[1]--z[2]--cycle ;
>>r := unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
>>b := z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--
>>z[0]--llcorner p--cycle ;
>>
>>
>>draw b anglestriped (1,45,2) withcolor cyan;
>>draw q anglestriped (1,45,2) withcolor cyan;
>>
>>draw p ;
>>
>>label.llft("A", p) ;
>>label.lrt("D", p) ;
>>label.ulft("B", p) ;
>>label.urt("C", p) ;
>>label.lft("M", z[2]) ;
>>label.ulft("N", z[1]) ;
>>label.bot("P", z[0]) ;
>>label.top("J", ulcorner r) ;
>>label.rt("I", lrcorner r) ;
>>label.bot(btex $x$ etex,(llcorner p+z[0])/2);
>>label.lft(btex $x$ etex,(llcorner p+z[2])/2);
>> \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
>>
>> ___
>>
>>
>> Otared Kavian
>> e-mail: ota...@gmail.com 
>> Phone: +33 6 88 26 70 95
>>
>>
>>
>>
>>
>> ___
>> 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
>
> ___

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-20 Thread Fabrice L
Hi,

Fabrice, you have a problem with the definition of the path b: this path 
include q and b. To see this, replace your lines with :

   draw q anglestriped (1,45,2) withcolor cyan;
   draw b anglestriped (1,45,2) withcolor red;

And you will see that the path b is drawn twice : once in red, once in cyan. So 
if you change your instructions to :

   draw q anglestriped (1,45,2) withcolor cyan;
   draw r anglestriped (1,45,2) withcolor cyan;

This will correct the problem, because each path is now drawn only once. 

Fabrice. 

> Le 20 nov. 2023 à 14:47, Fabrice Couvreur  a 
> écrit :
> 
> Hi Otared,
> It's true that the color seems identical.
> Thanks.
> Fabrice
> 
> Le dim. 19 nov. 2023 à 21:55, Otared Kavian  <mailto:ota...@gmail.com>> a écrit :
>> Hi Fabrice,
>> 
>> It seems to me the colors are the same, although they may appear different 
>> at first sight because the « with » of the lines are different (the width is 
>> larger in the lower rectangle).
>> 
>> I attach the PDF created with your code.
>> 
>> Best regards: Otared
>> 
>> 
>> 
>>> On 19 Nov 2023, at 18:56, Fabrice Couvreur >> <mailto:fabrice1.couvr...@gmail.com>> wrote:
>>> 
>>> Hi,
>>> I don't understand why the hatching of the two rectangles is not the same 
>>> color. 
>>> Thanks for your help.
>>> Fabrice
>>> 
>>> \starttext
>>> \setupbodyfont[8pt]
>>> \startMPcode
>>>path p, q, r, b ;
>>>  
>>>z[0] = (2cm,0cm) ;
>>>z[1] = (2cm,2cm) ;
>>>z[2] = (0cm,2cm) ;
>>> 
>>>p := unitsquare xyscaled (9cm, 5cm) ;
>>>q := llcorner p--z[0]--z[1]--z[2]--cycle ;
>>>r := unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
>>>b := z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--
>>>z[0]--llcorner p--cycle ;
>>>
>>>   
>>>draw b anglestriped (1,45,2) withcolor cyan;
>>>draw q anglestriped (1,45,2) withcolor cyan;
>>>
>>>draw p ;
>>>
>>>label.llft("A", p) ;
>>>label.lrt("D", p) ;
>>>label.ulft("B", p) ;
>>>label.urt("C", p) ;
>>>label.lft("M", z[2]) ;
>>>label.ulft("N", z[1]) ;
>>>label.bot("P", z[0]) ;
>>>label.top("J", ulcorner r) ;
>>>label.rt("I", lrcorner r) ;
>>>label.bot(btex $x$ etex,(llcorner p+z[0])/2);
>>>label.lft(btex $x$ etex,(llcorner p+z[2])/2);
>>> \stopMPcode
>>> 
>>> \stoptext
>>> 
>>> ___
>>> If your question is of interest to others as well, please add an entry to 
>>> the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>>> webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / 
>>> https://context.aanhet.net <https://context.aanhet.net/> (mirror)
>>> archive  : https://github.com/contextgarden/context
>>> wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/>
>>> ___
>> 
>> Otared Kavian
>> e-mail: ota...@gmail.com <mailto:ota...@gmail.com>
>> Phone: +33 6 88 26 70 95
>> 
>> 
>> 
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>> webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / 
>> https://context.aanhet.net <https://context.aanhet.net/> (mirror)
>> archive  : https://github.com/contextgarden/context
>> wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/>
>> ___
> 

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-20 Thread Fabrice Couvreur
Hi Otared,
It's true that the color seems identical.
Thanks.
Fabrice

Le dim. 19 nov. 2023 à 21:55, Otared Kavian  a écrit :

> Hi Fabrice,
>
> It seems to me the colors are the same, although they may appear different
> at first sight because the « with » of the lines are different (the width
> is larger in the lower rectangle).
>
> I attach the PDF created with your code.
>
> Best regards: Otared
>
>
>
> On 19 Nov 2023, at 18:56, Fabrice Couvreur 
> wrote:
>
> Hi,
> I don't understand why the hatching of the two rectangles is not the same
> color.
> Thanks for your help.
> Fabrice
>
> \starttext
> \setupbodyfont[8pt]
> \startMPcode
>path p, q, r, b ;
>
>z[0] = (2cm,0cm) ;
>z[1] = (2cm,2cm) ;
>z[2] = (0cm,2cm) ;
>
>p := unitsquare xyscaled (9cm, 5cm) ;
>q := llcorner p--z[0]--z[1]--z[2]--cycle ;
>r := unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
>b := z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--
>z[0]--llcorner p--cycle ;
>
>
>draw b anglestriped (1,45,2) withcolor cyan;
>draw q anglestriped (1,45,2) withcolor cyan;
>
>draw p ;
>
>label.llft("A", p) ;
>label.lrt("D", p) ;
>label.ulft("B", p) ;
>label.urt("C", p) ;
>label.lft("M", z[2]) ;
>label.ulft("N", z[1]) ;
>label.bot("P", z[0]) ;
>label.top("J", ulcorner r) ;
>label.rt("I", lrcorner r) ;
>label.bot(btex $x$ etex,(llcorner p+z[0])/2);
>label.lft(btex $x$ etex,(llcorner p+z[2])/2);
> \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
>
> ___
>
>
> Otared Kavian
> e-mail: ota...@gmail.com 
> Phone: +33 6 88 26 70 95
>
>
>
>
>
> ___
> 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
___


[NTG-context] Strange behavior with anglestriped()

2023-11-19 Thread Fabrice Couvreur
Hi,
I don't understand why the hatching of the two rectangles is not the same
color.
Thanks for your help.
Fabrice

\starttext
\setupbodyfont[8pt]
\startMPcode
   path p, q, r, b ;

   z[0] = (2cm,0cm) ;
   z[1] = (2cm,2cm) ;
   z[2] = (0cm,2cm) ;

   p := unitsquare xyscaled (9cm, 5cm) ;
   q := llcorner p--z[0]--z[1]--z[2]--cycle ;
   r := unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
   b := z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--
   z[0]--llcorner p--cycle ;


   draw b anglestriped (1,45,2) withcolor cyan;
   draw q anglestriped (1,45,2) withcolor cyan;

   draw p ;

   label.llft("A", p) ;
   label.lrt("D", p) ;
   label.ulft("B", p) ;
   label.urt("C", p) ;
   label.lft("M", z[2]) ;
   label.ulft("N", z[1]) ;
   label.bot("P", z[0]) ;
   label.top("J", ulcorner r) ;
   label.rt("I", lrcorner r) ;
   label.bot(btex $x$ etex,(llcorner p+z[0])/2);
   label.lft(btex $x$ etex,(llcorner p+z[2])/2);
\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
___


[NTG-context] Re: Large unwanted white space

2023-10-22 Thread Fabrice Couvreur
Hi,
Thanks, it works perfectly.
Fabrice

Le sam. 21 oct. 2023 à 20:33, Hans Hagen  a écrit :

> On 10/21/2023 9:43 PM, Fabrice Couvreur wrote:
> > Hi,
> > I don't know if I will explain my problem clearly but I will try. For my
> > students' tests, I use a master file. If I insert this piece of code,
> there
> > is a large white space that is created between the horizontal line of the
> > header and the first exercise.
>
> \startMPcode makes an image so it will take space
>
> for definitions use \startMPdefinitions
>
>
> > \startMPcode
> >def suite (expr n, t) =
> >begingroup
> > numeric u;
> > u := 5mm;
> > pickup pencircle scaled 5pt;
> > for i=0 upto n:
> >   for j=0 upto n:
> >   drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred};
> >   endfor
> > endfor
> >endgroup
> >enddef;
> >
> >def Suite (expr n, t) =
> >begingroup
> >numeric u;
> >u := 5mm;
> >pickup pencircle scaled 5pt;
> >for i=0 upto n:
> >   drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue};
> >endfor
> >endgroup
> >enddef;
> >
> >def cross (expr n, t) =
> >begingroup
> >numeric u;
> >u := 5mm;
> >pickup pencircle scaled 5pt;
> >for i=-n upto n:
> >   drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue};
> >endfor
> >endgroup
> >enddef;
> > \stopMPcode
> > __ %horizontal
> line
> > % big unwanted white space
> > \starttext
> > % \startex First exercise
> > \startlinecorrection[blank]
> >  \startmidaligned
> >\startcombination[1*2]
> >  {\startMPcode
> >Suite(2,0);
> >cross(1,1);
> >Suite(4,4);
> >cross(2,6);
> >Suite(6,10);
> >cross(3,13);
> >\stopMPcode
> >  }{\tfx \bf Suite 1}
> > {\startMPcode
> >suite(0,0);
> >suite(1,2);
> >suite(2,5);
> >\stopMPcode
> >  }{\tfx \bf Suite 2}
> >  \stopcombination
> > \stopmidaligned
> >   \stoplinecorrection
> >%\stopex
> > \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
> >
> ___
>
> --
>
> -
>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
>
> ___
>
___
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
___


[NTG-context] Large unwanted white space

2023-10-21 Thread Fabrice Couvreur
Hi,
I don't know if I will explain my problem clearly but I will try. For my
students' tests, I use a master file. If I insert this piece of code, there
is a large white space that is created between the horizontal line of the
header and the first exercise.
Thanks for your help.
Fabrice

\startMPcode
  def suite (expr n, t) =
  begingroup
   numeric u;
   u := 5mm;
   pickup pencircle scaled 5pt;
   for i=0 upto n:
 for j=0 upto n:
 drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred};
 endfor
   endfor
  endgroup
  enddef;

  def Suite (expr n, t) =
  begingroup
  numeric u;
  u := 5mm;
  pickup pencircle scaled 5pt;
  for i=0 upto n:
 drawdot(i*u,0) shifted(t*u,0) withcolor \MPcolor{blue};
  endfor
  endgroup
  enddef;

  def cross (expr n, t) =
  begingroup
  numeric u;
  u := 5mm;
  pickup pencircle scaled 5pt;
  for i=-n upto n:
 drawdot(0,i*u) shifted(t*u,0) withcolor \MPcolor{blue};
  endfor
  endgroup
  enddef;
\stopMPcode
__ %horizontal line
   % big unwanted white space
   \starttext
   % \startex First exercise
\startlinecorrection[blank]
\startmidaligned
  \startcombination[1*2]
{\startMPcode
  Suite(2,0);
  cross(1,1);
  Suite(4,4);
  cross(2,6);
  Suite(6,10);
  cross(3,13);
  \stopMPcode
}{\tfx \bf Suite 1}
   {\startMPcode
  suite(0,0);
  suite(1,2);
  suite(2,5);
  \stopMPcode
}{\tfx \bf Suite 2}
\stopcombination
   \stopmidaligned
 \stoplinecorrection
  %\stopex
\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
___


[NTG-context] Re: Gray gradient with Metapost

2023-10-07 Thread Fabrice Couvreur
Hi,
Sorry for the late response. Thanks for the help. So I read the documents
and managed to get a gradient even if it's not exactly like the figure.
Fabrice

draw lmt_shade [
  path = (z0--z4--z5--z1--cycle),
  direction = "left",
  alternative = "linear",
  colors = {"black", "lightgray"},
] ;

Le ven. 6 oct. 2023 à 08:27, Henning Hraban Ramm  a écrit :

> While the luametafun (“Metafun XL”) manual is also (meta)fun, I meant
> the general metafun(-s|-p) manual, the big one (>400 p. in the “print”
> version, >600 p. in the “screen” version). Recommended!
>
> Hraban
>
> Am 06.10.23 um 10:08 schrieb Keith McKay:
> > Also look at the LuaMetaFun manual chapter 8. In fact the whole manual
> > is worth a read. I'm sure you find much of use in it.
> > Best Wishes
> > Keith
> >
> > On Thu, 5 Oct 2023, 20:52 Henning Hraban Ramm,  > <mailto:te...@fiee.net>> wrote:
> >
> > Am 05.10.23 um 21:50 schrieb Fabrice Couvreur:
> >  > Hi,
> >  > I would like to obtain, if possible, a gray gradient like in the
> > image.
> >  > My code uses Metapost but maybe this is possible with Metafun.
> >
> > Have a look into the Metafun manual, chapter 8.1 “shading”.
> >
> > Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
> 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 : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki : https://wiki.contextgarden.net
___


[NTG-context] Gray gradient with Metapost

2023-10-05 Thread Fabrice Couvreur
Hi,
I would like to obtain, if possible, a gray gradient like in the image. My
code uses Metapost but maybe this is possible with Metafun.
Thanks.
Fabrice

 \starttext
  \startMPcode
u=1.2cm;
interim ahangle := 30;

z0=(0,0);
z1=(3u,0);
z2=(3u,4u);
z3=(0,4u);
z4=(0.8u,4u);
z5=(2.2u,4u);

path rectangle;
rectangle=z0--z1--z2--z3--cycle;

picture X;
X = image(
drawoptions(withpen pencircle scaled 1.25 withcolor
\MPcolor{orange});
draw (left--right) scaled 2;
draw (down--up) scaled 2;
drawoptions();
);

fill z0--z4--z3--cycle withcolor .5[red,green];
fill z1--z5--z2--cycle withcolor .5[red,green];
fill z0--z4--z5--z1--cycle withcolor 0.625white;
draw z0--z4--z3--cycle;
draw z1--z5--z2--cycle;
draw rectangle;

path a[];
a1 = subpath (0, 1) of rectangle shifted 10 down;
a2 = subpath (3, 4) of rectangle shifted 10 left;
a3 = subpath (2.26, 2.76) of rectangle shifted 13 up;

drawdblarrow a1; label.bot("$30$", point 1/2 of a1);
drawdblarrow a2; label.lft("$x+20$", point 1/2 of a2);
drawdblarrow a3; label.top("$x$", point 1/2 of a3);

draw X shifted z0;
draw X shifted z1;
draw X shifted z2;
draw X shifted z3;
draw X shifted z4;
draw X shifted z5;

label.ulft("B",z3);
label.urt("C",z2);
label.lrt("D",z1);
label.llft("A",z0);
label.top("E",z4);
label.top("F",z5);
  \stopMPcode

 \stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Tikz calendar problem.

2023-09-05 Thread Fabrice L
Dear Aditya,

> Le 5 sept. 2023 à 04:21, Aditya Mahajan  a écrit :
> 
> On Mon, 4 Sep 2023, Fabrice L wrote:
> 
>> Dear list,
>> 
>> I have a problem with tikzCalendar on a recent installation. This minimal 
>> example :
>> 
>> 8< 
>> 
>> \usemodule[tikz]
>> \usetikzlibrary[calendar]
>> 
>> \starttext
>> This should works:
>> \blank
>> \tikz  \calendar[dates=2000-01-01 to 2000-01-31,week list];
>> \blank
>> but this does not !
>> \stoptext
>> 
>> 8< 
>> 
>> should work, but does not. The problem seems to be here:
>> 
>> open source > level 2, order 61, name 'tikzlibrarycalendar.code.tex'
>> modules > 'pgfcalendar' is not found
>> close source> level 2, order 61, name ‘tikzlibrarycalendar.code.tex'
>> 
>> The file « tikzlibrarycalendar.code.tex » is read, but the file « 
>> pgfcalendar » seems missing. I have reinstall a new standalone version of 
>> ConTeXt, with all the modules (with the new script from ConTeXt Garden), but 
>> nothing works. 
> 
> Here is what is going on:
> 
> `tikzlibrarycalendar.code.tex` contains the line:
> 
>  \pgfutil@usemodule{pgfcalendar}
> 
> In `generic/pgf/utilities/pgfutil-context.def`, \pgfutil@usemodule is defined 
> as:
> 
>  \def\pgfutil@usemodule#1{\usemodule[#1]}
> 
> which is supposed to load the file `plain/pgf/utilities/pgfcalendar.tex` 
> which just a wrapper to load `pgfcalendar.code.tex`:
> 
> 
>\edef\pgfcalendaratcode{\the\catcode`\@}
>\catcode`\@=11
> 
>\input pgfrcs.tex
>\input pgfcalendar.code.tex
> 
>\catcode`\@=\pgfcalendaratcode
> 
>\endinput
> 
> Now, the reason that this is not working is that the new module installer for 
> tikz removes all the files from `tex/plain`. It appears that tikz is at fault 
> here. If the file `pgfcalendar.tex` is supposed to used by both plain and 
> context, then it should be in `tex/generic` directory rather than `tex/plain` 
> directory. 
> 
> However, moving the file to `tex/generic` will not fix the issue directly 
> loading the above `pgfcalendar.code.tex` in context is surely going to fail 
> because of the manual catcode changes that are being done by pgfcalendar. 
> 
> So, I propose that we add a file `m-tikz-pgfcalendar.tex` as a wrapper around 
> `pgfcalendar.code.tex` and in `m-tikz.mk(xl|iv)` add
> 
> 
>  \definefilesynonym [pgfcalendar]  [tikz-pgfcalendar]
> 
> 
> I am attaching `m-tikz-calendar` which causes the original example to compile 
> (provided one adds the definefilesynonym before calling 
> \usetikzlibrary[calendar]). Can you please test if other features of 
> pgfcalendar are working with this file.
> 

This is working, thanks ! I tested some features of the calendar, and 
everything seems in order. I will continue today to work on this (a course 
syllabus).

> Aditya

Thanks again, you are a life saver ! 
Fabrice.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Tikz calendar problem.

2023-09-04 Thread Fabrice L
Dear list,

I have a problem with tikzCalendar on a recent installation. This minimal 
example :

8< 

\usemodule[tikz]
\usetikzlibrary[calendar]
 
\starttext
This should works:
\blank
\tikz  \calendar[dates=2000-01-01 to 2000-01-31,week list];
\blank
but this does not !
\stoptext

8< 

should work, but does not. The problem seems to be here:

open source > level 2, order 61, name 'tikzlibrarycalendar.code.tex'
modules > 'pgfcalendar' is not found
close source> level 2, order 61, name ‘tikzlibrarycalendar.code.tex'

The file « tikzlibrarycalendar.code.tex » is read, but the file « pgfcalendar » 
seems missing. I have reinstall a new standalone version of ConTeXt, with all 
the modules (with the new script from ConTeXt Garden), but nothing works. 


Thanks for any help,
Fabrice. ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Question about building an array of values with Lua

2023-08-25 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you so much
Fabrice

Le jeu. 24 août 2023 à 19:46, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Otared Kavian schrieb am 24.08.2023 um 12:50:
>
>
> On 24 Aug 2023, at 06:03, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
>
> […]
>
>
> I would drop the column check in this case.
>
> for i = 0,9 do
> context.startxrow()
> context.startxcell()
> context(i)
> context.stopxcell()
> context.startxcell()
> context(math.mod(i*i,10))
> context.stopxcell()
> context.startxcell()
> context(i)
> context.stopxcell()
> context.startxcell()
> context(math.mod(2*i*i,10))
> context.stopxcell()
> context.stopxrow()
> end
>
> Wolfgang
>
>
> Indeed this is much more elegant… It feels so good to be on this list and
> learn from such insights :-)
>
>
> We don't even need the math.mod function because Lua added with version
> 5.1 a modulo operator,
> the loop to create the row can now be changed to
>
> for i = 0,9 do
> context.startxrow()
> context.startxcell()
> context(i)
> context.stopxcell()
> context.startxcell()
> context(i * i % 10)
> context.stopxcell()
> context.startxcell()
> context(i)
> context.stopxcell()
> context.startxcell()
> context(2 * i * i % 10)
> context.stopxcell()
> context.stopxrow()
> end
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Question about building an array of values with Lua

2023-08-24 Thread Fabrice Couvreur
Hi Otared and Wolgang,
Thanks for the answers. In fact, being familiar with Python and not at all
with Lua, I didn't have the reflex to think of using a mathematical
function which gives the remainder in the Euclidean division by 10, it's
strange !!
Fabrice

Le jeu. 24 août 2023 à 04:06, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Otared Kavian schrieb am 24.08.2023 um 01:04:
>
> Hi Fabrice,
>
> As Wolfgang points out, it is indeed possible to fill-in your table with
> Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this
> case you need to use the Lua function math.mod as in the following, which
> is a completed version of what Wolfgang sent:
>
>
> I guess I completely missed the units digit part :)
>
> %% begin filling-with-lua.tex
> \starttext
>
> \startluacode
> context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor =
> "black" }
> context.startxrow{ background = "color", backgroundcolor = "lightgray"
> }
> context.startxcell{ nx = 4 }
> context("Units digit of")
> context.stopxcell()
> context.stopxrow()
> context.startxrow()
> context.startxcell{ width = "1cm" }
> context.im("a")
> context.stopxcell()
> context.startxcell{ width = "1cm" }
> context.im("a^2")
> context.stopxcell()
> context.startxcell{ width = "1cm" }
> context.im("b")
> context.stopxcell()
> context.startxcell{ width = "1cm" }
> context.im("2b^2")
> context.stopxcell()
> context.stopxrow()
> for i = 0,9 do
> context.startxrow()
> for j = 1,4 do
> context.startxcell()
> if j == 1 then
> context(i)
> elseif j == 2 then
> context(math.mod(i*i,10))
>  elseif j == 3 then
>   context(i)
>  else
>   context(math.mod(2*i*i,10))
> end
> context.stopxcell()
> end
> context.stopxrow()
> end
>
>
> I would drop the column check in this case.
>
> for i = 0,9 do
> context.startxrow()
> context.startxcell()
> context(i)
> context.stopxcell()
> context.startxcell()
> context(math.mod(i*i,10))
> context.stopxcell()
> context.startxcell()
> context(i)
> context.stopxcell()
> context.startxcell()
> context(math.mod(2*i*i,10))
> context.stopxcell()
> context.stopxrow()
> end
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Question about building an array of values with Lua

2023-08-23 Thread Fabrice Couvreur
Hi,
I'm trying to fill an array using lua. So far it works but then I don't
know if it's possible.
Thanks
Fabrice

 \startluacode

context.startxtable({"align={middle,lohi},bodyfont=9pt,framecolor=black"})
  context.startxrow({"background=color,
backgroundcolor=lightgray"})
  context.startxcell({"nx=4"})
  context("Units digit of")
  context.stopxcell()
  context.stopxrow()
  context.startxrow()
  context.startxcell({"width=1cm"})
  context("\\im{a}")
  context.stopxcell()
  context.startxcell({"width=1cm"})
  context("\\im{a²}")
  context.stopxcell()
  context.startxcell({"width=1cm"})
  context("\\im{b}")
  context.stopxcell()
  context.startxcell({"width=1cm"})
  context("\\im{2b²}")
  context.stopxcell()
  context.stopxrow()
  for i = 0, 9 do
  context.startxrow()
  context.startxcell()
  context(i)
  context.stopxcell()
  context.stopxrow()
  end
  context.stopxtable()
 \stopluacode
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Equivalent of the \cancel command with conTeXt

2023-08-22 Thread Fabrice Couvreur
Hi Mikael,
Thank you for this command ; there must be many others that I don't know
how they work.
Fabrice

Le mar. 22 août 2023 à 10:54, Mikael Sundqvist  a écrit :

> Hi,
>
> On Tue, Aug 22, 2023 at 12:25 PM Fabrice Couvreur
>  wrote:
> >
> > Hi,
> > In an algebraic expression, it is sometimes interesting to cross out
> terms. With LaTeX, there is the \cancel command from the package cancel. Is
> there an equivalent with conTeXt ?
> > Thanks
> > Fabrice
>
> I don't know what the cancel package gives, but since December 22 or
> so, one can do
>
> \starttext
>
> \setupframed
> [mathstrikeout]
> [color=darkgreen,
> backgroundcolor=darkred,
> frame=off]
>
> \startTEXpage[offset=4dk,align=flushleft]
> \dm{1+\mathstrikeout[strike:text={what is this?}]{(2x-x)}+2=3+x}
> \blank
> \dm{1+\mathstrikeout[strike:math={=x}]{(2x-x)}+2=3+x}
> \blank
> \dm{1+\mathstrikeout[strike:math=u,arrow=no]{(2x-x)}+2=3+x}
> \blank
> \dm{1+\mathcrossout[strike:math={=x}]{(2x-x)}+2=3+x}
> \stopTEXpage
>
> \stoptext
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Equivalent of the \cancel command with conTeXt

2023-08-22 Thread Fabrice Couvreur
Hi Alexander,
Thank you for this suggestion which will do the trick.
Fabrice

Le mar. 22 août 2023 à 10:26, Alexandre Christe  a
écrit :

> Hi Fabrice,
>
> I have this from former exchanges
>
> % Cancel command for use in equations.
> \startuniqueMPgraphic{cross out}
>  picture cross;
>  cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0););
>  draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle
> scaled .8pt ;
> \stopuniqueMPgraphic
>
> \defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}]
>
> \define[1]\cancel{%
>  \ifmmode
>  \mframed[background=canceloverlay, frame=off, offset=overlay]{{#1}}%
>  \else%
>  \framed[background=canceloverlay, frame=off, offset=overlay]{{#1}}%
>  \fi%
> }
>
> Maybe something else is available nowadays.
>
> A. Christe
> Le 22 août 2023 à 12:22 +0200, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com>, a écrit :
>
> Hi,
> In an algebraic expression, it is sometimes interesting to cross out
> terms. With LaTeX, there is the \cancel command from the package cancel. Is
> there an equivalent with conTeXt ?
> Thanks
> Fabrice
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : https://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Equivalent of the \cancel command with conTeXt

2023-08-22 Thread Fabrice Couvreur
Hi,
In an algebraic expression, it is sometimes interesting to cross out terms.
With LaTeX, there is the \cancel command from the package cancel. Is there
an equivalent with conTeXt ?
Thanks
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Key distance with enumeration

2023-07-27 Thread Fabrice Couvreur
Hi,
I don't understand why the distance between the dot and the first letter of
the text is not always the same (see with theorem).
Thanks
Fabrice

\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   distance=1cm,
   title=yes,
   titleleft=,
   titleright=,
   titlestyle=normal,
   prefix=no,
   prefixsegments=chapter,
   way=bychapter,
   prefixconversionset=digit,
   counter=,
   headcommand=\groupedcommand{}{.},
   numbercommand=\groupedcommand{}{},
   titlecommand=\groupedcommand{(}{)},
   width=broad]

\defineenumeration
   [definition]
   [text=Définition,
number=yes,
style=italic]

\defineenumeration
   [theorem]
   [text=Théorème,
number=yes,
style=italic]


\starttext
 \startdefinition
 Un polynôme est une application de R dans R somme d'un nombre fini de
monômes.
\stopdefinition
\starttheorem
  La forme réduite d'un polynôme est unique à l'ordre près des monômes
qui le constituent.
\stoptheorem
\startdefinition
  Le degré d'un polynôme {\bi non nul} est le degré du monôme de plus
haut degré figurant dans son écriture réduite.
\stopdefinition
\startdefinition
  Le terme constant d'un polynôme est le coefficient (éventuellement
nul) de son monôme de degré 0.
\stopdefinition

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: context-on-web broken

2023-07-04 Thread Fabrice L
Dear Aditya,

> Le 26 juin 2023 à 13:53, Aditya Mahajan via ntg-context  
> a écrit :
> 
> On Mon, 26 Jun 2023, Miguel Diaz via ntg-context wrote:
> 
>> indeed it is a simple simulation of overleaf (for latex). 
> 
> FWIW, context works on overleaf as well!
> 
> Simply create a `latexmkrc` file with the following content:
> 
> ```
> $pdflatex="context --synctex=1 --result=output %S; cp output.log 
> /compile/output.log;cp output.pdf /compile/output.pdf";
> $recorder=0;
> $pdf_mode=1;
> ```

This is a very precious information, thanks a lot  ! Most often, I’m isolated 
working with ConTeXt, most collaborators using LaTeX. Of course, some have seen 
the amazing things we can do with ConTeXt, and are using it a bit, but 
installation remains a challenge for most of them. Being able to work and share 
an overleaf project is a way to work in a collaborative way in ConTeXt (and 
Metafun of course !).

> 
> Aditya

Tanks agin for the tip ! 
Fabrice.

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Problem with exponent

2023-04-28 Thread Fabrice Couvreur via ntg-context
Hi,
I want to write x'² . Only, I get x²'.
Thanks
Fabrice

\starttext
\m{{x'}²+{y'}²}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Table of contents not appearing.

2023-04-21 Thread Fabrice Couvreur via ntg-context
An extra parenthesis in a section title seems to be the problem but I'm not
sure. I compiled the file line by line and it works now.
Thanks
Fabrice

Le ven. 21 avr. 2023 à 14:37, Hans Hagen via ntg-context 
a écrit :

> On 4/21/2023 5:05 PM, Fabrice Couvreur via ntg-context wrote:
> > It's chapter_5 that's the problem, but how do you know what's causing
> > the table of contents not to appear ?
> depends on the error : the toc comes from the tuc file so if that one is
> not made ...
>
> -
>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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Table of contents not appearing.

2023-04-21 Thread Fabrice Couvreur via ntg-context
It's chapter_5 that's the problem, but how do you know what's causing the
table of contents not to appear ?

Le ven. 21 avr. 2023 à 14:42, Fabrice Couvreur 
a écrit :

> Hi Hans,
> Alright, I'll compile by integrating one component at a time to figure out
> which one is causing the problem.
> Thanks.
> Fabrice
>
> Le jeu. 20 avr. 2023 à 15:52, Hans Hagen via ntg-context <
> ntg-context@ntg.nl> a écrit :
>
>> On 4/20/2023 6:59 PM, Fabrice Couvreur via ntg-context wrote:
>> > Hi,
>> > I don't see why the table of contents does not appear. On the other
>> > hand, the 12 chapters are present.
>>
>> \startproduct[terminale-manual]
>>
>>  \startfrontmatter
>>  \starttitle[title=Table des matières]
>>  \placelist
>> [chapter,section,subsection,subsubsection]
>> [criterium=all,
>> interaction=all,
>>  alternative=c]
>>  \stoptitle
>>  \stopfrontmatter
>>
>>  \startbodymatter
>>  \chapter{xxx}
>>  \stopbodymatter
>>
>> \stopproduct
>>
>> shows a table of contents so it must be something in your components
>>
>> > Fabrice
>> >
>> >
>> > \startproduct[terminale-manual]
>> >
>> >\project[terminale-environment]
>> >\startfrontmatter
>> >
>> >  \setuppagenumbering
>> > [location=]
>> >
>> >  \definefont
>> >[ChapterTextStyle]
>> >[SansBold*default sa 2.2]
>> >
>> >  \setuphead
>> >[title]
>> >[style=ChapterTextStyle,
>> > align=flushright]
>> >
>> >  \setuplist
>> > [chapter]
>> > [style=bold,
>> >  alternative=b,
>> >  width=1em]
>> >
>> >  \setuplist
>> > [section]
>> > [margin=1em,
>> >  width=1.75em]
>> >
>> >  \setuplist
>> > [subsection]
>> > [margin=2.75em,
>> >  width=2.25em,
>> > distance=\spaceamount]
>> >
>> >
>> >  \starttitle[title=Table des matières]
>> >
>> >   \placelist
>> > [chapter,section,subsection,subsubsection]
>> > [criterium=all,
>> > interaction=all,
>> >  alternative=c]
>> >
>> >\stoptitle
>> >
>> >  \stopfrontmatter
>> >
>> >  \startbodymatter
>> >\component[chapitre_1]
>> >\component[chapitre_2]
>> >\component[chapitre_3]
>> >\component[chapitre_4]
>> >\component[chapitre_5]
>> >\component[chapitre_6]
>> >\component[chapitre_7]
>> >\component[chapitre_8]
>> >\component[chapitre_9]
>> >\component[chapitre_10]
>> >\component[chapitre_11]
>> >\component[chapitre_12]
>> >  \stopbodymatter
>> >
>> > \stopproduct
>> >
>> >
>> >
>> ___
>> > If your question is of interest to others as well, please add an entry
>> to the Wiki!
>> >
>> > maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> > archive  : https://bitbucket.org/phg/context-mirror/commits/
>> > wiki : https://contextgarden.net
>> >
>> ___
>>
>> --
>>
>> -
>>Hans Hagen | PRAGMA ADE
>>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
>> -
>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Table of contents not appearing.

2023-04-21 Thread Fabrice Couvreur via ntg-context
Hi Hans,
Alright, I'll compile by integrating one component at a time to figure out
which one is causing the problem.
Thanks.
Fabrice

Le jeu. 20 avr. 2023 à 15:52, Hans Hagen via ntg-context 
a écrit :

> On 4/20/2023 6:59 PM, Fabrice Couvreur via ntg-context wrote:
> > Hi,
> > I don't see why the table of contents does not appear. On the other
> > hand, the 12 chapters are present.
>
> \startproduct[terminale-manual]
>
>  \startfrontmatter
>  \starttitle[title=Table des matières]
>  \placelist
> [chapter,section,subsection,subsubsection]
> [criterium=all,
> interaction=all,
>  alternative=c]
>  \stoptitle
>  \stopfrontmatter
>
>  \startbodymatter
>  \chapter{xxx}
>  \stopbodymatter
>
> \stopproduct
>
> shows a table of contents so it must be something in your components
>
> > Fabrice
> >
> >
> > \startproduct[terminale-manual]
> >
> >\project[terminale-environment]
> >\startfrontmatter
> >
> >  \setuppagenumbering
> > [location=]
> >
> >  \definefont
> >[ChapterTextStyle]
> >[SansBold*default sa 2.2]
> >
> >  \setuphead
> >[title]
> >[style=ChapterTextStyle,
> > align=flushright]
> >
> >  \setuplist
> > [chapter]
> > [style=bold,
> >  alternative=b,
> >  width=1em]
> >
> >  \setuplist
> > [section]
> > [margin=1em,
> >  width=1.75em]
> >
> >  \setuplist
> > [subsection]
> > [margin=2.75em,
> >  width=2.25em,
> > distance=\spaceamount]
> >
> >
> >  \starttitle[title=Table des matières]
> >
> >   \placelist
> > [chapter,section,subsection,subsubsection]
> > [criterium=all,
> > interaction=all,
> >  alternative=c]
> >
> >\stoptitle
> >
> >  \stopfrontmatter
> >
> >  \startbodymatter
> >\component[chapitre_1]
> >\component[chapitre_2]
> >\component[chapitre_3]
> >\component[chapitre_4]
> >\component[chapitre_5]
> >\component[chapitre_6]
> >\component[chapitre_7]
> >\component[chapitre_8]
> >\component[chapitre_9]
> >\component[chapitre_10]
> >\component[chapitre_11]
> >\component[chapitre_12]
> >  \stopbodymatter
> >
> > \stopproduct
> >
> >
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> >
> ___
>
> --
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Table of contents not appearing.

2023-04-20 Thread Fabrice Couvreur via ntg-context
Hi,
I don't see why the table of contents does not appear. On the other hand,
the 12 chapters are present.
Thanks
Fabrice


\startproduct[terminale-manual]

  \project[terminale-environment]
  \startfrontmatter

\setuppagenumbering
   [location=]

\definefont
  [ChapterTextStyle]
  [SansBold*default sa 2.2]

\setuphead
  [title]
  [style=ChapterTextStyle,
   align=flushright]

\setuplist
   [chapter]
   [style=bold,
alternative=b,
width=1em]

\setuplist
   [section]
   [margin=1em,
width=1.75em]

\setuplist
   [subsection]
   [margin=2.75em,
width=2.25em,
   distance=\spaceamount]


\starttitle[title=Table des matières]

 \placelist
   [chapter,section,subsection,subsubsection]
   [criterium=all,
   interaction=all,
alternative=c]

  \stoptitle

\stopfrontmatter

\startbodymatter
  \component[chapitre_1]
  \component[chapitre_2]
  \component[chapitre_3]
  \component[chapitre_4]
  \component[chapitre_5]
  \component[chapitre_6]
  \component[chapitre_7]
  \component[chapitre_8]
  \component[chapitre_9]
  \component[chapitre_10]
  \component[chapitre_11]
  \component[chapitre_12]
\stopbodymatter

\stopproduct
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About \blackrule

2023-04-20 Thread Fabrice Couvreur via ntg-context
Hi Wolfgang,
Thanks a lot.
Fabrice

Le mer. 19 avr. 2023 à 15:05, Wolfgang Schuster via ntg-context <
ntg-context@ntg.nl> a écrit :

> Fabrice Couvreur via ntg-context schrieb am 19.04.2023 um 17:01:
>
> Hi,
> The idea is to have a black square whose height is that of the number 3.
> Thanks
> Fabrice
>
> \setupbodyfont[12pt,pagella]
> \starttext
>  \blackrule[width=0.71em,height=0.71em]37254H
>
>
> \blackrule[width=\wdofstring{3},height=\htofstring{3},depth=\dpofstring{3}]
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] About \blackrule

2023-04-19 Thread Fabrice Couvreur via ntg-context
Hi,
The idea is to have a black square whose height is that of the number 3.
Thanks
Fabrice

\setupbodyfont[12pt,pagella]
\starttext
 \blackrule[width=0.71em,height=0.71em]37254H
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Userdata environment

2023-04-03 Thread Fabrice Couvreur via ntg-context
Hi,
I have already created a thread on the subject and Wolgang, Marco and Taco
have replied but the userdata environment is not yet clear to me. I would
like, if possible, to write a definition, a property or a theorem on the
left and illustrate it in the right margin with an example. In the code
below, the second example is on the second page and not next to the second
definition.
Thanks.
Fabrice


\
useMPlibrary[dum]

\setuppapersize[A4]

\mainlanguage
  [fr]

\setuppagenumbering
 [alternative=doublesided]

\setuplayout
  [width=12cm,
   rightmargin=60mm]


\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   distance=0.5em,
   title=yes,
   titleleft=,
   titleright=,
   titlestyle=normal,
   headcommand=\groupedcommand{}{.},
   numbercommand=\groupedcommand{}{},
   titlecommand=\groupedcommand{(}{)},
   width=fit]

\defineenumeration
   [definition]
   [text=Définition,
number=no,
style=italic]

\defineenumeration
   [exemple]
   [text=Exemple,
number=no,
style=normal]

\definemargindata[marginfigure][inright]
\setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]

\defineuserdata [margintext] [alternative=margintext]

\defineuserdataalternative [margintext] [renderingsetup=userdata:margintext]

\startsetups [userdata:margintext]
  \margindata
[inright]
[
 style={\switchtobodyfont[10pt]},
 width=\rightmarginwidth,
 align={flushleft,broad}
]
{\startexemple
 \getinlineuserdata
 \stopexemple}
  \stopsetups

\showframe
\starttext
\startchapter[title={First Chapter},ownnumber=1]
\startdefinition
 \input ward
\stopdefinition
\startuserdata [margintext]
  \input ward
\stopuserdata
\startdefinition
  \input ward
\stopdefinition
\startuserdata [margintext]
  \input knuth
\stopuserdata
\stopchapter
\stoptext


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with latest version ?

2023-01-06 Thread Fabrice Couvreur via ntg-context
Hi,
>From my side, after the last update, it works.
Thank you Hans.
Fabrice

Le ven. 6 janv. 2023 à 14:17, Gavin via ntg-context  a
écrit :

> Hi Hans,
>
> > On Jan 5, 2023, at 5:49 AM, Hans Hagen via ntg-context <
> ntg-context@ntg.nl> wrote:
> > On 1/5/2023 11:40 AM, Gavin via ntg-context wrote:
> >> ...I can try with the latest LMTX later today. The test file works with
> TeXLive 2022
> >> Gavin
> >> TEST FILE:
> >> \usemodule[tikz]
> >> \usemodule[pgfplots] % PGFPlots module for graphs
> >> \starttext
> >> \starttikzpicture
> >> \draw (0, 0) circle (3cm);
> >> \stoptikzpicture
> >> \starttikzpicture
> >>  \startaxis
> >>\addplot+[domain=0:360]
> >>{sin(x)};
> >>  \stopaxis
> >> \stoptikzpicture
> >> \stoptext
> > fixed in next upload (later today)
>
> I downloaded yesterday's upload. It did not work for me. I did a clean
> instal.
>
> ConTeXt  ver: 2023.01.04 11:35 LMTX  fmt: 2023.1.6  int: english/english
> ...
> tex error on line 14 in file ./TikZTest.tex: Control sequence expected
> instead of undefined
> 
>\startaxis
> 
>  \startaxis
>
>
> -Gavin
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with latest version ?

2023-01-04 Thread Fabrice Couvreur via ntg-context
The problem seems to come from pgfplots ...

Le mer. 4 janv. 2023 à 17:35, Fabrice Couvreur 
a écrit :

>
> Hi,
> I just installed the latest version of LMTX and also updated to texlive
> 2022 and I get this error message which was not the case before.
> Thank you.
> Fabrice
>
>
> Running `lmtX' on `complexes_2' with
> ``/home/fabrice/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
> context --autopdf --purgeall complexes_2''
>
> resolvers   | formats | executing runner 'run luametatex format':
> /home/fabrice/LMTX/tex/texmf-linux-64/bin/luametatex
> --jobname="./complexes_2.tex"
> --fmt=/home/fabrice/LMTX/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
> --lua=/home/fabrice/LMTX/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
>  --c:autopdf --c:currentrun=1 --c:fulljobname="./complexes_2.tex"
> --c:input="./complexes_2.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
> --c:texmfbinpath="/home/fabrice/LMTX/tex/texmf-linux-64/bin"
> system  >
> system  > ConTeXt  ver: 2023.01.04 11:35 LMTX  fmt: 2023.1.4  int:
> english/english
> system  >
> system  > 'cont-new.mkxl' loaded
> open source > level 1, order 1, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
> system  > beware: some patches loaded from cont-new.mkiv
> close source> level 1, order 1, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
> system  > files > jobname './complexes_2', input
> './complexes_2.tex', result './complexes_2'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> open source > level 1, order 2, name './complexes_2.tex'
> open source > level 2, order 3, name 'exercises.mkiv'
> open source > level 3, order 4, name 'terminale-modules.tex'
> open source > level 4, order 5, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/symb-imp-mvs.mkiv'
> close source> level 4, order 5, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/symb-imp-mvs.mkiv'
> fonts   > symbols > library 'mvs' loaded
> open source > level 4, order 6, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/colo-imp-xwi.mkiv'
> close source> level 4, order 6, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/colo-imp-xwi.mkiv'
> colors  > system 'xwi' is loaded
> modules > 'tikz' is loaded
> open source > level 4, order 7, name
> '/home/fabrice/LMTX/tex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl'
> open source > level 5, order 8, name 'pgfutil-common.tex'
> open source > level 6, order 9, name 'pgfutil-common-lists.tex'
> close source> level 6, order 9, name 'pgfutil-common-lists.tex'
> close source> level 5, order 9, name 'pgfutil-common.tex'
> open source > level 5, order 10, name 'pgfutil-context.def'
> close source> level 5, order 10, name 'pgfutil-context.def'
> open source > level 5, order 11, name 'pgfrcs.code.tex'
> close source> level 5, order 11, name 'pgfrcs.code.tex'
> open source > level 5, order 12, name 'pgfsys.code.tex'
> open source > level 6, order 13, name 'pgfkeys.code.tex'
> open source > level 7, order 14, name 'pgfkeysfiltered.code.tex'
> close source> level 7, order 14, name 'pgfkeysfiltered.code.tex'
> close source> level 6, order 14, name 'pgfkeys.code.tex'
> open source > level 6, order 15, name 'pgf.cfg'
> close source> level 6, order 15, name 'pgf.cfg'
> Driver file for pgf: pgfsys-pdftex.def
>
> open source > level 6, order 16, name 'pgfsys-pdftex.def'
> open source > level 7, order 17, name 'pgfsys-common-pdf.def'
> close source> level 7, order 17, name 'pgfsys-common-pdf.def'
> close source> level 6, order 17, name 'pgfsys-pdftex.def'
> close source> level 5, order 17, name 'pgfsys.code.tex'
> open source > level 5, order 18, name 'pgfkeys.code.tex'
> close source> level 5, order 18, name 'pgfkeys.code.tex'
> open source > level 5, order 19, name 'pgfsyssoftpath.code.tex'
> close source> level 5, order 19, name 'pgfsyssoftpath.code.tex'
> open source > level 5, order 20, name 'pgfsysprotocol.code.tex'
> close source> level 5, order 20, name 'pgfsysprotocol.code.tex'
> open source > level 5, order 21, name 'pgfcore.code.tex'
> open source > level 6, order 22, name 'pgfmath.code.

[NTG-context] Problem with latest version ?

2023-01-04 Thread Fabrice Couvreur via ntg-context
Hi,
I just installed the latest version of LMTX and also updated to texlive
2022 and I get this error message which was not the case before.
Thank you.
Fabrice


Running `lmtX' on `complexes_2' with
``/home/fabrice/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
context --autopdf --purgeall complexes_2''

resolvers   | formats | executing runner 'run luametatex format':
/home/fabrice/LMTX/tex/texmf-linux-64/bin/luametatex
--jobname="./complexes_2.tex"
--fmt=/home/fabrice/LMTX/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
--lua=/home/fabrice/LMTX/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
 --c:autopdf --c:currentrun=1 --c:fulljobname="./complexes_2.tex"
--c:input="./complexes_2.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
--c:texmfbinpath="/home/fabrice/LMTX/tex/texmf-linux-64/bin"
system  >
system  > ConTeXt  ver: 2023.01.04 11:35 LMTX  fmt: 2023.1.4  int:
english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './complexes_2', input
'./complexes_2.tex', result './complexes_2'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './complexes_2.tex'
open source > level 2, order 3, name 'exercises.mkiv'
open source > level 3, order 4, name 'terminale-modules.tex'
open source > level 4, order 5, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/symb-imp-mvs.mkiv'
close source> level 4, order 5, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/symb-imp-mvs.mkiv'
fonts   > symbols > library 'mvs' loaded
open source > level 4, order 6, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/colo-imp-xwi.mkiv'
close source> level 4, order 6, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/base/mkiv/colo-imp-xwi.mkiv'
colors  > system 'xwi' is loaded
modules > 'tikz' is loaded
open source > level 4, order 7, name
'/home/fabrice/LMTX/tex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl'
open source > level 5, order 8, name 'pgfutil-common.tex'
open source > level 6, order 9, name 'pgfutil-common-lists.tex'
close source> level 6, order 9, name 'pgfutil-common-lists.tex'
close source> level 5, order 9, name 'pgfutil-common.tex'
open source > level 5, order 10, name 'pgfutil-context.def'
close source> level 5, order 10, name 'pgfutil-context.def'
open source > level 5, order 11, name 'pgfrcs.code.tex'
close source> level 5, order 11, name 'pgfrcs.code.tex'
open source > level 5, order 12, name 'pgfsys.code.tex'
open source > level 6, order 13, name 'pgfkeys.code.tex'
open source > level 7, order 14, name 'pgfkeysfiltered.code.tex'
close source> level 7, order 14, name 'pgfkeysfiltered.code.tex'
close source> level 6, order 14, name 'pgfkeys.code.tex'
open source > level 6, order 15, name 'pgf.cfg'
close source> level 6, order 15, name 'pgf.cfg'
Driver file for pgf: pgfsys-pdftex.def

open source > level 6, order 16, name 'pgfsys-pdftex.def'
open source > level 7, order 17, name 'pgfsys-common-pdf.def'
close source> level 7, order 17, name 'pgfsys-common-pdf.def'
close source> level 6, order 17, name 'pgfsys-pdftex.def'
close source> level 5, order 17, name 'pgfsys.code.tex'
open source > level 5, order 18, name 'pgfkeys.code.tex'
close source> level 5, order 18, name 'pgfkeys.code.tex'
open source > level 5, order 19, name 'pgfsyssoftpath.code.tex'
close source> level 5, order 19, name 'pgfsyssoftpath.code.tex'
open source > level 5, order 20, name 'pgfsysprotocol.code.tex'
close source> level 5, order 20, name 'pgfsysprotocol.code.tex'
open source > level 5, order 21, name 'pgfcore.code.tex'
open source > level 6, order 22, name 'pgfmath.code.tex'
open source > level 7, order 23, name 'pgfmathcalc.code.tex'
open source > level 8, order 24, name 'pgfmathutil.code.tex'
fonts   > beware: no fonts are loaded yet, using 'lm mono' in box
close source> level 8, order 24, name 'pgfmathutil.code.tex'
open source > level 8, order 25, name 'pgfmathparser.code.tex'
close source> level 8, order 25, name 'pgfmathparser.code.tex'
open source > level 8, order 26, name 'pgfmat

Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-17 Thread Fabrice Couvreur via ntg-context
Hi Bruce and Pablo,
I'm sorry for the late reply but I'm running out of time right now. Thanks
for trying to solve the problem. I think the problem comes from the
pyramid.png file.
Fabrice

Le dim. 13 nov. 2022 à 14:37, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 11/13/22 11:32, Fabrice Couvreur via ntg-context wrote:
> > Hi Pablo,
> > Indeed but I posted these two files in a previous post.
>
> Hi Fabrice,
>
> the output from your ie_3.tex is too big for the list, so
> https://pdf.ousia.tk/ie_3.pdf contains it.
>
> I see no problem there, but I think that the output from
> https://mailman.ntg.nl/pipermail/ntg-context/2022/107191.html may come
> from a different source.
>
> BTW, I couldn’t find "ie_3.tex" in
> https://mailman.ntg.nl/pipermail/ntg-context/2022.txt.gz (which seems to
> be generated with messages previous to current date).
>
> If you sent the files before, it is fine to include a link to the
> relevant message in the list (such as the first link included in this
> message).
>
> BTW, it might be worth considering a GitHub or GitLab repository for not
> minimal samples. There files may be stored (and the whole repository
> might be deleted when not needed).
>
> I hope it helps,
>
> Pablo
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-16 Thread Fabrice Couvreur via ntg-context
Hi Bruce and Pablo,
I'm sorry for the late reply but I'm running out of time right now. Thanks
for trying to solve the problem. I think the problem comes from the
pyramid.png file.
Fabrice

Le mer. 16 nov. 2022 à 14:55, Fabrice Couvreur 
a écrit :

> Hi Bruce and Pablo,
> I'm sorry for the late reply but I'm running out of time right now. Thanks
> for trying to solve the problem. I think the problem comes from the
> pyramid.png file.
> Fabrice
>
> Le dim. 13 nov. 2022 à 14:37, Pablo Rodriguez via ntg-context <
> ntg-context@ntg.nl> a écrit :
>
>> On 11/13/22 11:32, Fabrice Couvreur via ntg-context wrote:
>> > Hi Pablo,
>> > Indeed but I posted these two files in a previous post.
>>
>> Hi Fabrice,
>>
>> the output from your ie_3.tex is too big for the list, so
>> https://pdf.ousia.tk/ie_3.pdf contains it.
>>
>> I see no problem there, but I think that the output from
>> https://mailman.ntg.nl/pipermail/ntg-context/2022/107191.html may come
>> from a different source.
>>
>> BTW, I couldn’t find "ie_3.tex" in
>> https://mailman.ntg.nl/pipermail/ntg-context/2022.txt.gz (which seems to
>> be generated with messages previous to current date).
>>
>> If you sent the files before, it is fine to include a link to the
>> relevant message in the list (such as the first link included in this
>> message).
>>
>> BTW, it might be worth considering a GitHub or GitLab repository for not
>> minimal samples. There files may be stored (and the whole repository
>> might be deleted when not needed).
>>
>> I hope it helps,
>>
>> Pablo
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-13 Thread Fabrice Couvreur via ntg-context
Hi Pablo,
Indeed but I posted these two files in a previous post.
Fabrice

Le dim. 13 nov. 2022 à 09:24, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 11/12/22 15:09, Fabrice Couvreur via ntg-context wrote:
> > Hi Pablo and Bruce,
> > Please try to figure out what is not working.
> > I'm sorry but I forgot in my previous post files.
>
> Hi Fabrice,
>
> I get empty files when compiling premiere-modules.tex and
> premiere-macros.tex and error message with tikz-style.tex.
>
> I guess a fourth file invoking the other three files may be missing here.
>
> Pablo
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
\environment[template.mkiv]

\definemargindata[marginfigure][inright]

\useMPlibrary[dum]

\setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]

\setvariables
[headertext]
[title={Interrogation écrite},
 number={3},
 day={8},
 month={11},
 year={2022},
 location={Premières},
 time={55 minutes}]

\showgrid
\startcomponent[ie_3]
  \startex
Nous considérons la suite \u définie sur \N par son premier terme \m{u_0=-2} et la relation de récurrence
\startformula
  \text{pour tout} \; n \in \N, \; u_{n+1}=\sqrt{3+u_n}.
\stopformula
Les termes de cette suite sont itérés par la fonction \m{f\,\colon x \longmapsto \sqrt{x+3}} qui est définie sur \intervalfo{-3}{+\infty}, et dont la représentation graphique \m{C_f} est donnée ci-après.
\startlinecorrection[blank]
  \startmidaligned
\externalfigure[spirale.pdf]
  \stopmidaligned
\stoplinecorrection
Représenter graphiquement les cinq premiers termes de cette suite.
  \stopex
  \startex
La suite \u est arithmétique de raison \m{r=-7} et de premier terme \m{u_0=5}.
\startitemize[n]
  \startitem
Calculer \m{u_{16}}.
  \stopitem
  \startitem
Calculer la somme
\startformula
  \sum_{k=0}^{k=16}u_k=u_0+u_1+u_2+\cdots + u_{15}+u_{16}.
\stopformula
  \stopitem
\stopitemize
  \stopex
  \startex
  On considère la suite arithmétique \u, définie sur \N, telle que \m{u_{12}=52} et \m{u_{23}=107}.
  \startitemize[n]
\startitem
  Calculer la raison \m{r} de la suite.
\stopitem
\startitem
  Déterminer le terme initial \m{u_0}.
\stopitem
\startitem
  Déterminer \m{u_n} en fonction de \m{n}, puis calculer \m{u_{55}}.
\stopitem
\startitem
  Donner le sens de variation de \u.
\stopitem
\startitem
  Conjecturer la limite éventuelle de la suite \u.
\stopitem
  \stopitemize
  \stopex
  \startex
   On s'intéresse à des pyramides construites avec des allumettes comme ci-après .

  En poursuivant ainsi, on obtient des pyramides à autant d'étages que l'on souhaite à condition, bien sûr, d'avoir assez d'allumettes.
\startlinecorrection[blank]
  \startmidaligned
\startcombination[3*1]
  {\externalfigure[pyramide_1.pdf]}{\tfx 1 étage}
  {\externalfigure[pyramide_2.pdf]}{\tfx 2 étages}
  {\externalfigure[pyramide_3.pdf]}{\tfx 3 étages}
\stopcombination
  \stopmidaligned
\stoplinecorrection
Le 1\high{\tfxx er} étage est formé de 3 allumettes, le 2\high{\tfxx e} de 7 allumettes, et le 3\high{\tfxx e} de 11 allumettes.
\startitemize[n]
  \startitem
   De combien d'allumettes est formé le 4\high{\tfxx e} étage ? Le 5\high{\tfxx e} ?
  \stopitem
  \startitem
Pour tout entier naturel \m{n\geqslant 1}, on note \m{u_n} le nombre d'allumettes du \m{n-\text{ième}} étage. Ainsi, nous avons \m{u_1=3}.

Justifier que la suite \u est arithmétique en précisant sa raison.
  \stopitem
  \startitem
Déterminer le calcul explicite de \m{u_n} en fonction de \m{n}, \m{u_1} et \m{r}.
  \stopitem
  \placerecipe{}{ \externalfigure[pyramide.png][scale=850]}
  \startitem
Déterminer le nombre d'allumettes du 10\high{\tfxx e} étage.
  \stopitem
  \startitem
Combien d'allumettes au total ont été nécessaires pour réaliser la construction jusqu'au 10\high{\tfxx e} étage ?
  \stopitem
   
  \startitem
On considère la fonction {\tt \darkred pyramide()} ci-contre programmée en langage Python.

À quoi correspond le nombre renvoyé par {\tt \darkred pyramide(3)} ?
  \stopitem
\stopi

Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-12 Thread Fabrice Couvreur via ntg-context
Hi Pablo and Bruce,
Please try to figure out what is not working.
I'm sorry but I forgot in my previous post files.
Fabrice

Le sam. 12 nov. 2022 à 12:28, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 11/11/22 21:58, Bruce Horrocks via ntg-context wrote:
> >> On 10 Nov 2022, at 17:06, Fabrice Couvreur via ntg-context wrote:
> >>
> >> Hi,
> >> Sorry to come back to you, but it seems to me that there is enough
> space here.
> >> Fabrice
> >
> > For some reason your PNG images came through in extremely low
> > resolution. Without having the ConTeXt source it's hard to say for sure
> > what's happening - for example, I would have expected the text on the
> > second page to be at the bottom of the first even if there wasn't room
> > for the image - because that was what was happening in your first
> example.
>
> Hi Fabrice and Bruce,
>
> I agree that the source would be helpful to say what may be hard for
> ConTeXt.
>
> In any case, ConTeXt has a hard time with pagebreaks when you combine
> elements that need both horizontal and vertical calculation, such as in:
>
>   \starttext
>   \dorecurse{64}
>   {\input knuth\footnote{\input zapf}
>
>   \startitemize[a, columns, eight, packed]
>   \dorecurse{64}{\item\currentitemnumber}
>   \stopitemize}
>   \stoptext
>
> There is a similar issue with paragraph notes.
>
> Pablo
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>

\startenvironment[premiere-modules]

  \usesymbols[mvs] 
  \usecolors[xwi]
  \usemodule[tikz]
  \usemodule[pgfplots]
  \usepgfplotslibrary[fillbetween]
  \pgfplotsset{compat=newest}
  \usetikzlibrary[arrows]
  \usetikzlibrary[automata]
  \usetikzlibrary[calc]
  \usetikzlibrary[backgrounds]
  \usetikzlibrary[intersections]
  \usetikzlibrary[patterns]
  \usetikzlibrary[bending]
  \usetikzlibrary[arrows.meta]
  \usetikzlibrary[shapes.geometric]
  \usetikzlibrary[plotmarks]
  \usetikzlibrary[shapes]
  \usetikzlibrary[trees]
  \usetikzlibrary[animations]
  \usetikzlibrary[quotes]
  \usetikzlibrary[mindmap]
  \usetikzlibrary[matrix,decorations.pathreplacing,fit,positioning]

\stopenvironment\startenvironment[premiere-macros]

  \unexpanded\def\R{\math{\mathbb{R}}\autoinsertnextspace}

  \protected\def\N{\doifnextcharelse{*}\MyNstarred\MyNnormal}

  \def\MyNstarred*{\m{\mathbb{N}^*}\autoinsertnextspace}
  \def\MyNnormal  {\m{\mathbb{N}  }\autoinsertnextspace}

  \define[1]\cscript
 {\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}}\stop} 


  %\protected\def\card#1{\m{\mfunction{Card}\thinspace(#1)}}

  \define[1]\card
 {\m{\mathtexttf{Card}\thinspace(#1)}\autoinsertnextspace}

  \define[1]\norm
{\math{\left\Vert#1\right\Vert}}

  \define\esp{\math{\mathcal{E}}\autoinsertnextspace}

  \define\espv{\math{\vec{\mathcal{E}}}\autoinsertnextspace}

  \define\repere
 {\m{\left(O\,;\vec{i}, \vec{j}\right)}\autoinsertnextspace}

  \define\base
 {\m{\left(\vec{i}, \vec{j}, \vec{k}\right)}\autoinsertnextspace}

 \protected\def\vector#1{%
   \starttikzpicture[baseline=(arg.base),>=stealth,thick]
   \node[inner xsep=0pt] (arg) {\m{#1}};
   \draw[->,shorten >=-2pt] (arg.north west) -- (arg.north east);
   \stoptikzpicture%
  }

  
  \definemathmatrix [pmatrix][matrix:parentheses][simplecommand=MATRIX]

  \unexpanded\def\intervalff#1#2{\math{\left[#1\nonscript\,;#2\right]}}
  
  \unexpanded\def\intervaloo#1#2{\math{\left]#1\nonscript\,;#2\right[}}
  
  \unexpanded\def\intervalfo#1#2{\math{\left[#1\nonscript\,;#2\right[}}
  
  \unexpanded\def\intervalof#1#2{\math{\left]#1\nonscript\,;#2\right]}}

  \define[1]\vabs{\math{\left\vert#1\right\vert}}

  \define\u{\math{\left(u_n\right)}\autoinsertnextspace}

  \define\v{\math{\left(v_n\right)}\autoinsertnextspace}

  \define\w{\math{\left(w_n\right)}\autoinsertnextspace}

  \unexpanded\def\euros#1{#1\,\symbol[europe][EUR]}

  \protected\def\point#1#2#3{\math{#1\left(#2\,;#3\right)}}

  \protected\def\coord#1#2{\math{\left(#1\,;#2\right)}}

  \define[2]\prod{\m{\vector{#1}\cdot\vector{#2}}}

   \protected\def\e#1{\math{{\rm e}^{#1}}\autoinsertnextspace}
  
\stopenvironment\startenvironment[tikz-style]

  \pgfplotsset{
/pgfplots/layers/Bowpark/.define layer set={
axis background,axis grid,main,axis ticks,axis lines,axis tick labels,
axis descriptions,axis fore

Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-10 Thread Fabrice Couvreur via ntg-context
Hi,
Sorry to come back to you, but it seems to me that there is enough space
here.
Fabrice

Le jeu. 10 nov. 2022 à 18:04, Fabrice Couvreur 
a écrit :

> Hi,
> Sorry to come back to you, but it seems to me that there is enough space
> here.
> Fabrice
>
> Le jeu. 10 nov. 2022 à 17:45, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> a écrit :
>
>> Hi,
>> Sorry to come back to you, but it seems to me that there is enough space
>> here.
>> Fabrice
>>
>> Le jeu. 10 nov. 2022 à 11:59, Fabrice Couvreur <
>> fabrice1.couvr...@gmail.com> a écrit :
>>
>>> Sorry to come back to you, but it seems to me that there is enough space
>>> here.
>>>
>>> Le jeu. 10 nov. 2022 à 11:36, Fabrice Couvreur <
>>> fabrice1.couvr...@gmail.com> a écrit :
>>>
>>>> Hi Bruce and Pablo,
>>>> Thank you very much, your explanations are very clear.
>>>> Cordially
>>>> Fabrice
>>>>
>>>> Le mer. 9 nov. 2022 à 19:39, Bruce Horrocks via ntg-context <
>>>> ntg-context@ntg.nl> a écrit :
>>>>
>>>>> On 9 Nov 2022, at 18:22, Pablo Rodriguez via ntg-context <
>>>>> ntg-context@ntg.nl> wrote:
>>>>> >
>>>>> > On 11/9/22 17:51, Fabrice Couvreur via ntg-context wrote:
>>>>> >> Hi,
>>>>> >> I find that for some time (but maybe the problem comes from me !),
>>>>> the
>>>>> >> placement of a figure at the bottom of the page causes a page break
>>>>> when
>>>>> >> it seems to me that there is enough space, which poses some
>>>>> problems in
>>>>> >> the pagination of my documents.
>>>>> >
>>>>> > Hi Fabrice,
>>>>> >
>>>>> > your figure requires about 7¼ lines (one line before, six for the
>>>>> image
>>>>> > itself, and some extra space after it).
>>>>> >
>>>>> > Your layout for the first page only allows 43 lines and sample text
>>>>> ends
>>>>> > on line 37.
>>>>> >
>>>>> > Replace \showframe with \showgrid and you will see that there might
>>>>> be
>>>>> > not enough space to fit the image in the first page.
>>>>> >
>>>>> > Add "bottomspace=7.25mm" to the layout for the first page and the
>>>>> image
>>>>> > will fit in the first page.
>>>>> >
>>>>> > Just in case it might help,
>>>>>
>>>>> Or Pablo's answer shown another way... change the end of the example
>>>>> to:
>>>>>
>>>>> \starttext
>>>>> \dorecurse{11}{\input ward}
>>>>> \placerecipe{}{\externalfigure[dum]}
>>>>> \dorecurse{5}{\input ward} %% extra
>>>>> \stoptext
>>>>>
>>>>> and the extra text shows how much space the image requires. Holding a
>>>>> ruler up to the screen you can see that it won't fit.
>>>>>
>>>>> The problem seems to be that the image is reserving space for a
>>>>> caption even though there isn't a caption. A work-around is to change
>>>>> \setupfloat to the following:
>>>>>
>>>>>  \setupfloat
>>>>>  [recipe]
>>>>>  [default={right,none,high}]
>>>>>
>>>>> and then the image fits as you want it to.
>>>>> —
>>>>> Bruce Horrocks
>>>>> Hampshire, UK
>>>>>
>>>>>
>>>>> ___
>>>>> If your question is of interest to others as well, please add an entry
>>>>> to the Wiki!
>>>>>
>>>>> maillist : ntg-context@ntg.nl /
>>>>> https://www.ntg.nl/mailman/listinfo/ntg-context
>>>>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>>>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>>>> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-10 Thread Fabrice Couvreur via ntg-context
Hi Bruce and Pablo,
Thank you very much, your explanations are very clear.
Cordially
Fabrice

Le mer. 9 nov. 2022 à 19:39, Bruce Horrocks via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 9 Nov 2022, at 18:22, Pablo Rodriguez via ntg-context <
> ntg-context@ntg.nl> wrote:
> >
> > On 11/9/22 17:51, Fabrice Couvreur via ntg-context wrote:
> >> Hi,
> >> I find that for some time (but maybe the problem comes from me !), the
> >> placement of a figure at the bottom of the page causes a page break when
> >> it seems to me that there is enough space, which poses some problems in
> >> the pagination of my documents.
> >
> > Hi Fabrice,
> >
> > your figure requires about 7¼ lines (one line before, six for the image
> > itself, and some extra space after it).
> >
> > Your layout for the first page only allows 43 lines and sample text ends
> > on line 37.
> >
> > Replace \showframe with \showgrid and you will see that there might be
> > not enough space to fit the image in the first page.
> >
> > Add "bottomspace=7.25mm" to the layout for the first page and the image
> > will fit in the first page.
> >
> > Just in case it might help,
>
> Or Pablo's answer shown another way... change the end of the example to:
>
> \starttext
> \dorecurse{11}{\input ward}
> \placerecipe{}{\externalfigure[dum]}
> \dorecurse{5}{\input ward} %% extra
> \stoptext
>
> and the extra text shows how much space the image requires. Holding a
> ruler up to the screen you can see that it won't fit.
>
> The problem seems to be that the image is reserving space for a caption
> even though there isn't a caption. A work-around is to change \setupfloat
> to the following:
>
>  \setupfloat
>  [recipe]
>  [default={right,none,high}]
>
> and then the image fits as you want it to.
> —
> Bruce Horrocks
> Hampshire, UK
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Page break with placement of a figure at the bottom of the page

2022-11-09 Thread Fabrice Couvreur via ntg-context
Hi,
I find that for some time (but maybe the problem comes from me !), the
placement of a figure at the bottom of the page causes a page break when it
seems to me that there is enough space, which poses some problems in the
pagination of my documents.
Thanks.
Fabrice

\useMPlibrary[dum]
\definelayout
   [1]
   [topspace=10mm,
header=15mm,
headerdistance=10mm,
height=middle,
width=middle,
location=middle]

\setuplayout
  [topspace=10mm,
header=0pt,
headerdistance=0pt,
height=middle,
width=middle,
location=middle]

\definefloat
[recipe]
[figure]

 \setupfloat
 [recipe]
 [default={right,none}]

 \showframe
\starttext
\dorecurse{11}{\input ward}
\placerecipe{}{\externalfigure[dum]}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Create the values of a sequence with Lua

2022-10-31 Thread Fabrice Couvreur via ntg-context
Hi,
The idea is to fill the array with the sequence defined by
p(0) = 0.3 and p(n + 1) = 0.3 + 0.7*p(n)
The problem is that I don't really master Lua but I will learn when I have
some time!
Thanks for your help.
Fabrice

\starttext
\startluacode
context.startxtable({"align={middle,lohi},width=2cm,bodyfont=9pt"})
p = {}
p[0] = 0.3
for i=0,19 do
p[i+1] = 0.3+0.7*p[i]^2 end
context.startxrow()
for i=0,19 do
context.startxcell() context(i) context.stopxcell()
context.startxcell() context(i+1) context.stopxcell()
context.startxcell() context("%0.8f",p[i] ) context.stopxcell()
context.stopxrow()
end
context.stopxtable()
\stopluacode
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
Hi Mikael,
Great job !
Thanks
Fabrice

Le dim. 2 oct. 2022 à 15:37, Mikael Sundqvist via ntg-context <
ntg-context@ntg.nl> a écrit :

> Hi,
>
> On Sun, Oct 2, 2022 at 3:26 PM Hans Hagen via ntg-context
>  wrote:
> >
> > On 10/2/2022 3:13 PM, Fabrice Couvreur via ntg-context wrote:
> > > Ok, it works very well. Without wanting to insist, how to have the same
> > > hatching with two different figures ?
> > see upcoming mail from Mikael
>
> Oh, OK, here it goes. Hans will probably rename things if he adds this.
>
> \startMPpage[offset=1dk]
>
> vardef Stripe(expr p, a, d) =
> save thestripe ; picture thestripe ; thestripe := nullpicture ;
> save diag ; numeric diag ; diag := 0.55*( abs((urcorner boundingbox p)
> - (llcorner boundingbox p)) ) ;
> thestripe := image (
> draw (-diag,0) -- (diag, 0) &&
> for i = d step d until diag:
> (-diag, i) -- (diag, i) &&
> (-diag,-i) -- (diag,-i) &&
> endfor nocycle
> withpen currentpen ;
> ) ;
> thestripe := thestripe shifted center boundingbox p ;
> thestripe := thestripe rotatedaround(center boundingbox p, a) ;
> clip thestripe to p ;
> thestripe
> enddef ;
>
>
> path p ; p := fullcircle scaled 3cm && (unitsquare scaled 2cm shifted
> (4cm,4cm)) && cycle ;
> fill p withcolor darkred ;
> draw Stripe(p,30,.2cm) withcolor darkgreen ;
>
> path q ; q := fullsquare randomized 0.3 scaled 3cm yshifted 5cm ;
> fill q withcolor yellow ;
> draw Stripe(q,70,.3cm) withcolor red ;
>
> draw Stripe(p && q && cycle, -20, .5cm) withcolor "orange" ;
>
> draw p ;
> draw q ;
>
> \stopMPpage
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
Ok, it works very well. Without wanting to insist, how to have the same
hatching with two different figures ?
Thanks.
Fabrice

Le dim. 2 oct. 2022 à 13:38, Hans Hagen via ntg-context 
a écrit :

> On 10/2/2022 1:02 PM, Fabrice Couvreur via ntg-context wrote:
> > I just tried but I got an empty file...
> > Do we agree that I have to replace the two lines with the other two ?
> > Regarding what you proposed, how to get the same type of hatching in
> > both figures ?
> no, we disagree here; add them after the min/max lines
>
> 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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
I just tried but I got an empty file...
Do we agree that I have to replace the two lines with the other two ?
Regarding what you proposed, how to get the same type of hatching in both
figures ?

 \startMPcode
path p, q, r, b ;
p  := unitsquare xyscaled (4cm,4cm) ;
z[0] = (2cm,0cm) ;
z[1] = (2cm,4cm) ;
z[2] = (0cm,2cm) ;
q := llcorner p--z[0]--z[1]--z[2]--cycle ;
r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
b := (0cm,0cm) -- lrcorner r -- lrcorner p -- cycle;

 draw r
 withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
 )
 withpatternscale 1/4
 withpen pencircle scaled 1bp
 withcolor green
 ;
draw b
 withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
 )
 withpatternscale 1/16
 withpen pencircle scaled 1bp
 withcolor green
 ;


draw b  withpen pencircle scaled 1bp  withcolor darkgreen;
draw r  withpen pencircle scaled 1bp  withcolor darkgreen;
draw p;

label.llft("B", p) ;
label.lrt("C", p) ;
label.ulft("A", p) ;
label.urt("D", p) ;
label.urt("F", lrcorner r) ;
label.lft("E", llcorner r) ;
label.top("G", urcorner r) ;

  \stopMPcode

Le dim. 2 oct. 2022 à 11:52, Hans Hagen via ntg-context 
a écrit :

> On 10/2/2022 11:20 AM, Floris van Manen via ntg-context wrote:
> >
> >
> > On 02/10/2022 10:55, Fabrice Couvreur via ntg-context wrote:
> >> Initially, there was a bug with maro numberstriped() and Hans
> >> suggested another sensible approach to me, but you don't get the same
> >> shape of the hatches depending on the dimensions of the squares.
> >
> > some unexpected side effect show up when the unitsquare is xyscaled to a
> > rectangle like (2.5cm,1cm)
> > it seems related to the angle chosen
> >
> > e.g.
> >
> >
> >
> > \startMPcode
> >
> > path p, q, r, b ;
> > p  := unitsquare xyscaled (4cm,4cm) ;
> > q := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
> > r := unitsquare xyscaled (2.5cm,1cm) shifted(1cm,3cm) ;
> > b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
> >
> > draw r anglestriped (1,35,2) withcolor red;
> > draw q anglestriped (1,35,2) withcolor green;
> > draw b anglestriped (1,35,2) withcolor cyan;
> > draw p;
> > draw q;
> > draw b;
> > draw r;
> >
> > label.llft("D", p) ;
> > label.lrt("C", p) ;
> > label.ulft("A", p) ;
> > label.urt("B", p) ;
> > label.urt("P", lrcorner r) ;
> > label.lft("Q", llcorner r) ;
> > label.top("M", urcorner r) ;
> >
> > \stopMPcode
>
> for that you can patch mp-tool.mpxl (l 676):
>
>  maximum := max (xpart llcorner mask, xpart urcorner mask, ypart
> llcorner mask, ypart urcorner mask) ;
>  minimum := min (xpart llcorner mask, xpart urcorner mask, ypart
> llcorner mask, ypart urcorner mask) ;
>  % a hack:
> maximum := maximum + max(xpart urcorner shape, ypart urcorner shape);
> minimum := minimum - max(xpart urcorner shape, ypart urcorner shape);
>
> a bit overkill but it seems to work
>
> 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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
Not only, it is also true with the code below :

\startMPcode
path p, q, r, b ;
p  := unitsquare xyscaled (4cm,4cm) ;
z[0] = (2cm,0cm) ;
z[1] = (2cm,4cm) ;
z[2] = (0cm,2cm) ;
q := llcorner p--z[0]--z[1]--z[2]--cycle ;
r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
b := (0cm,0cm) -- lrcorner r -- lrcorner p -- cycle;

draw r anglestriped (1,45,2) withcolor green;
draw b anglestriped (1,45,2) withcolor green;

draw b withcolor darkgreen;
draw r withcolor darkgreen;
draw p;

label.llft("B", p) ;
label.lrt("C", p) ;
label.ulft("A", p) ;
label.urt("D", p) ;
label.urt("F", lrcorner r) ;
label.lft("E", llcorner r) ;
label.top("G", urcorner r) ;

  \stopMPcode

Le dim. 2 oct. 2022 à 11:21, Floris van Manen via ntg-context <
ntg-context@ntg.nl> a écrit :

>
>
> On 02/10/2022 10:55, Fabrice Couvreur via ntg-context wrote:
> > Initially, there was a bug with maro numberstriped() and Hans suggested
> > another sensible approach to me, but you don't get the same shape of the
> > hatches depending on the dimensions of the squares.
>
> some unexpected side effect show up when the unitsquare is xyscaled to a
> rectangle like (2.5cm,1cm)
> it seems related to the angle chosen
>
> e.g.
>
>
>
> \startMPcode
>
> path p, q, r, b ;
> p  := unitsquare xyscaled (4cm,4cm) ;
> q := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
> r := unitsquare xyscaled (2.5cm,1cm) shifted(1cm,3cm) ;
> b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
>
> draw r anglestriped (1,35,2) withcolor red;
> draw q anglestriped (1,35,2) withcolor green;
> draw b anglestriped (1,35,2) withcolor cyan;
> draw p;
> draw q;
> draw b;
> draw r;
>
> label.llft("D", p) ;
> label.lrt("C", p) ;
> label.ulft("A", p) ;
> label.urt("B", p) ;
> label.urt("P", lrcorner r) ;
> label.lft("Q", llcorner r) ;
> label.top("M", urcorner r) ;
>
> \stopMPcode
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
Hi,
Initially, there was a bug with maro numberstriped() and Hans suggested
another sensible approach to me, but you don't get the same shape of the
hatches depending on the dimensions of the squares.
Your solution works perfectly but I'm trying to understand the action of
the parameters:
the first ?
the second represents the angle in degrees that the segments make
the third represents the gap between two segments
Thanks
Fabrice

Le sam. 1 oct. 2022 à 21:46, Mikael Sundqvist via ntg-context <
ntg-context@ntg.nl> a écrit :

> Hi,
>
> Is this what you are looking for?
>
> On Sat, Oct 1, 2022 at 7:43 PM Fabrice Couvreur via ntg-context
>  wrote:
> >
> > Hi Hans,
> > When the rectangles are not identical, how to have the same type of
> hatching in both ?
> > Thanks.
> > Fabrice
> >
> >
> > \starttext
> >  \startlinecorrection[blank]
> >   \startmidaligned
> > \switchtobodyfont[9pt]
> > \startMPcode
> >   path p, q, r, b ;
> >   p  := unitsquare xyscaled (4cm,4cm) ;
> >   z[0] = (2cm,0cm) ;
> >   z[1] = (2cm,4cm) ;
> >   z[2] = (0cm,2cm) ;
> >   q := llcorner p--z[0]--z[1]--z[2]--cycle ;
> >   r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
> >   b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
> >
>
> draw r anglestriped (1,45,2) withcolor cyan;
> draw b anglestriped (1,45,2) withcolor cyan;
>
> >
> >draw p;
> >draw b;
> >draw r;
> >
> >  label.llft("D", p) ;
> >  label.lrt("C", p) ;
> >  label.ulft("A", p) ;
> >  label.urt("B", p) ;
> >  label.urt("P", lrcorner r) ;
> >  label.lft("Q", llcorner r) ;
> > label.top("M", urcorner r) ;
> >
> >   \stopMPcode
> >   \stopmidaligned
> > \stoplinecorrection
> > \stoptext
> >
> >
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-10-01 Thread Fabrice Couvreur via ntg-context
Hi Hans,
When the rectangles are not identical, how to have the same type of
hatching in both ?
Thanks.
Fabrice


\starttext
 \startlinecorrection[blank]
  \startmidaligned
\switchtobodyfont[9pt]
\startMPcode
  path p, q, r, b ;
  p  := unitsquare xyscaled (4cm,4cm) ;
  z[0] = (2cm,0cm) ;
  z[1] = (2cm,4cm) ;
  z[2] = (0cm,2cm) ;
  q := llcorner p--z[0]--z[1]--z[2]--cycle ;
  r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
  b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;

  draw r
 withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
   )
   withpatternscale 1/8
   withpen pencircle scaled 1pt
   withcolor cyan;
   ;
 draw b
   withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
   )
   withpatternscale 1/16
   withpen pencircle scaled 1pt
   withcolor cyan;
   ;

   draw p;
   draw b;
   draw r;

 label.llft("D", p) ;
 label.lrt("C", p) ;
 label.ulft("A", p) ;
 label.urt("B", p) ;
 label.urt("P", lrcorner r) ;
 label.lft("Q", llcorner r) ;
label.top("M", urcorner r) ;

  \stopMPcode
  \stopmidaligned
\stoplinecorrection
\stoptext



Le mer. 28 sept. 2022 à 21:05, Henning Hraban Ramm via ntg-context <
ntg-context@ntg.nl> a écrit :

> Am 28.09.22 um 15:29 schrieb Hans Hagen via ntg-context:
> > On 9/28/2022 3:11 PM, Fabrice Couvreur via ntg-context wrote:
> >> PS : What is the exact meaning of the word "blobs" because my English
> >> is average ?
> > in order to get 'lines' you need to fill the two opposing corners with
> > "blobs of ink"
>
> Otherwise, a BLOB is a “binary large object”, e.g. if you save image
> data to a database.
>
> Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] About macro numberstriped ()

2022-09-28 Thread Fabrice Couvreur via ntg-context
Hi Hans,
Thank you for this solution which is an approach that I did not know.
Fabrice

PS : What is the exact meaning of the word "blobs" because my English is
average ?

Le mar. 27 sept. 2022 à 22:04, Hans Hagen via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 9/27/2022 7:49 PM, Fabrice Couvreur via ntg-context wrote:
> > Hello,
> > I notice a strange behavior of the macro numberstriped ( ).
> > Thanks.
> > Fabrice
> >
> > \starttext
> >   \switchtobodyfont[9pt]
> >   \startMPcode
> >
> >path p, q, r, b ;
> >p  := unitsquare xyscaled (4cm,4cm) ;
> >z[0] = (2cm,0cm) ;
> >z[1] = (2cm,4cm) ;
> >z[2] = (0cm,2cm) ;
> >q := llcorner p--z[0]--z[1]--z[2]--cycle ;
> >r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
> >b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
> >draw p ;
> >draw r withcolor red;
> >draw r numberstriped (.25,20,5) withcolor magenta ;
> >draw b numberstriped (.25,20,5) withcolor magenta ;
> >label.llft("D", p) ;
> >label.lrt("C", p) ;
> >label.ulft("A", p) ;
> >label.urt("B", p) ;
> >label.urt("P", lrcorner r) ;
> >label.lft("Q", llcorner r) ;
> >label.top("M", urcorner r) ;
> >
> >\stopMPcode
> > \stoptext
> you need to find a volunteer to make the pattern have the two corner  blobs
>
> \starttext
>
> \startMPcode
>  path p, q, r, b ;
>  path p ; p  := unitsquare xyscaled (4cm,4cm) ;
>  draw p ;
>  draw p
>  withpattern image (
>  draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
>  % how to get the corner dots
>  )
>  withpatternscale 1/16
>  withpen pencircle scaled 1mm
>  ;
> \stopMPcode
>
> \stoptext
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] About macro numberstriped ()

2022-09-27 Thread Fabrice Couvreur via ntg-context
Hello,
I notice a strange behavior of the macro numberstriped ( ).
Thanks.
Fabrice

\starttext
 \switchtobodyfont[9pt]
 \startMPcode

  path p, q, r, b ;
  p  := unitsquare xyscaled (4cm,4cm) ;
  z[0] = (2cm,0cm) ;
  z[1] = (2cm,4cm) ;
  z[2] = (0cm,2cm) ;
  q := llcorner p--z[0]--z[1]--z[2]--cycle ;
  r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
  b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
  draw p ;
  draw r withcolor red;
  draw r numberstriped (.25,20,5) withcolor magenta ;
  draw b numberstriped (.25,20,5) withcolor magenta ;
  label.llft("D", p) ;
  label.lrt("C", p) ;
  label.ulft("A", p) ;
  label.urt("B", p) ;
  label.urt("P", lrcorner r) ;
  label.lft("Q", llcorner r) ;
  label.top("M", urcorner r) ;

  \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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] metafun paralleled does not give a parallel path

2022-08-25 Thread Fabrice L via ntg-context
Hi,Le 24 août 2022 à 22:50, fv leung via ntg-context  a écrit :The following used to produce three parallel lines.Now it produces one straight line and two arcs.\starttext\startMPcode  z0 = origin;  z1 = 72dir(45);  dotlabel.bot("z0", z0);  draw z0--z1;  draw (z0--z1) paralleled -15 withcolor red;  draw (z0--z1) paralleled 15 withcolor blue;\stopMPcode  \stoptextYour code produce three perfect parallels lines here, see attached pdf. F.

parralel.pdf
Description: Adobe PDF document

___If your question is of interest to others as well, please add an entry to the Wiki!maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-contextwebpage  : https://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Size of all subscripts

2022-08-22 Thread Fabrice Couvreur via ntg-context
Hello
How to reduce the size of all subscripts in math mode ?
Thanks
Fabrice

\usemodule[tikz]
 \protected\def\vector#1{%
 \starttikzpicture[baseline=(arg.base),>=stealth]
 \node[inner xsep=0pt] (arg) {\m{#1}};
 \draw[thick,->,shorten >=-1pt] (arg.north west) -- (arg.north east);
\stoptikzpicture%
}
\starttext
 \m{z_{\vector{U}}}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Special numbering

2022-08-17 Thread Fabrice Couvreur via ntg-context
Hi  Aditya,
Thanks for your help, it works perfectly.
Fabrice

Le mer. 17 août 2022 à 17:48, Aditya Mahajan via ntg-context <
ntg-context@ntg.nl> a écrit :

> On Wed, 17 Aug 2022, Fabrice Couvreur via ntg-context wrote:
>
> > Hello,
> > how to get this
> > Définition 1.1.
> > Proposition 1.2.
> > Définition 1.3.
> > Proposition 1.4.
> >
> > Thanks
> > Fabrice
> >
> > \setupenumerations
> >   [before={\blank},
> >after={\blank},
> >alternative=serried,
> >distance=0.5em,
> >title=yes,
> >titleleft=,
> >titleright=,
> >titlestyle=normal,
> >prefix=yes,
> >prefixsegments=chapter,
> >way=bychapter,
> >headcommand=\groupedcommand{}{.},
> >numbercommand=\groupedcommand{}{},
> >titlecommand=\groupedcommand{(}{)},
> >width=broad]
> >
> > \defineenumeration
> >[definition]
> >[text=Définition,
> > number=yes,
> > style=italic]
> >
> > \defineenumeration
> >[proposition]
> >[text=Proposition,
> > number=yes,
>
> Add:
>
>   counter=definition,
>
> > style=italic]
>
>
> Now, definition and proposition share the same counter.
>
>
> Aditya___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Special numbering

2022-08-17 Thread Fabrice Couvreur via ntg-context
Hello,
how to get this
Définition 1.1.
Proposition 1.2.
Définition 1.3.
Proposition 1.4.

Thanks
Fabrice

\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   distance=0.5em,
   title=yes,
   titleleft=,
   titleright=,
   titlestyle=normal,
   prefix=yes,
   prefixsegments=chapter,
   way=bychapter,
   headcommand=\groupedcommand{}{.},
   numbercommand=\groupedcommand{}{},
   titlecommand=\groupedcommand{(}{)},
   width=broad]

\defineenumeration
   [definition]
   [text=Définition,
number=yes,
style=italic]

\defineenumeration
   [proposition]
   [text=Proposition,
number=yes,
style=italic]

\starttext
\startchapter
  [title={First chapter}]
  \dorecurse{2}{
\startdefinition

\stopdefinition
\startproposition

\stopproposition}
\stopchapter
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Numbercommand and title

2022-08-12 Thread Fabrice Couvreur via ntg-context
Hello,
How to make the period after the number be after the second parenthesis
when there is a title like this  Définition 1.1 (Title). ?
Thanks
Fabrice


\definestructureconversionset [structure] [n, R, n, n, n] [n]

\defineconversionset [digit] [] [n]

\setupheads[sectionconversionset=structure]

\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   distance=0.5em,
   title=yes,
   titleleft=,
   titleright=,
   titlestyle=normal,
   numbercommand=\groupedcommand{}{.},
   titlecommand=\groupedcommand{(}{)},
   width=broad,
   way=bychapter,
   prefix=yes,
   prefixsegments=chapter,
   prefixconversionset=digit,]

\defineenumeration
   [definition]
   [text=Définition,
number=yes,
style=italic]

\starttext
\startchapter
  [title={First Chapter}]
  \startdefinition
[title={My first définition}]
\input{ward}
  \stopdefinition
  \startdefinition
\input ward
  \stopdefinition
  \startdefinition
[title={My third définition}]
\input ward
  \stopdefinition
\stopchapter
\stopchapter
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Metafun : save memory content ?

2022-07-19 Thread Fabrice L via ntg-context
Dear Bruce, dear list, 

> Le 19 juill. 2022 à 07:42, Bruce Horrocks  a écrit :
> 
>> On 19 Jul 2022, at 04:28, Fabrice L via ntg-context  
>> wrote:
>> 
>> Complementary question : I saw that the « pos_a » « pos_b » of the example 
>> could not take numerical value, for example pos_1, pos_2.. How can I use 
>> metafun to write a macro to save the contents of hundreds of variable in 
>> this object, something like :
>> 
>> getparameters "MyData » [
>>  for i=1 upto 100 :
>>  pos_decimal(i) = ThePosition[i],
>>  endfor ;
>> ] ;
>> 
>> If this is possible, then this is wonderful and open news doors ! 
> 
> I've adapted this example from the metafun-p manual by adding some "write" 
> statements.

I have read the manuals, but not enough it seems ! I missed this part ! I 
completely miss the «write to » and « read from » instructions. Even a research 
on the web before posting did not return something interesting. I guess I did 
not used the good terms, because now, I find some ressources about these 
functions ! 
> 
> \starttext
> \startMPpage
> 
> numeric done[][], i, j, n ; n := 0 ;
> forever :
>   i := round(uniformdeviate(10)) ;
>   j := round(uniformdeviate(10)) ;
>   if unknown done[i][j] :
>   drawdot
>   (i*cm,j*cm)
>   withpen pencircle scaled 0.5cm
>   withcolor darkred;
>   n := n + 1 ;
>   done[i][j] := n ;
>   
>   write "done[" & tostring(i) & "][" & tostring(j) & "] := " & 
> tostring(n) & " ;" to "mp_test_file.txt" ;
> 
>   fi ;
>   exitif n = 10 ;
>   
> endfor ;
> 
> write EOF to "mp_test_file.txt" ;
> 
> \stopMPpage
> \stoptext
> 
> This results in the expected graphic but also a local file (in the same 
> directory as the source) called "mp_test_file.txt" that contains:
> 
> done[9][1] := 1 ;
> done[4][3] := 2 ;
> done[5][3] := 3 ;
> done[5][1] := 4 ;
> done[2][9] := 5 ;
> done[8][6] := 6 ;
> done[9][10] := 7 ;
> done[9][7] := 8 ;
> done[10][2] := 9 ;
> done[6][5] := 10 ;
> 
> I think, with a bit of judicious use of "write" statements to add some 
> ConTeXt / MP setup code, it would be possible to include the output from the 
> previous run as MP source of the next run.
> 
> Hope this helps, or at least provides some food for thought.

Totally, a lot of food  ! Here is my yesterday example with these functions : 

\starttext
\startMPpage
pair ThePosition[];
ThePosition[1] := (0,0) ;
ThePosition[2] := (10,10) ;
draw ThePosition[1] -- ThePosition[2] ;

% Save the position into a file "bruce.mp"
for i=1 upto 2:
  write "ThePosition[" & tostring(i) & "] := (" & 
tostring(xpart(ThePosition[i])) & ","& tostring(ypart(ThePosition[i])) &") ;" 
to "bruce.mp" ;
endfor;
write EOF to "bruce.mp" ;
\stopMPpage

% The external file would like like (comment added manually here):
% ThePosition[1] := (0,0) ;
% ThePosition[2] := (10,10) ;

% We modify the value of ThePosition[2] 
\startMPpage
ThePosition[2] := (10,0) ;
draw ThePosition[1] -- ThePosition[2] ;
\stopMPpage

% We now read the value of ThePosition[2] from the file 
\startMPpage
input "bruce.mp";
% Save the data from the external file 
draw ThePosition[1] -- ThePosition[2] ;

\stopMPpage

\stoptext

> 
> (Note you need to delete the mp_test_file.txt before re-running else it 
> fails.)

So this totally do the trick : once again, magic is happening ! 
Note that in my installation, I do not need to delete the external file. 
> 
> —
> Bruce Horrocks
> Hampshire, UK

Thanks a lot ! 
Fabrice. 
> 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Metafun : save memory content ?

2022-07-18 Thread Fabrice L via ntg-context

> Le 18 juill. 2022 à 12:31, Hans Hagen via ntg-context  a 
> écrit :
> 
> On 7/18/2022 3:20 PM, Fabrice L via ntg-context wrote:
>> Dear list,
>> I’m doing animations in MetaFun, by simply using \startMPpage (…) 
>> \stopMPpage for each frame of the animation. Here is an example: 
>> https://youtu.be/yhxUbVQx9Uo (please note you can watch it in HD by 
>> adjusting the setting in YouTube).
>> This works usually great, but when the number of objects to draw by page is 
>> large, the resulting pdf file could be huge, several gigabytes sometimes. 
>> Such huge files are difficult (sometimes impossible) to convert in jpeg 
>> files (I’m using Image magick for the conversion), necessary to do a mp4 
>> movie.
>> One solution is to do several pdf files, for example one by second; with 
>> this option, I can do 60 files of 30 pages, for an animation of 60 seconds 
>> (1800 frames for 1 minute). Everything is smoother this way, quicker to 
>> convert files. But in order to do so, I have to be able to describe each 
>> frame of the animation with the same set of instructions; so the position of 
>> an object at time t is described by an equation for example.
>> But this is not always possible. If the animation is based on a random 
>> process, the position of an object at time t depends on his position at time 
>> t-1. I can still use this preceeding strategy by simulating the past at the 
>> begging of each second, starting with a unique random seed. So for example 
>> if I work on second 9, I begin by calculating the past from frame 1 to frame 
>> 240 (8*30) and then simulate time 241, draw frame 241, simulate time 242, 
>> draw time 242, etc.. This could be complicated to do, but is feasible. The 
>> drawback is that more I advance in time, the more computations I have to do 
>> at the beginning of each file.
>> So to simplify things, one option would be to be save the state of some 
>> variables at some point in time, say t, in order to be able to access these 
>> informations at time t+1. So the strategy would be :
>> % File second1.pdf
>> for frame =1 to 30 :
>>  simulate position of objects ;
>>  draw the frame ;
>> endfor;
>> save the position of all objects ;
>> % File second2.pdf
>> Read (access) the position of all objects from second 1(after frame 30);
>> for frame =31 to 60 :
>>  simulate position of objects ;
>>  draw the frame ;
>> endfor;
>> save the position of all objects ;
>> Etc...
>> Does someone has an idea of how to do such a thing ? I can read text file in 
>> Context with no problem and integrate them in the animation process with 
>> \startMPinclusions (…) \stopMPinclusions, but I did not find a way to write 
>> information from MetaFun to a text file. Is Lua the solution ?
> there's always an idea ...

Great ! And thanks… 

Of course, it takes me some time to understand, and a little reading in the 
metafun xl manual,  but now I catch it ! 
> 
> \starttext
> \startMPpage
> runscript("metapost.setparameterset('test', table.load('mydata.lua') or { 
> })") ;
> path b ; b := getparameterpath "test" "test_c";
> draw fullcircle scaled 3cm ;
> draw b scaled .4;
> % show(b);
> getparameters "test" [
> test_a = 123,
> test_b = (456,789),
> test_c = (boundingbox currentpicture)
> ] ;
> runscript("table.save('mydata.lua',(metapost.getparameterset('test')))") ;
> \stopMPpage
> \stoptext
> 
> but maybe i need abetter one .. a proper save/restore in the tuc file or so, 
> but you can play with this first
> 
> Hans

If someones in the futur needs more explanation (like me!), here is my minimal 
working example derived from the one of Hans:
First page, we assign a value to the pair « ThePosition[2]  », write the value 
in a file (« TheMagicalFile.lua »), change the value in memory in the second 
page, and then read it from the external file in the third page. Of course, it 
works ! And this could run in separates process of course. 

% 
\starttext
\startMPpage
pair ThePosition[];
ThePosition[1] := (0,0) ;
ThePosition[2] := (10,10) ;
draw ThePosition[1] -- ThePosition[2] ;
% save the parameters in the object MyData
getparameters "MyData" [
pos_a = ThePosition[1],
pos_b = ThePosition[2]
] ;
% Save this object in a file 
runscript("table.save('TheMagicalFile.lua',(metapost.getparameterset('MyData')))")
 ;
\stopMPpage

% We modify the value of ThePosition[2] 
\startMPpage
ThePosition[2] := (10,0) ;
draw ThePosition[1] -- ThePosition[2] ;
\stopMPpage

% We now read the value of ThePosition[2] from the file 
\startMPpage
% Save the data from the exter

[NTG-context] Metafun : save memory content ?

2022-07-18 Thread Fabrice L via ntg-context
Dear list,

I’m doing animations in MetaFun, by simply using \startMPpage (…) \stopMPpage 
for each frame of the animation. Here is an example: 
https://youtu.be/yhxUbVQx9Uo (please note you can watch it in HD by adjusting 
the setting in YouTube).

This works usually great, but when the number of objects to draw by page is 
large, the resulting pdf file could be huge, several gigabytes sometimes. Such 
huge files are difficult (sometimes impossible) to convert in jpeg files (I’m 
using Image magick for the conversion), necessary to do a mp4 movie. 

One solution is to do several pdf files, for example one by second; with this 
option, I can do 60 files of 30 pages, for an animation of 60 seconds (1800 
frames for 1 minute). Everything is smoother this way, quicker to convert 
files. But in order to do so, I have to be able to describe each frame of the 
animation with the same set of instructions; so the position of an object at 
time t is described by an equation for example.

But this is not always possible. If the animation is based on a random process, 
the position of an object at time t depends on his position at time t-1. I can 
still use this preceeding strategy by simulating the past at the begging of 
each second, starting with a unique random seed. So for example if I work on 
second 9, I begin by calculating the past from frame 1 to frame 240 (8*30) and 
then simulate time 241, draw frame 241, simulate time 242, draw time 242, etc.. 
This could be complicated to do, but is feasible. The drawback is that more I 
advance in time, the more computations I have to do at the beginning of each 
file. 

So to simplify things, one option would be to be save the state of some 
variables at some point in time, say t, in order to be able to access these 
informations at time t+1. So the strategy would be :

% File second1.pdf
for frame =1 to 30 :
simulate position of objects ;
draw the frame ;
endfor;
save the position of all objects ;

% File second2.pdf
Read (access) the position of all objects from second 1(after frame 30);
for frame =31 to 60 :
simulate position of objects ;
draw the frame ;
endfor;
save the position of all objects ;

Etc... 

Does someone has an idea of how to do such a thing ? I can read text file in 
Context with no problem and integrate them in the animation process with 
\startMPinclusions (…) \stopMPinclusions, but I did not find a way to write 
information from MetaFun to a text file. Is Lua the solution ? 

Thanks for any help !
Fabrice.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] MetaPost label font size

2022-07-06 Thread Fabrice L via ntg-context


> Le 5 juill. 2022 à 19:00, Henning Hraban Ramm via ntg-context 
>  a écrit :
> 
> How can I change the font size of labels within one picture?
> 
> Hraban
> 
> \startMPpage
> defaultfont := "\truefontname{Sans}";
> defaultfontsize := \the\bodyfontsize;
> 
> label.top(defaultfontsize, (0,0));
> 
> defaultfontsize := 4bp;
> 
> label.top(defaultfontsize, (50,0));
> % shows that the variable changed,
> % but font size is the same
> 
> \stopMPpage

Here are slightly different syntax that could be useful perhaps ? In the second 
one, the scaled parameter can be replaced easily with a variable, so you can 
decide and change the size of the label during the course of a picture.

\starttext

\startMPpage
defaultfont := "\truefontname{Sans}";
defaultfontsize := \the\bodyfontsize;

defaultscale := 0.5;
label.top("small label", (-10,0));

defaultscale := 1.0;
label.top("normal label", (50,5));
label.top("another normal label", (50,-5));

defaultscale := 2.0;
label.top("Huge label", (10,-25));

\stopMPpage

\startMPpage

 draw textext.top("small label") scaled 0.5 
shifted (-10,0) ;
 draw textext.top("normal label") scaled 1 
shifted (50,5) ;
 draw textext.top("second normal label") scaled 1 
shifted (50,-5) ;
 draw textext.top("Huge label") scaled 2 
shifted (10,-25) ;

\stopMPpage

\stoptext

Fabrice.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Importing pdf into MPpage

2022-06-11 Thread Fabrice L via ntg-context


> Le 11 juin 2022 à 11:30, Stefan Nedeljkovic  a écrit :
> 
> That's it, but how do I center it on (0, 0)?

Sorry, I misunderstood the question. Here is a solution (perhaps there is a 
simpler solution !):

\startMPpage
picture TheImage ; 
TheImage := image(
draw externalfigure "cow.pdf";
);
TheImage := TheImage shifted -center(TheImage);
draw TheImage ;
draw (0,0) withpen pencircle scaled .2in withcolor magenta ;
\stopMPpage

Fabrice.

> 
> On Sat, Jun 11, 2022 at 4:46 PM Fabrice L  <mailto:fabrice.al...@gmail.com>> wrote:
> Dear Stephan,
> 
>> Le 11 juin 2022 à 08:57, Stefan Nedeljkovic via ntg-context 
>> mailto:ntg-context@ntg.nl>> a écrit :
>> 
>> Dear list,
>> 
>> I would like to place a pdf file at (0, 0), centered at original size on a 
>> MPpage, and draw over it. But using the input command doesn't work. How 
>> should I approach this?
> 
> Like this ?
> 
> \startMPpage
>draw externalfigure "thefile.pdf";
>(… other commands…) 
> \stopMPpage
> 
> 
>> 
>> Sincerely,
>> Stefan
> 
> Fabrice.
> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>> http://context.aanhet.net <http://context.aanhet.net/>
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>> <https://bitbucket.org/phg/context-mirror/commits/>
>> wiki : http://contextgarden.net <http://contextgarden.net/>
>> ___
> 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Importing pdf into MPpage

2022-06-11 Thread Fabrice L via ntg-context
Dear Stephan,

> Le 11 juin 2022 à 08:57, Stefan Nedeljkovic via ntg-context 
>  a écrit :
> 
> Dear list,
> 
> I would like to place a pdf file at (0, 0), centered at original size on a 
> MPpage, and draw over it. But using the input command doesn't work. How 
> should I approach this?

Like this ?

\startMPpage
   draw externalfigure "thefile.pdf";
   (… other commands…) 
\stopMPpage


> 
> Sincerely,
> Stefan

Fabrice.

> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problem with a defined colour in MetaFun

2022-04-28 Thread Fabrice L via ntg-context
Sorry, I was a little too enthusiastic, here here is the code :

> Le 28 avr. 2022 à 08:41, Fabrice L  a écrit :
> 
> Hi Keith,
> 
>> Le 28 avr. 2022 à 06:05, Keith McKay via ntg-context > <mailto:ntg-context@ntg.nl>> a écrit :
>> 
>> Hi,
>> 
>> In the MWE below I define an rgb colour, myColor1, using random numbers for 
>> the r, g and b components. I then use it to fill a unitsquare the size of 
>> the page, which works as expected. In the loop that follows I then use the 
>> defined colour, myColor1, along with white and the variable r to create 
>> shades of myColor1 as in the MWE below. However, myColor1 is not recognised 
>> in the loop and seems to be replaced by black, although if I use a 
>> predefined colour, in this case BurntSienna from the crayola collection, it 
>> works as expected.  I have tried a number of ways to get this to work as 
>> shown in the code but without success. I would be grateful for any 
>> suggestions.
>> 
>> Best Wishes
>> 
>> Keith McKay
>> 
>> MWE%
>> \setuppapersize[A4,portrait]
>> \usecolors[crayola]
>> \starttext
>> \dorecurse{10}{
>> \startMPpage
>> StartPage;
>> \definecolor[name="myColor1", r =  uniformdeviate(1), g = uniformdeviate(1), 
>> b = uniformdeviate(1) ] ;
>> fill unitsquare xscaled PaperWidth yscaled PaperHeight withcolor  "myColor1";
>> for i =2 step 2 until 10:
>> r := i/10;
>> fill unitsquare xscaled 5cm yscaled .5cm shifted (1cm,i*cm) 
>> withcolor(r[\MPcolor{BurntSienna},white]);
>> fill unitsquare xscaled 5cm yscaled .5cm shifted (7cm,i*cm) 
>> withcolor(r[\MPcolor{myColor1}, white]);
>> fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
>> withcolor(r[\MPcolor{"myColor1"}, white]);
>> %fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
>> withcolor(r[myColor1 ,  white]); This line causes an error.
>> endfor;
>> StopPage;
>> \stopMPpage
>> }
>> 
>> \stoptext
>> %%%end MWE%%%
>> 
> 
> Here is a solution, with works here, defining in another way the color «  
> myColor »:
> 
> \setuppapersize[A4,portrait]
> \usecolors[crayola]
> \starttext
> \dorecurse{2}{
> \startMPpage
> StartPage;
> color myColor ;
> myColor := (uniformdeviate(1),uniformdeviate(1),uniformdeviate(1));
> fill unitsquare xscaled PaperWidth yscaled PaperHeight withcolor myColor;
> for i =2 step 2 until 10:
> r := i/10;
> fill unitsquare xscaled 5cm yscaled .5cm shifted (1cm,i*cm) 
> withcolor(r[\MPcolor{BurntSienna},white]);
> fill unitsquare xscaled 5cm yscaled .5cm shifted (7cm,i*cm) 
> withcolor(r[\MPcolor{myColor1}, white]);
> fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
> withcolor(r[\MPcolor{"myColor1"}, white]);
> %fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
> withcolor(r[myColor1 ,  white]); This line causes an error.
> endfor;
> StopPage;
> \stopMPpage
> }
> 
> \stoptext

I forgot to remove « myColor1 » from the others parts of the code. 
\setuppapersize[A4,portrait]
\usecolors[crayola]
\starttext
\dorecurse{10}{
\startMPpage
StartPage;
color myColor ;
myColor := (uniformdeviate(1),uniformdeviate(1),uniformdeviate(1));
fill unitsquare xscaled PaperWidth yscaled PaperHeight withcolor myColor;
for i =2 step 2 until 10:
r := i/10;
fill unitsquare xscaled 5cm yscaled .5cm shifted (1cm,i*cm) 
withcolor(r[\MPcolor{BurntSienna},white]);
fill unitsquare xscaled 5cm yscaled .5cm shifted (7cm,i*cm) 
withcolor(r[myColor, white]);
fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
withcolor(r[myColor, white]);
%fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
withcolor(r[myColor1 ,  white]); This line causes an error.
endfor;
StopPage;
\stopMPpage
}

\stoptext


> 
> Fabrice.
>> 
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>> http://context.aanhet.net <http://context.aanhet.net/>
>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>> <https://bitbucket.org/phg/context-mirror/commits/>
>> wiki : http://contextgarden.net <http://contextgarden.net/>
>> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problem with a defined colour in MetaFun

2022-04-28 Thread Fabrice L via ntg-context
Hi Keith,

> Le 28 avr. 2022 à 06:05, Keith McKay via ntg-context  a 
> écrit :
> 
> Hi,
> 
> In the MWE below I define an rgb colour, myColor1, using random numbers for 
> the r, g and b components. I then use it to fill a unitsquare the size of the 
> page, which works as expected. In the loop that follows I then use the 
> defined colour, myColor1, along with white and the variable r to create 
> shades of myColor1 as in the MWE below. However, myColor1 is not recognised 
> in the loop and seems to be replaced by black, although if I use a predefined 
> colour, in this case BurntSienna from the crayola collection, it works as 
> expected.  I have tried a number of ways to get this to work as shown in the 
> code but without success. I would be grateful for any suggestions.
> 
> Best Wishes
> 
> Keith McKay
> 
> MWE%
> \setuppapersize[A4,portrait]
> \usecolors[crayola]
> \starttext
> \dorecurse{10}{
> \startMPpage
> StartPage;
> \definecolor[name="myColor1", r =  uniformdeviate(1), g = uniformdeviate(1), 
> b = uniformdeviate(1) ] ;
> fill unitsquare xscaled PaperWidth yscaled PaperHeight withcolor  "myColor1";
> for i =2 step 2 until 10:
> r := i/10;
> fill unitsquare xscaled 5cm yscaled .5cm shifted (1cm,i*cm) 
> withcolor(r[\MPcolor{BurntSienna},white]);
> fill unitsquare xscaled 5cm yscaled .5cm shifted (7cm,i*cm) 
> withcolor(r[\MPcolor{myColor1}, white]);
> fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
> withcolor(r[\MPcolor{"myColor1"}, white]);
> %fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
> withcolor(r[myColor1 ,  white]); This line causes an error.
> endfor;
> StopPage;
> \stopMPpage
> }
> 
> \stoptext
> %%%end MWE%%%
> 

Here is a solution, with works here, defining in another way the color «  
myColor »:

\setuppapersize[A4,portrait]
\usecolors[crayola]
\starttext
\dorecurse{2}{
\startMPpage
StartPage;
color myColor ;
myColor := (uniformdeviate(1),uniformdeviate(1),uniformdeviate(1));
fill unitsquare xscaled PaperWidth yscaled PaperHeight withcolor myColor;
for i =2 step 2 until 10:
r := i/10;
fill unitsquare xscaled 5cm yscaled .5cm shifted (1cm,i*cm) 
withcolor(r[\MPcolor{BurntSienna},white]);
fill unitsquare xscaled 5cm yscaled .5cm shifted (7cm,i*cm) 
withcolor(r[\MPcolor{myColor1}, white]);
fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
withcolor(r[\MPcolor{"myColor1"}, white]);
%fill unitsquare xscaled 5cm yscaled .5cm shifted (13cm,i*cm) 
withcolor(r[myColor1 ,  white]); This line causes an error.
endfor;
StopPage;
\stopMPpage
}

\stoptext

Fabrice.
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <http://contextgarden.net/>
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Font too small with a macro

2022-04-23 Thread Fabrice Couvreur via ntg-context
Hi,
I didn't know that \exp was already defined.
Thanks
Fabrice

Le sam. 23 avr. 2022 à 15:28, Mikael Sundqvist via ntg-context <
ntg-context@ntg.nl> a écrit :

> On Sat, Apr 23, 2022 at 12:11 PM Fabrice Couvreur via ntg-context
>  wrote:
> >
> > Hello,
> > If I compile with context the expected result is correct but with lmtx
> the font under the square root is smaller.
> > Thank you
> > Fabrice
> >
> > \protected\def\exp{\text{\normal exp}}
> >
> > \starttext
> > \startformula
> >\sqrt{\exp(x)}=\exp\left(\frac{x}{2}\right).
> > \stopformula
> > \stoptext
>
> Hi,
>
> without your redefinition of \exp it looks fine (exp is already
> defined). Does that solve your problem, or are you doing something
> else, and this exp was just an example?
>
> Best, Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Font too small with a macro

2022-04-23 Thread Fabrice Couvreur via ntg-context
Hello,
If I compile with context the expected result is correct but with lmtx the
font under the square root is smaller.
Thank you
Fabrice

\protected\def\exp{\text{\normal exp}}

\starttext
\startformula
   \sqrt{\exp(x)}=\exp\left(\frac{x}{2}\right).
\stopformula
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] the resolver databases are not present or outdated

2022-03-05 Thread Fabrice Couvreur via ntg-context
Hello,
Some files no longer compile, I tried updating lmtx but I get this.
Thank you
Fabrice

viserion@archlinux LMTX]$ install install.sh
install: opérande de fichier cible manquant après 'install.sh'
Saisissez « install --help » pour plus d'informations.
[viserion@archlinux LMTX]$ sh install.sh
mtxrun  | forcing cache reload
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given
path '/home/viserion/texmf/web2c' from specification 'home:texmf/web2c'
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given
path '/home/viserion/texmf-local/web2c' from specification
'selfautoparent:/texmf-local/web2c'
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given
path '/home/viserion/texmf-context/web2c' from specification
'selfautoparent:/texmf-context/web2c'
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given
path '/home/viserion/texmf-dist/web2c' from specification
'selfautoparent:/texmf-dist/web2c'
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given
path '/home/viserion/texmf/web2c' from specification
'selfautoparent:/texmf/web2c'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on
given path '/home/viserion/texmf/web2c' from specification
'home:texmf/web2c'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on
given path '/home/viserion/texmf-local/web2c' from specification
'selfautoparent:/texmf-local/web2c'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on
given path '/home/viserion/texmf-context/web2c' from specification
'selfautoparent:/texmf-context/web2c'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on
given path '/home/viserion/texmf-dist/web2c' from specification
'selfautoparent:/texmf-dist/web2c'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on
given path '/home/viserion/texmf/web2c' from specification
'selfautoparent:/texmf/web2c'
resolvers   | resolving |
resolvers   | resolving | warning: no lua configuration files found
resolvers   | resolving | no texmf paths are defined (using TEXMF)
resolvers   | resolving |
mtxrun  | the resolver databases are not present or outdated
mtx-install | provide valid server and instance
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] new upload

2022-01-15 Thread Fabrice Couvreur via ntg-context
Hi Hans
I just updated lmtx and this macro does not work although it did before. On
the other hand, no problem with context.
Thanks.
Fabrice

 \protected\def\e#1{\math{{\rm e}^{#1}}\autoinsertnextspace}

\starttext
\startformula
\e{a+b}
\stopformula
\stoptext


Le sam. 15 janv. 2022 à 16:14, Hans Hagen via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 1/15/2022 3:52 PM, Alexandre Christe via ntg-context wrote:
> > Just came across a weird behavior with the latest upload.
> >
> > The following doesn't print as it should
> > \startformula 4^{2x} - 4^x - 25 = 0 \stopformula
> >
> > I don't think it's normal (I see the spacing to make room for anything
> > that comes after the first character in the exposant, but it is not
> > printed).
> i'll fix it ...
>
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Conditional text appearing in a fixed vertical space

2022-01-11 Thread Fabrice L via ntg-context

> Le 11 janv. 2022 à 17:56, Gavin via ntg-context  a écrit :
> 
> Thanks Hans! This is great. I made a slight change to add an additional 
> feature. By moving the “mysolution” definition out of \startmode[solution], I 
> can now use mysolution in either mode. I’d use this if I want to give my 
> solution to one of the problems, as an example, on the handout.
> 
> -Gavin


I have similar problem for my courses. The solution I use, different than the 
one offered, is to write in a « special » color the text I want to hide from 
the students. This permits me to have hidden texts in figures for exemple. 
Also, I do not calculate space required, this is automated !  Here is MWE :

\enablemode[solution]

\doifmode{solution}{
 \definecolor[solcolor][magenta]
} 
\doifnotmode{solution}{
 \definecolor[solcolor][white]
} 
\definedescription[solution]
[color=solcolor]

\starttext

How many roads? \startcolor[solcolor] Professor note.\stopcolor
 \startsolution
   42 roads.
 \stopsolution

How much wood?
 \startsolution
   Alotta wood!
 \stopsolution

No more questions.

\stoptext

So the color used when solutions are hidden are white on white, we can not see 
the text;  but of course, if you change the background, you see the hidden 
text. So there is another step to the process (I usually do this only once a 
term); open the file in Acrobat, and find the option to delete hidden text. The 
text for which the color is the same as the background is really deleted. You 
can try to select the text in any pdf view/editor, the text is gone !  

Fabrice.


> 
> 
> % \enablemode[solution]
> 
> % Define "mysolution” for use independent of solution mode.
> \definenarrower[mysolution]
>  [before=\blank\it,
>   after=\blank]
> 
> % If in solution mode, define "solution" to use "mysolution"
> \startmode[solution]
>   \tolerant\protected\def\startsolution[#1]%
> {\startmysolution}
>   \protected\def\stopsolution
> {\stopmysolution}
> \stopmode
> 
> % If NOT in solution mode, define "solution" to produce a blank space
> \startnotmode[solution]
>   \tolerant\protected\def\startsolution[#1]%
> {\doifelsenothing{#1}{\blank[1in]}{\blank[#1]}
>  \gobbleuntil\stopsolution}
>   \protected\def\stopsolution
> {}
> \stopnotmode
> 
> 
> \starttext
> 
> How many roads?
>  \startsolution
>42 roads.
>  \stopsolution
> 
> How much wood?
>  \startsolution[1.5in]
>Alotta wood!
>  \stopsolution
> 
> No more questions.
> 
> \stoptext
> 
> 
>> On Jan 11, 2022, at 1:13 PM, Hans Hagen  wrote:
>> 
>> On 1/11/2022 8:50 PM, Gavin via ntg-context wrote:
>>> Hello List,
>>> I am making problem sets for a physics class. Solutions use the style 
>>> defined in the example below, and only appear if the “solution” mode is 
>>> enabled. I am struggling to get a vertical space for the solution which is 
>>> the same whether or not the solution is printed. Different problems require 
>>> different amounts of space, so this should be an argument or key-value.
>>> In the example below, the first solution has the desired behavior. The 
>>> second solution has the syntax I’d like, but it doesn’t make the space 
>>> without a solution.
>>> Any ideas would be welcome! I am still pretty new to ConTeXt, so I struggle 
>>> mixing things like the plain tex \vbox and ConTeXt \start…\stop concepts.
>>> Thanks,
>>> Gavin
>>> \definemode[solution][yes] % yes to enable solutions, no to disable
>>> \definebuffer  [solution] % Captures solution in a buffer that isn't used
>>> \startmode[solution] % If in solution mode, redefine 
>>> \startsolution...\stopsolution
>>> \definedelimitedtext[solution][ % Solution italic and indented
>>>  spacebefore=medium,
>>>  spaceafter=medium,
>>>  style=\rm\it,
>>>  leftmargin=standard, % Indents block on the left
>>>  rightmargin=yes, % Indents block on the right
>>>  indentnext=no,
>>>  before=\vbox to 1in\bgroup,
>>>  after=\egroup,
>>> ]
>>> \stopmode
>>> \starttext
>>> How many roads? (The 1-inch space below appears whether or not it contains 
>>> a solution.)
>>> \vbox to 1in{%
>>>  \startsolution
>>>42 roads.
>>>  \stopsolution
>>> }
>>> How much wood? (I would like to define solution so this to behaves like the 
>>> previous question.)
>>> \startsolution[1in]
>>>  Alotta wood!
>>> \stopsolution
>>> No more questions.
>>> \stoptext
>> a mix between big and low level
>> 
>> % \

Re: [NTG-context] Documentation about CTX installation on MacOS X

2022-01-02 Thread Fabrice L via ntg-context
Hi,

> Le 2 janv. 2022 à 21:26, Jean-Pierre Delange via ntg-context 
>  a écrit :
> 
> First of all : Happy New Year everybody (despite some difficulties due to 
> public policies against the epidemic !
> 
> Now my question : I want to try CTX (ConTeXt  ver: 2021.12.30) on MacOS X 
> (currently 10.13  High Sierra), while I was formerly working with old 
> versions on Linux and Windows based systems. Among other difficulties (like 
> how to export OSFONDIR permanently), I don’t find the clever command . 
> setuptex, which made possible a bunch of other commands (like context —make 
> and context —generate). Even if a lot of things on MacOS X seem to share with 
> Unix-like systems, I am looking for detailed documentation concerning a well 
> done installation of CTX on MacOS X. 
> Thank you very much for your help !
> JP  

On MacOS, I usually follow with success this page of the wiki :
https://wiki.contextgarden.net/Installing_ConTeXt_LMTX_on_MacOS

Regarding modules, on MacOS, the script described here (again on the wiki) 
works well for me:
https://wiki.contextgarden.net/Modules#ConTeXt_LMTX

Finally, I use TexPad as my context/metafun editor, and if you need some help 
to set it up, I can describe my setup in details. 
Fabrice.



> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Strange behavior with \startbodymatter ... \stopbodymatter

2021-12-28 Thread Fabrice Couvreur via ntg-context
Hi,
In my file cours_premiere.tex if I indicate

 \startbodymatter
\component[probabilites.tex]
 \stopbodymatter

I get the following error message

tex error   > tex error on line 49 in file ./cours_premiere.tex:
Undefined control sequence \pgfmath@settrigformat


\pgfmath@settrigformat
\pgfmath@settrigformat \pgfmath@settrigformat

\stopbodymatter

39[criterium=all,
40interaction=all,
41 alternative=c]
42
43   \stoptitle
44
45 \stopfrontmatter
46
47 \startbodymatter
48 \component[probabilites.tex]
49 >>  \stopbodymatter
50
51
52 \stopproduct
The control sequence at the end of the top line of your error message was
never
\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context | fatal error: return code: 1

TeX Output exited abnormally with code 1 at Tue Dec 28 15:31:31


On the other hand, if I indicate

\component[probabilites.tex]

 the file compiles without error.
Thanks
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] MP: problem connecting paths.

2021-12-20 Thread Fabrice L via ntg-context
Dear Mikael,

> Le 20 déc. 2021 à 12:14, Mikael Sundqvist  a écrit :
> 
> Hi,
> 
> I will try again. What if you do
> 
> newcircleA := newcircleA scrutinized 2;
> 
> after your definition of newcircleA?

Once I understood I had to compile with LMTX, this works like magic ! I spent 
hours to find a solution… but here is a solution ! 
Thanks a lot ! 
> 
> /Mikael

Fabrice.
> 
> 
> On Mon, Dec 20, 2021 at 3:45 PM Fabrice L  wrote:
>> 
>> Thanks Mikael,
>> 
>> Le 20 déc. 2021 à 02:21, Mikael Sundqvist via ntg-context 
>>  a écrit :
>> 
>> Hi,
>> 
>> would it be an option for you to do
>> 
>> newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;
>> 
>> In that case you avoid extra points.
>> 
>> 
>> You are right, in this simple case, your solution avoid the problem, and is 
>> applicable in some of my cases (I have to rethink the code). Thanks for the 
>> proposition !
>> But in others cases this is not possible (I think). Imagine I wish to do a « 
>> partial moon » from the two circles in my minimal example (see bottom right 
>> of the attached pdf):
>> 
>> 
>> newcircleA := circleA cutbefore P1 cutafter P2 .. reverse(circleB cutbefore 
>> P1 cutafter P2)  .. cycle;
>> 
>> I need 10 points to define the shape, but as my connections are duplicated, 
>> I have 12 points.
>> 
>> The solution (I thought) would be to use the « & » operator :
>> newcircleA := circleA cutbefore P1 cutafter P2 & reverse(circleB cutbefore 
>> P1 cutafter P2) & cycle ;
>> 
>> But this does not work (same reason as before: "! Paths don't touch; `&' 
>> will be changed to `..'.").
>> 
>> The compete minimal code (if somebody wants to plus with it) is here :
>> 
>> % ———
>> \startMPpage
>> path circleA , circleB ;
>> pair P[];
>> defaultscale := 0.4 ;
>> 
>> circleA := fullcircle scaled 1in randomized 3 ;
>> circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;
>> 
>> draw circleA withcolor blue ;
>> draw circleB withcolor red ;
>> 
>> P[1] := circleA intersectionpoint circleB ;
>> dotlabel.lft("$P_1$",P[1]) ;
>> dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;
>> P[2] := reverse(circleA) intersectionpoint circleB ;
>> dotlabel.rt("$P_2$",P[2]) ;
>> dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;
>> 
>> path newcircleA , newcircleB ;
>> % newcircleA := (circleA cutbefore P1 cutafter P2 ) & (P2 -- P1) & cycle  ;
>> % previous line gives an error :
>> % "! Paths don't touch; `&' will be changed to `..'."
>> newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
>> newcircleA := newcircleA xshifted 2in ;
>> draw newcircleA  withcolor darkgreen ;
>> 
>> newcircleB := (circleB cutafter P1)  -- (P1 -- P2) -- (circleB cutbefore P2 
>> ) & cycle ;
>> newcircleB := newcircleB xshifted 2in ;
>> draw newcircleB withcolor black ;
>> drawpoints newcircleA ; drawpointlabels newcircleA ;
>> 
>> % Mikael solution
>> newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;
>> newcircleA := newcircleA yshifted -1.5in ;
>> draw newcircleA  withcolor darkgreen ;
>> drawpoints newcircleA ; drawpointlabels newcircleA ;
>> 
>> % partial moon
>> newcircleA := circleA cutbefore P1 cutafter P2
>> .. reverse(circleB cutbefore P1 cutafter P2) .. cycle;
>> % & (reverse(circleB) cutbefore P2 cutafter P1) & cycle;
>> newcircleA := newcircleA shifted(2in,-1.5in) ;
>> draw newcircleA  withcolor magenta ;
>> drawpoints newcircleA ; drawpointlabels newcircleA ;
>> 
>> \stopMPpage
>> % ———
>> 
>> Thanks for any help !
>> Fabrice.
>> 
>> 
>> /Mikael
>> 
>> On Mon, Dec 20, 2021 at 5:30 AM Fabrice L via ntg-context
>>  wrote:
>> 
>> 
>> Dear list,
>> 
>> I have a problem connecting path with the operator « & » (page 16 Metafun 
>> manual). The problem is illustrated by the code (and the joined PDF) which 
>> follows.
>> 
>> I draw random cycled  forms (left part of the figure) and when they 
>> interact, they are modified to « fit together » (right part of the figure) . 
>> When building these new forms, I connect paths (usually two or three 
>> depending on position 0 of the path); the last point a path is the same as 
>> the first point of the next path ; for exemple, to modify the blue circle, 
>

Re: [NTG-context] MP: problem connecting paths.

2021-12-20 Thread Fabrice L via ntg-context
Thanks Mikael,Le 20 déc. 2021 à 02:21, Mikael Sundqvist via ntg-context <ntg-context@ntg.nl> a écrit :Hi,would it be an option for you to donewcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;In that case you avoid extra points.You are right, in this simple case, your solution avoid the problem, and is applicable in some of my cases (I have to rethink the code). Thanks for the proposition ! But in others cases this is not possible (I think). Imagine I wish to do a « partial moon » from the two circles in my minimal example (see bottom right of the attached pdf): 

test.pdf
Description: Adobe PDF document
newcircleA := circleA cutbefore P1 cutafter P2 .. reverse(circleB cutbefore P1 cutafter P2)  .. cycle; I need 10 points to define the shape, but as my connections are duplicated, I have 12 points. The solution (I thought) would be to use the « & » operator :newcircleA := circleA cutbefore P1 cutafter P2 & reverse(circleB cutbefore P1 cutafter P2) & cycle ; But this does not work (same reason as before: "! Paths don't touch; `&' will be changed to `..'."). The compete minimal code (if somebody wants to plus with it) is here :% ———\startMPpagepath circleA , circleB ;pair P[];defaultscale := 0.4 ;circleA := fullcircle scaled 1in randomized 3 ;circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;draw circleA withcolor blue ;draw circleB withcolor red ;P[1] := circleA intersectionpoint circleB ;dotlabel.lft("$P_1$",P[1]) ;dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;P[2] := reverse(circleA) intersectionpoint circleB ;dotlabel.rt("$P_2$",P[2]) ;dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;path newcircleA , newcircleB ;% newcircleA := (circleA cutbefore P1 cutafter P2 ) & (P2 -- P1) & cycle  ;% previous line gives an error :% "! Paths don't touch; `&' will be changed to `..'."newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;newcircleA := newcircleA xshifted 2in ;draw newcircleA  withcolor darkgreen ;newcircleB := (circleB cutafter P1)  -- (P1 -- P2) -- (circleB cutbefore P2 ) & cycle ; newcircleB := newcircleB xshifted 2in ;draw newcircleB withcolor black ;drawpoints newcircleA ; drawpointlabels newcircleA ;% Mikael solution newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;newcircleA := newcircleA yshifted -1.5in ;draw newcircleA  withcolor darkgreen ;drawpoints newcircleA ; drawpointlabels newcircleA ;% partial moon newcircleA := circleA cutbefore P1 cutafter P2 	.. reverse(circleB cutbefore P1 cutafter P2) .. cycle; %	& (reverse(circleB) cutbefore P2 cutafter P1) & cycle; newcircleA := newcircleA shifted(2in,-1.5in) ;draw newcircleA  withcolor magenta ;drawpoints newcircleA ; drawpointlabels newcircleA ;\stopMPpage% ———Thanks for any help ! Fabrice./MikaelOn Mon, Dec 20, 2021 at 5:30 AM Fabrice L via ntg-context<ntg-context@ntg.nl> wrote:Dear list,I have a problem connecting path with the operator « & » (page 16 Metafun manual). The problem is illustrated by the code (and the joined PDF) which follows.I draw random cycled  forms (left part of the figure) and when they interact, they are modified to « fit together » (right part of the figure) . When building these new forms, I connect paths (usually two or three depending on position 0 of the path); the last point a path is the same as the first point of the next path ; for exemple, to modify the blue circle, named « circleA », I take the circle A from P1 to P2, then a segment from P2 to P1 and cycle to have a closed path. So I should be able to do :newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;The « & » operator is supposed to work (if I understand correctly) in this case, but I have this error message :"! Paths don't touch; `&' will be changed to `..’."Which I do not understand since the paths « touch ». There was a similar question last year, without a clear answer («METAPOST subpath rounding issue »https://www.mail-archive.com/ntg-context@ntg.nl/msg94294.html).A solution is to ignore the repeating points :newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;but this new shape has 9 points instead of 7. The problem is that I do these operations a number of times, and the length of a path (in the number of points) is increasing and cause trouble when I look for intersections with others shapes.Here is the MWE:\startMPpagepath circleA , circleB ;pair P[];circleA := fullcircle scaled 1in randomized 3 ;circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;draw circleA withcolor blue ;draw circleB withcolor red ;P[1] := circleA intersectionpoint circleB ;dotlabel.lft("$P_1$",P[1]) ;dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;P[2] := reverse(circleA) intersectionpoint circleB ;dotlabel.rt("$P_2$",P[2]) ;dotlabel.rt(

[NTG-context] MP: problem connecting paths.

2021-12-19 Thread Fabrice L via ntg-context
Dear list,

I have a problem connecting path with the operator « & » (page 16 Metafun 
manual). The problem is illustrated by the code (and the joined PDF) which 
follows. 

I draw random cycled  forms (left part of the figure) and when they interact, 
they are modified to « fit together » (right part of the figure) . When 
building these new forms, I connect paths (usually two or three depending on 
position 0 of the path); the last point a path is the same as the first point 
of the next path ; for exemple, to modify the blue circle, named « circleA », I 
take the circle A from P1 to P2, then a segment from P2 to P1 and cycle to have 
a closed path. So I should be able to do :

newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;

The « & » operator is supposed to work (if I understand correctly) in this 
case, but I have this error message :

"! Paths don't touch; `&' will be changed to `..’."

Which I do not understand since the paths « touch ». There was a similar 
question last year, without a clear answer (« 
METAPOST subpath rounding issue 
»https://www.mail-archive.com/ntg-context@ntg.nl/msg94294.html). 

A solution is to ignore the repeating points :
newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
but this new shape has 9 points instead of 7. The problem is that I do these 
operations a number of times, and the length of a path (in the number of 
points) is increasing and cause trouble when I look for intersections with 
others shapes.

Here is the MWE:

\startMPpage
path circleA , circleB ;
pair P[];

circleA := fullcircle scaled 1in randomized 3 ;
circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;

draw circleA withcolor blue ;
draw circleB withcolor red ;

P[1] := circleA intersectionpoint circleB ;
dotlabel.lft("$P_1$",P[1]) ;
dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;
P[2] := reverse(circleA) intersectionpoint circleB ;
dotlabel.rt("$P_2$",P[2]) ;
dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;

path newcircleA , newcircleB ;
% newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;
% previous line gives an error :
% "! Paths don't touch; `&' will be changed to `..'."
newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
newcircleA := newcircleA xshifted 2in ;
draw newcircleA  withcolor darkgreen ;

newcircleB := (circleB cutafter P1)  -- (P1 -- P2) -- (circleB cutbefore P2 ) & 
cycle ; 
newcircleB := newcircleB xshifted 2in ;
draw newcircleB withcolor black ;
drawpoints newcircleA ; drawpointlabels newcircleA ;

\stopMPpage



test.pdf
Description: Adobe PDF document



I would appreciate any help ! Thanks ! 
Fabrice. 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Status of Asymptote

2021-12-06 Thread Fabrice L via ntg-context
Dear Gavin,

> Le 6 déc. 2021 à 10:11, Gavin via ntg-context  a écrit :
> 
> Hi Alex,
> 
> I don’t know the status of Asymptote. I am using TikZ and pgfplots for 3D, 
> with satisfactory results (example below). However, it is slow, so use the 
> buffer mechanism to prevent redrawing with every run.
> 
> TIkZ/pgfplots is the best short term solution for diagrams I need right now. 
> I am concerned that TikZ will eventually not work with ConTeXt, so for a long 
> term solution I am trying to make diagrams with Metapost, using Lua to do the 
> heavy computational work. This is not easy, but the diagrams are super fast, 
> and I think they will always work.

I would be very interested to see an example of a Metafun drawing made with the 
help of LuaTeX to speed up some calculations. 
Thanks ! 

> Hope that helps.
> Gavin

Fabrice.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Blocks inside a conditional mode.

2021-11-29 Thread Fabrice L via ntg-context
Dear Hans,

> Le 29 nov. 2021 à 03:54, Hans Hagen  a écrit :
> 
> On 11/29/2021 2:54 AM, Fabrice L via ntg-context wrote:
> 
>> The only inconvenient of this solution if that I have to define 15 blocks 
>> (one for each week of the term): ComplementOne, ComplementTwo, 
> \defineblock[example]
> 
> \starttext
> 
>   \beginexample[Two]
>   Last course, we have seen A.
>   \endexample
> 
>   \beginexample[Three]
>   Last course, we have seen B….
>   \endexample
> 
>   \beginexample[Three]
>   Last course, we have seen C….
>   \endexample
> 
>\useblocks[example][Two]
> % \useblocks[example][Three]
> 
> \stoptext
> 
> %


Thanks (again). ConTeXt is always full of ressource ! I did not know we could 
do this, even if I realized now that there is a similar example in the wiki. 

For the list, in case in the future this would be useful for another user, 
below is the complete minimal example using this approach.


% - Minimal working example :

\setuppapersize[S5][S5]
\enablemode[Professor]

\defineblock[Complement]
\setupblock[Complement][

before={\page[yes]\setuppagenumber[state=stop]\setupheadertexts[]\setupbackgrounds[page][background=color,backgroundcolor=red]},
after={\page[yes]\setuppagenumber[state=start]}]

\starttext

% Let's process the summaries  ;
\beginComplement[Two]
Last course, we have seen A.
\endComplement

\beginComplement[Three]
Last course, we have seen B….
\endComplement

\beginComplement[Three]
Last course, we have seen C….
\endComplementThree

\beginComplement[Four]
Last course, we have seen D….
\endComplementFour
\beginComplement
and E !
\endComplementFour
%  summaries: end   ;

Let's begin course 1. 
This is course 1 : a lot of pages here about A! 
\page[yes]

Let's begin course 2. 
\doifmode{Professor} {
\useblocks[Complement][Two]
}

This is course 2 : a lot of pages here about B and C! 

\page[yes]
Let's begin course 3. 
\doifmode{Professor} {
\useblocks[Complement][Three]
}   

This is course 3 : a lot of pages here about D... ! 
\doifmode{Professor} {
\useblocks[Complement][Four]
}   

    The course 4 ! 
\stoptext

% - Minimal working example  : end 


Fabrice.

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Blocks inside a conditional mode.

2021-11-28 Thread Fabrice L via ntg-context
Thanks Hraban for your answer, 

> Le 28 nov. 2021 à 15:42, Henning Hraban Ramm via ntg-context 
>  a écrit :
> 
> Am 28.11.21 um 19:39 schrieb Fabrice L via ntg-context:
>> I have an error when I try to insert a block inside a conditional mode (but 
>> there is two nested conditional mode.. is this the problem ?).
> 
> You can’t nest modes in \startmode ... \stopmode.
> I don’t know what are the limitations of \doifmode.

According to the wiki, we cannot nest several \startmode …\stopmode, but there 
is no limitation with \doifmode.

> 
> Maybe it helps to use additional grouping with {}, \bgroup .. \egroup or 
> \start .. \stop.

Following your advice, I tried with several {}, but no luck. 
> 
>> In my courses notes, I insert some blocks (named «  Complement » in the 
>> minimal exemple below) when in « Professor » mode. This works fine, as shown 
>> in the first «  \beginComplement … \endComplement  » of my example below.
> 
> Maybe you can work with buffers or (ConTeXt) blocks (the latter were recently 
> discussed here, it’s a quite unknown mechanism).

I already use blocks, but following your message, I tried to think differently. 
One solution would be to define a block for each course. Something like this (a 
working minimal example, redone in order this would be more easier to 
understand (I hope!) what I’m trying to do):

% —
\setuppapersize[S5][S5]
\enablemode[Professor]

\defineblock[ComplementTwo]
\defineblock[ComplementThree]

\setupblock[ComplementTwo,ComplementThree][

before={\page[yes]\setuppagenumber[state=stop]\setupheadertexts[]\setupbackgrounds[page][background=color,backgroundcolor=red]},
after={\page[yes]\setuppagenumber[state=start]}]
\starttext

% Let's process the summaries  ;
\beginComplementTwo
Last course, we have seen A.
\endComplementTwo

\beginComplementThree
Last course, we have seen B….
\endComplementThree

\beginComplementThree
Last course, we have seen C….
\endComplementThree
%  

Let's begin course 1. 
This is course 1 : a lot of pages here about A! 
\page[yes]

Let's begin course 2. 
\doifmode{Professor} {
\useblocks[ComplementTwo]
}

This is course 2 : a lot of pages here about B and C! 

\page[yes]
Let's begin course 3. 
\doifmode{Professor} {
\useblocks[ComplementThree]
}   

This is course 3 : a lot of pages here about D... ! 

\stoptext

%— 

The only inconvenient of this solution if that I have to define 15 blocks (one 
for each week of the term): ComplementOne, ComplementTwo, .., 
ComplementFithteen… Another drawback of this is difficult to move one block 
form one week to another if I change something. Each block here correspond in 
fact to a summary of the previous course. So I have typically around 10 pages 
of summary for each course. The challenge is that the content of each course is 
not exactly the same form one term to another, so I have to move a page to the 
summary from one course to the other one, like in a given term, if teach about 
subject C in course 3 :

\beginComplementThree
Last course, we have seen C….
\endComplementThree

, but next term in course 4:

\beginComplementFour
Last course, we have seen C….
\\beginComplementFour

I have to manually change \beginComplementThree … \endComplementThree to 
\beginComplementFour … \beginComplementFour.

But I will do this if I do not find another solution. 
Thanks again Hraban.
Fabrice. 

> 
> 
> Hraban
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Blocks inside a conditional mode.

2021-11-28 Thread Fabrice L via ntg-context
Dear list,

I have an error when I try to insert a block inside a conditional mode (but 
there is two nested conditional mode.. is this the problem ?).  

In my courses notes, I insert some blocks (named «  Complement » in the minimal 
exemple below) when in « Professor » mode. This works fine, as shown in the 
first «  \beginComplement … \endComplement  » of my example below. 

But now I have to use another condition for some blocks, depending of the 
number of the current course. So I insert my block with a condition, here « 
CourseOne » :

\enablemode[CourseOne]
\doifmode{CourseOne}{
\beginComplement
Another complementary slide. 
\endComplement
}

But this does not work :

% 
tex error   > tex error on line 1 in file 
/Users/fabricel/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv: 
! TeX capacity exceeded, sorry [input stack size=5]
% 

The problem can be summarized in this minimal non working example : 

% — MWE —
\setuppapersize[S5][S5]
\enablemode[Professor]

\defineblock[Complement]
\setupblock[Complement][

before={\page[yes]\setuppagenumber[state=stop]\setupheadertexts[]\setupbackgrounds[page][background=color,backgroundcolor=red]},
after={\page[yes]\setuppagenumber[state=start]}]
\doifallmodes{Professor} {
\keepblocks[Complement]
}

\starttext

page 1

\beginComplement
A complementary slide. 
\endComplement

page 2

\enablemode[CourseOne]
\doifmode{CourseOne}{
\beginComplement
Another complementary slide but only for course number 1. 
\endComplement
}
\disablemode[CourseOne]

page 3

\enablemode[CourseTwo]
\doifmode{CourseTwo}{
\beginComplement
Another complementary slide but only for course number 2. 
\endComplement
}
\disablemode[CourseTwo]

\stoptext
\stoptext

% — MWE —

Blocks and modes usually works fine for me, but here, I do not understand my 
error.
Thanks for any help ! 

Fabrice. 


Note : in case this way of doing things seems a bit silly, here are more 
explanations. I do use mode « CourseOne »  here because in the real life, the 
content in the condition «  \doifmode{CourseOne}{ …} » is read in an external 
file, containing material for « CourseOne », « CourseTwo », etc. The setup is 
then, in the main file :

% Main file : begin 

Bla bla bla ...

\enablemode[CourseOne]
\input ComplementMaterial.tex
\disablemode[CourseOne]

Bla bla bla ...

\enablemode[CourseOne]
\input ComplementMaterial.tex
\disablemode[CourseOne]

% Main file : end 

And in the « ComplementMaterial.tex » there is :

% ComplementMaterial.tex —

\doifmode{CourseOne}{
\beginComplement
A complementary slide but only for course number 1. 
\endComplement

\beginComplement
Another complementary slide but only for course number 1. 
\endComplement
}

\doifmode{CourseTwo}{
\beginComplement
A complementary slide but only for course number 2. 
\endComplement

\beginComplement
Another complementary slide but only for course number 2. 
\endComplement
}
% ComplementMaterial.tex —

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Compilation error with the new version of lmtx

2021-10-16 Thread Fabrice Couvreur via ntg-context
Hi,
The latest version of lmtx does not allow me to compile the following file
although there was no problem before.
Thank you
Fabrice

\startproduct[expertes-manual]

  \startfrontmatter

\setuppagenumbering
   [location=]

\definefont
  [ChapterTextStyle]
  [SansBold*default sa 2.2]

\setuphead
  [title]
  [style=ChapterTextStyle,
   align=flushright]

\setuplist
   [chapter]
   [style=bold,
alternative=b,
width=1em]

\setuplist
   [section]
   [margin=1em,
width=1.75em]

\setuplist
   [subsection]
   [margin=2.75em,
width=2em,
distance=\spaceamount]


\starttitle[title=Table des matières]

 \placelist
   [chapter,section,subsection]
   [criterium=all,
   interaction=all,
alternative=c]

  \stoptitle

\stopfrontmatter

\startbodymatter
\component[chapter_1]
\component[chapter_2]
\stopbodymatter


\stopproduct

##
tex error   > tex error on line 1 in file ./expertes.tex: Undefined
control sequence \undefined




\relax
 \p_maxwidth
\dostarttagged \t!listcontent \empty \clf_listtitle {\currentlist
}\currentlistindex \relax
\dostoptagged
 \strc_lists_limitated_text
#1->\edef \p_maxwidth {\listparameter \c!maxwidth }\ifempty \p_maxwidth
\listparameter \c!textcommand {#1}
\else \listparameter \c!textcommand {\limitatetext {#1}\p_maxwidth
{\splitsymbol {\listparameter \c!limittext }}}\fi
 \22>:140>:abc
...rence_attribute \v!text \strc_lists_set_style_color \c!textstyle
\c!textcolor \v!text \the \t_lists_every_renderingtext \the
\t_lists_every_renderingsynchronize \setstrut \begstrut
\strc_lists_limitated_text \currentlistentrytitle
\endstrut \en ...
 \currentlistextra
...\begingroup \ifempty \m_strc_list_alternative \edef
\currentlistalternative {\listparameter \c!alternative }\else \let
\currentlistalternative \m_strc_list_alternative \fi \directsetup
{\listalternativeparameter \c!renderingsetup }
\relax \endgr ...
 ...


alternative=c]

 1 >>  \startproduct[expertes-manual]
 2
 3   \startfrontmatter
 4
 5 \setuppagenumbering
 6[location=]
 7
 8 \definefont
 9   [ChapterTextStyle]
10   [SansBold*default sa 2.2]
11
The control sequence at the end of the top line of your error message was
never
\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Sat Oct 16 19:28:21
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Framedtext : text out of frame

2021-09-26 Thread Fabrice Couvreur via ntg-context
Hi,
How to fix the small problem in the code below where the text goes out of
the frame ?
Thanks
Fabrice

\usecolors[x11]

\starttext
  \startframedtext[frame=off,width=\textwidth,
align={broad,right},indenting={yes},background=color,backgroundcolor=navajowhite1]
  \startitemize[columns,three,n]
\startitem
 Une quantité constante est une quantité déterminée, qui conserve
toujours la même valeur.
\stopitem\par
\startitem
  Une quantité variable est une quantité indéterminée, ou, si l'on
veut, une quantité universelle, qui comprend toutes les valeurs déterminées.
\stopitem\par
\startitem
  Une quantité variable devient déterminée, lorsqu'on lui attribue
une valeur déterminée quelconque.
\stopitem\par
\startitem
  Une fonction de quantité variable est une expression analytique
composée, de quelque manière que ce soit, de cette même quantité & de
nombres, ou de quantités constantes.

  Par exemple, \m{a+3z} ; \m{az-4zz} ;

  \m{az+b\sqrt{aa-zz}} , cz ; \m{etc}. sont des

  fonctions de \m{z}.
\stopitem\par
\startitem
  Une fonction de variable est

  donc aussi une quantité variable.
\stopitem\par
  \stopitemize
\stopframedtext
\stoptext1
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Image cropped

2021-09-13 Thread Fabrice Couvreur via ntg-context
Hi Wolfgang,
I had done the same thing but I thought this solution was not the most
elegant, and I wanted to know what the specialists were going to do.
Thank you.
Fabrice

Le dim. 12 sept. 2021 à 16:50, Wolfgang Schuster via ntg-context <
ntg-context@ntg.nl> a écrit :

> Fabrice Couvreur via ntg-context schrieb am 12.09.2021 um 12:10:
>
> Hi Wolfgang,
> That's what I understood but the problem is that if I reduce the margin,
> the logo is too small in my opinion : what would you do ?
>
>
> Place the logo with a layer or shift is inwards.
>
> \setuplayout
>   [width=middle,
>height=middle]
>
> \setupfootertexts
>   [margin]
>   []
>   [{\offset[x=-1cm,y=\strutdp]{\externalfigure[logo.pdf][factor=max]}}]
>   []
>   [{\offset[x=1cm,y=\strutdp]{\externalfigure[logo.pdf][factor=max]}}]
>
> %\showframe
>
> \starttext
> \dorecurse{8}{\samplefile{knuth}}
> \stoptext
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Image cropped

2021-09-12 Thread Fabrice Couvreur via ntg-context
Hi Wolfgang,
That's what I understood but the problem is that if I reduce the margin,
the logo is too small in my opinion : what would you do ?
Indeed the line is green but you will have understood: =)
Fabrice

Le sam. 11 sept. 2021 à 19:17, Wolfgang Schuster via ntg-context <
ntg-context@ntg.nl> a écrit :

> Fabrice Couvreur via ntg-context schrieb am 11.09.2021 um 17:52:
>
> Hi Wolfgang,
> The red frame is the print area ?
>
>
> The *green* frame are the margins of the A4 paper which is positioned in
> the middle of the A3 paper.
>
> The larger paper allows you to the see the part of the margins which are
> outside of the printable area.
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Image cropped

2021-09-11 Thread Fabrice Couvreur via ntg-context
Hi Wolfgang,
The red frame is the print area ?

Le sam. 11 sept. 2021 à 16:43, Wolfgang Schuster via ntg-context <
ntg-context@ntg.nl> a écrit :

> Fabrice Couvreur via ntg-context schrieb am 11.09.2021 um 16:32:
>
> Hello,
> I like to put a logo on my statements but I noticed that the image is
> cropped on the edge.
> I tried to change the printer's print settings but was unsuccessful.
>
>
> Add these settings to your example and you see the problem.
>
> \setuppapersize[A4][A3]
>
> \setuplayout[location=middle]
>
> \setuplayout[width=middle,height=middle]
>
> \setupfootertexts
>[margin]
>[]
>[{\offset[y=\strutdp]{\externalfigure[logo.pdf][factor=max]}}]
>[]
>[{\offset[y=\strutdp]{\externalfigure[logo.pdf][factor=max]}}]
>
> \showframe
>
> \starttext
> \dorecurse{8}{\input knuth}
> \stoptext
>
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Image cropped

2021-09-11 Thread Fabrice Couvreur via ntg-context
Hello,
I like to put a logo on my statements but I noticed that the image is
cropped on the edge.
I tried to change the printer's print settings but was unsuccessful.
Thanks
Fabrice

\setuplayout[width=middle,height=middle]

\setupfootertexts
   [margin]
   []
   [{\offset[y=\strutdp]{\externalfigure[logo.pdf][factor=max]}}]
   []
   [{\offset[y=\strutdp]{\externalfigure[logo.pdf][factor=max]}}]

\showframe

\starttext
\dorecurse{8}{\input knuth}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] getting line numbers

2021-09-05 Thread Fabrice Couvreur via ntg-context
Hi,
I am trying to test this file but without success.
I just do context test.tex but I suspect that is not it.
When you say

> We compile and run:
>

Which command is it with ?
Thanks
Fabrice

Le ven. 3 sept. 2021 à 18:26, Hans Hagen via ntg-context 
a écrit :

> On 9/3/2021 3:53 PM, Aditya Mahajan via ntg-context wrote:
> > On Fri, 3 Sep 2021, Thierry Horsin via ntg-context wrote:
> >
> >> Hi everybody
> >>
> >> Is there a way to have an automatic access to the current line number
> of a specific place inside a tex file ? To be more precise, here is what I
> would like to do.
> >
> > Also look at the filter module.
> >
> >  https://github.com/adityam/filter
> >
> > Behind the scenes, it works by saving the content in an external file
> and then
> > running it through any external program. It also allows for caching the
> > result, and has many options for customizing the behavior.
> you forgot to mention that it also makes sure that you only process when
> there has been a change (after all calling gcc comes at a price)
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


  1   2   3   4   5   6   7   8   9   10   >