[NTG-context] Re: Errors with 2024-05-11 LMTX

2024-05-12 Thread Rik Kabel


On 2024-05-12 19:01, Hans Hagen wrote:

On 5/12/2024 6:50 PM, Rik Kabel wrote:
I have come across an error that halts processing with the latest 
release. The following demonstrates this:
That one was hard to find as it was not something new hut just showing 
up now.


Can you try the latest binary from

https://build.contextgarden.net/dl/luametatex/work/

Hans

Thank you. That works for both of the examples and for the larger 
project from which they were derived.


--
Rik
___
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: Errors with 2024-05-11 LMTX

2024-05-12 Thread Hans Hagen

On 5/12/2024 6:50 PM, Rik Kabel wrote:
I have come across an error that halts processing with the latest 
release. The following demonstrates this:
That one was hard to find as it was not something new hut just showing 
up now.


Can you try the latest binary from

https://build.contextgarden.net/dl/luametatex/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://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 Mikael Sundqvist
Hi,

On Sun, May 12, 2024 at 6:24 PM Fabrice Couvreur <
fabrice1.couvr...@gmail.com> wrote:
>
> With Okular, it works !

Very good. You can still try the thing below:

\startluacode
  local exp = math.exp
  local N   = 1000
  local xstep  = 1.6/N
  local ystep  = 1.8/N
  local xmin   = 0.3
  local ymin   = 0.4

  local function f(x,y)
local x = xstep*x - xmin
local y = ystep*y - ymin
local z = x + exp(-60*x) - y
if z > 0 then
  return '1'
else
  return '0'
end
  end

  potrace.setbitmap("mybitmap", potrace.contourplot(N,N,f))
\stopluacode

\startMPpage[offset=1dk]
  path p ; p := lmt_potraced [
stringname = "mybitmap",
value  = "1",
tolerance  = 0.1,
threshold  = 0.2,
optimize   = true,
  ] ;
  p := p xsized 10cm ;
  draw p withpen pencircle scaled 5 withcolor "darkblue" ;
  drawpoints p withcolor "orange" ;
  drawpointlabels p ;
  p := subpath(6,19) of p ;
  draw p withpen pencircle scaled 3 withcolor "yellow" ;
\stopMPpage

Another thing, Hans added nocycle, so you can write your loop if you want
to use it as something like

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

Then you do not need to think about the first and/or last point separately.
___
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] Errors with 2024-05-11 LMTX

2024-05-12 Thread Rik Kabel
I have come across an error that halts processing with the latest 
release. The following demonstrates this:


   \setuppagenumbering [location=]

   \starttext

 \dorecurse{36}{\dorecurse{19}{abc }}

 \startplacetable[location=split,title={Table}]
    \starttabulate[|p|p|]
    \HL
    \NC Heading \crlf
    heading
    \NC Heading \crlf
    heading
    \NC\AR
    \HL
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \HL
    \stoptabulate
    \stopplacetable

   \stoptext

while this version ends with the error : error (nodes): attempt to 
double-free rule node 55342, ignored


   \setuppagenumbering [location=]
   \starttext

 \dorecurse{37}{\dorecurse{19}{abc }}

 \startplacetable[location=split,title={Table}]

    \starttabulate[|p|p|]
    \HL
    \NC Heading \crlf
    heading
    \NC Heading \crlf
    heading
    \NC\AR
    \HL
    \NC abc \NC abc \NC\AR
    \NC abc \NC abc \NC\AR
    \NC abc \NC abc \NC\AR
    \HL
    \stoptabulate

    \stopplacetable

   \stoptext

--
Rik
___
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
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 Hans Hagen

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
___


[NTG-context] Re: no effect of \definefontfeature for adobevariablefontprototype

2024-05-12 Thread Hans Hagen

On 5/9/2024 10:38 PM, garu...@azules.eu wrote:

Hi,

trying to work with variable fonts, I am stuck at the very beginning.

I can't see any effect of weight parameter.
Using adobevariablefontprototypebold and adobevariablefontprototypelight is 
working.

\starttext

\definefontfeature[whatever][axis={weight:150}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:350}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:550}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:750}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\stoptext

Can it be something from with my font file ?

\starttext

\definefontfeature[whatever01][default][axis={weight=0250}]
\definefontfeature[whatever02][default][axis={weight=0500}]
\definefontfeature[whatever03][default][axis={weight=0750}]
\definefontfeature[whatever04][default][axis={weight=1000}]

\definefontfeature[whatever10][default][axis={=000}]
\definefontfeature[whatever20][default][axis={=050}]
\definefontfeature[whatever30][default][axis={=075}]
\definefontfeature[whatever40][default][axis={=100}]

\definefontfeature[whatever11][default][axis={weight=0250,=000}]
\definefontfeature[whatever22][default][axis={weight=0500,=050}]
\definefontfeature[whatever33][default][axis={weight=0750,=075}]
\definefontfeature[whatever44][default][axis={weight=1000,=100}]

\definedfont[name:adobevariablefontprototype*whatever01]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever02]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever03]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever04]foo@bar\blank

\definedfont[name:adobevariablefontprototype*whatever10]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever20]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever30]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever40]foo@bar\blank

\definedfont[name:adobevariablefontprototype*whatever11]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever22]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever33]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever44]foo@bar\par

\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://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] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen

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
___


[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] Maybe an alignement issue of \vdots in mixed \NC and \VL (\definemathmatrix)

2024-05-12 Thread garulfo
Hi,

the  first \vdots in the third row is not centered.

\starttext
\definemathmatrix[mymatrix][matrix:parentheses]
\startformula
\startmymatrix
\NC A_1\VL B_1\NR
\HL
\NC \vdots \VL \vdots  \NR
\NC \vdots \NC \vdots  \NR% there is probably something from here
\HL
\NC A_n\VL B_n\NR
\stopmymatrix
\stopformula
\stoptext

https://wiki.contextgarden.net/Matrix_in_maths#Other_formatting_example
___
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
___