[NTG-context] Protrusion in notes, was Re: setupquotation[method=font] problem

2021-06-24 Thread Rik Kabel


On 6/24/2021 18:50, Rik Kabel wrote:
Thank you Wolfgang for the quick diagnosis and Hans for the fast 
turnaround.


Sorry, I was wrong about the turnaround -- I tested on my own patched 
copy, not the new download, but I am sure it will appear soon.


Follow-up question. Can protrusion be implemented in the first line of a 
footnote or endnote, as might improve the following? I have some 
page-long endnotes that benefit from having it in place, but do not like 
the inconsistent appearance.


Please excuse the hokey example:

   \setuplayout   [width=9cm,
    height=9cm]
   \definefontfeature [default]
   [default]
   [protrusion=quality]
   \setupalign    [hanging]
   \setupquotation    [method=font]
   \setupnote [endnote]
   [location=none]
   \setupnotation [footnote]
   [align=hanging]
   \showframe
   \starttext

   \quotation{{\em Cantharides}} is the reported message from Sir Francis
   Drake upon defeating the Spanish Armada.\endnote{\quotation{{\em
   Vovi}} is
   reportedly the message from James Broun|-|Ramsay on taking Oudh. Both
   are as likely as the attribution of \quotation{{\em peccavi}} to
   Napier after
   his defeat of the Ameer of Scinde.}\footnote{\quotation{{\em Vovi}} is
   reportedly the message from James Broun|-|Ramsay on taking Oudh. Both
   are as likely as the attribution of \quotation{{\em peccavi}} to
   Napier after
   his defeat of the Ameer of Scinde.}

   \placenotes[endnote]

   \stoptext

--
Rik

___
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] setupquotation[method=font] problem

2021-06-24 Thread Rik Kabel

Thank you Wolfgang for the quick diagnosis and Hans for the fast turnaround.

--
Rik
___
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] lmtx upload

2021-06-24 Thread Hans Hagen

On 6/25/2021 12:18 AM, luigi scarso wrote:



On Thu, Jun 24, 2021 at 7:29 PM Hans Hagen > wrote:


Hi,

I uploaded a new version. I got sidetracked by an experiment. We can
read from zip files, but as I had some tar archives I wondered if we
could read from them. They happened to be compressed. It uses an
already
present infrastructure (early mkiv I played a bit with reading from zip
files).


libarchive looks quite useful
http://libarchive.org/ 
(see 
https://docs.microsoft.com/en-us/virtualization/community/team-blog/2017/20171219-tar-and-curl-come-to-windows 
)
But it's huge and add lots of dependencies and thereby complications; 
often these libs have special platform optimizations (so one needs to 
run configure scripts) ... in luametatex i try to stay away from that .. 
but loading as external lib is of course an option; we already support 
zip, gz, tar, lz4, lzma (xz), lzo, xstd but i doubt if in practice they 
are used often (zip we need for pdf, gz for some graphics, xz because 
it's used in texlive but most of it is also kind of fun to play with: as 
less code as possible and then lua support code).


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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
It works again! Thank you very much

Jairo

El jue, 24 de jun. de 2021 a la(s) 17:23, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:58 PM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 24 de jun. de 2021 a la(s) 16:55, Hans Hagen (j.ha...@xs4all.nl
> > ) escribió:
> >
> > On 6/24/2021 11:47 PM, Jairo A. del Rio wrote:
> >  >
> >  >
> >  > El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen
> > (j.ha...@xs4all.nl 
> >  > >) escribió:
> >  >
> >  > On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
> >  >  >
> >  >  >
> >  >  > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen
> >  > (j.ha...@xs4all.nl 
> > >
> >  >  > 
> > >>) escribió:
> >  >  >
> >  >  > On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> >  >  >  > It prints:
> >  >  >  >
> >  >  >  > uname -m rb
> >  >  > hm, that is a real last resort attempt to determine
> what
> >  > system it is
> >  >  > running on (we try to avoid such calls)
> >  >  >
> >  >  > -- on linux if HOSTNAME is not known (did that change?)
> >  >  > -- on sunos always  (does anyone know an env var?)
> >  >  > -- on freebsd always (does anyone know an env var?)
> >  >  >
> >  >  >
> >  >  > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made
> any
> >  > important
> >  >  > changes on the OS. In case it helps, only the latest LMTX
> >  > produces this
> >  >  > error.
> >  >  >
> >  >  > (the 'rb' looks suspicious ... i'll check that)
> >  > what does
> >  >
> >  > echo $HOSTTYPE
> >  >
> >  >
> >  > The same as uname -m: x86_64
> >
> > weird, so can you add a print (around 4037)
> >
> > elseif name=="linux" then
> >function resolvers.platform(t,k)
> > print("!",os.getenv("HOSTTYPE"))
> > local architecture=os.getenv("HOSTTYPE") or resultof("uname -m")
> > or ""
> >
> >
> > It prints "nil" here
> i uploaded a version that might do better (lua is picky about the 'rb'
> which i need for binary pipes)
>
> now this nil ... on my opensuse on wsl it does print the expected ...
> puzzling
>
> 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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Hans Hagen

On 6/24/2021 11:58 PM, Jairo A. del Rio wrote:



El jue, 24 de jun. de 2021 a la(s) 16:55, Hans Hagen (j.ha...@xs4all.nl 
) escribió:


On 6/24/2021 11:47 PM, Jairo A. del Rio wrote:
 >
 >
 > El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen
(j.ha...@xs4all.nl 
 > >) escribió:
 >
 >     On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
 >      >
 >      >
 >      > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen
 >     (j.ha...@xs4all.nl 
>
 >      > 
>>) escribió:
 >      >
 >      >     On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
 >      >      > It prints:
 >      >      >
 >      >      > uname -m rb
 >      >     hm, that is a real last resort attempt to determine what
 >     system it is
 >      >     running on (we try to avoid such calls)
 >      >
 >      >     -- on linux if HOSTNAME is not known (did that change?)
 >      >     -- on sunos always  (does anyone know an env var?)
 >      >     -- on freebsd always (does anyone know an env var?)
 >      >
 >      >
 >      > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any
 >     important
 >      > changes on the OS. In case it helps, only the latest LMTX
 >     produces this
 >      > error.
 >      >
 >      >     (the 'rb' looks suspicious ... i'll check that)
 >     what does
 >
 >     echo $HOSTTYPE
 >
 >
 > The same as uname -m: x86_64

weird, so can you add a print (around 4037)

elseif name=="linux" then
   function resolvers.platform(t,k)
print("!",os.getenv("HOSTTYPE"))
    local architecture=os.getenv("HOSTTYPE") or resultof("uname -m")
or ""


It prints "nil" here
i uploaded a version that might do better (lua is picky about the 'rb' 
which i need for binary pipes)


now this nil ... on my opensuse on wsl it does print the expected ... 
puzzling


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
___


Re: [NTG-context] lmtx upload

2021-06-24 Thread luigi scarso
On Thu, Jun 24, 2021 at 7:29 PM Hans Hagen  wrote:

> Hi,
>
> I uploaded a new version. I got sidetracked by an experiment. We can
> read from zip files, but as I had some tar archives I wondered if we
> could read from them. They happened to be compressed. It uses an already
> present infrastructure (early mkiv I played a bit with reading from zip
> files).
>
>
libarchive looks quite useful
http://libarchive.org/
(see
https://docs.microsoft.com/en-us/virtualization/community/team-blog/2017/20171219-tar-and-curl-come-to-windows
)



-- 
luigi
___
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] setupquotation[method=font] problem

2021-06-24 Thread Wolfgang Schuster

Hans Hagen schrieb am 24.06.2021 um 23:47:

On 6/24/2021 10:00 PM, Rik Kabel wrote:
I get no quotation marks at all (and no protrusion) with 
\quotation{text} using \setupquotation[method=font]. This seems to 
have started earlier this month, but for the record, I am using 
ConTeXt  ver: 2021.06.24 19:19 LMTX.


Wolfgang's example from a related thread earlier this month 
(https://www.mail-archive.com/ntg-context@ntg.nl/msg98669.html) 
should have quotation marks and protrusion for the third line, 
matching the second line.


    \definefontfeature
   [default]
   [default]
   [protrusion=quality,expansion=quality]

    \setupquotation
   [method=font]

    \setupalign[hz,hanging]

    \starttext

    oh hi there

    “you are so”

    \quotation{you are so}

    here here

    \stoptext

Similarly with \setupquote. Help, please!

Let's see what Wolfgang says ...


The change on line 855 and 865 in typo-del.mkxl from \currentparentXXX 
to \currentXXXparent is wrong.


\def\typo_delimited_fontdriven_e
  {\typo_delimited_stop_content
 % \usedlanguageparameter{\c!right\currentparentdelimitedtext}% was: 
\currentdelimitedtext

   \usedlanguageparameter{\c!right\currentdelimitedtextparent}%
   \dostoptagged
   \typo_delimited_pop
   \endgroup}

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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
El jue, 24 de jun. de 2021 a la(s) 16:55, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:47 PM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen (j.ha...@xs4all.nl
> > ) escribió:
> >
> > On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
> >  >
> >  >
> >  > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen
> > (j.ha...@xs4all.nl 
> >  > >) escribió:
> >  >
> >  > On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> >  >  > It prints:
> >  >  >
> >  >  > uname -m rb
> >  > hm, that is a real last resort attempt to determine what
> > system it is
> >  > running on (we try to avoid such calls)
> >  >
> >  > -- on linux if HOSTNAME is not known (did that change?)
> >  > -- on sunos always  (does anyone know an env var?)
> >  > -- on freebsd always (does anyone know an env var?)
> >  >
> >  >
> >  > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any
> > important
> >  > changes on the OS. In case it helps, only the latest LMTX
> > produces this
> >  > error.
> >  >
> >  > (the 'rb' looks suspicious ... i'll check that)
> > what does
> >
> > echo $HOSTTYPE
> >
> >
> > The same as uname -m: x86_64
>
> weird, so can you add a print (around 4037)
>
> elseif name=="linux" then
>   function resolvers.platform(t,k)
> print("!",os.getenv("HOSTTYPE"))
>local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or ""
>
>
It prints "nil" here


> and see what is printed
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Jairo
___
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] Install script not working

2021-06-24 Thread Jairo A. del Rio
El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen (j.ha...@xs4all.nl
> > ) escribió:
> >
> > On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> >  > It prints:
> >  >
> >  > uname -m rb
> > hm, that is a real last resort attempt to determine what system it is
> > running on (we try to avoid such calls)
> >
> > -- on linux if HOSTNAME is not known (did that change?)
> > -- on sunos always  (does anyone know an env var?)
> > -- on freebsd always (does anyone know an env var?)
> >
> >
> > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any important
> > changes on the OS. In case it helps, only the latest LMTX produces this
> > error.
> >
> > (the 'rb' looks suspicious ... i'll check that)
> what does
>
> echo $HOSTTYPE
>
>
The same as uname -m: x86_64


> report?
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Jairo
___
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] setupquotation[method=font] problem

2021-06-24 Thread Hans Hagen

On 6/24/2021 10:00 PM, Rik Kabel wrote:
I get no quotation marks at all (and no protrusion) with 
\quotation{text} using \setupquotation[method=font]. This seems to have 
started earlier this month, but for the record, I am using ConTeXt  ver: 
2021.06.24 19:19 LMTX.


Wolfgang's example from a related thread earlier this month 
(https://www.mail-archive.com/ntg-context@ntg.nl/msg98669.html) should 
have quotation marks and protrusion for the third line, matching the 
second line.


\definefontfeature
   [default]
   [default]
   [protrusion=quality,expansion=quality]

\setupquotation
   [method=font]

\setupalign[hz,hanging]

\starttext

oh hi there

“you are so”

\quotation{you are so}

here here

\stoptext

Similarly with \setupquote. Help, please!

Let's see what Wolfgang says ...

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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> > It prints:
> >
> > uname -m rb
> hm, that is a real last resort attempt to determine what system it is
> running on (we try to avoid such calls)
>
> -- on linux if HOSTNAME is not known (did that change?)
> -- on sunos always  (does anyone know an env var?)
> -- on freebsd always (does anyone know an env var?)
>
>
Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any important
changes on the OS. In case it helps, only the latest LMTX produces this
error.


> (the 'rb' looks suspicious ... i'll check that)
>
> 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
> -
>

Jairo
___
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] Install script not working

2021-06-24 Thread Hans Hagen

On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:

It prints:

uname -m rb
hm, that is a real last resort attempt to determine what system it is 
running on (we try to avoid such calls)


-- on linux if HOSTNAME is not known (did that change?)
-- on sunos always  (does anyone know an env var?)
-- on freebsd always (does anyone know an env var?)

(the 'rb' looks suspicious ... i'll check that)

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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
Rather than missing something, it seems that "rb" confuses uname here, as
it prints:

uname: operando extra «rb»
Pruebe 'uname --help' para más información.

Using only uname -m I get:

x86_64

Am I right?

Jairo

El jue, 24 de jun. de 2021 a la(s) 16:14, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:02 PM, Jairo A. del Rio wrote:
> > When I try to install ConTeXt with install.sh (Linux 64 bit), the
> > following happens:
> >
> > lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad
> > argument #2 to 'popen' (invalid mode)
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el
> > archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua':
> > No existe el archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> >
> '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua':
>
> > No existe el archivo o el directorio
> >
> > Messages in Spanish say the directory or file doesn't exist. Am I
> > missing something? Thanks in advance
> can you check what is missing by adding a print?
>
>   local popen=io.popen   if popen   then function print(...) io.popen
> (...) flush() return popen  (...) end end
>
>
> -
>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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
It prints:

uname -m rb

Jairo

El jue, 24 de jun. de 2021 a la(s) 16:14, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:02 PM, Jairo A. del Rio wrote:
> > When I try to install ConTeXt with install.sh (Linux 64 bit), the
> > following happens:
> >
> > lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad
> > argument #2 to 'popen' (invalid mode)
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el
> > archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua':
> > No existe el archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> >
> '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua':
>
> > No existe el archivo o el directorio
> >
> > Messages in Spanish say the directory or file doesn't exist. Am I
> > missing something? Thanks in advance
> can you check what is missing by adding a print?
>
>   local popen=io.popen   if popen   then function print(...) io.popen
> (...) flush() return popen  (...) end end
>
>
> -
>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
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Hans Hagen

On 6/24/2021 11:02 PM, Jairo A. del Rio wrote:
When I try to install ConTeXt with install.sh (Linux 64 bit), the 
following happens:


lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad 
argument #2 to 'popen' (invalid mode)
cp: no se puede efectuar `stat' sobre 
'/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el 
archivo o el directorio
cp: no se puede efectuar `stat' sobre 
'/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua': 
No existe el archivo o el directorio
cp: no se puede efectuar `stat' sobre 
'/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua': 
No existe el archivo o el directorio


Messages in Spanish say the directory or file doesn't exist. Am I 
missing something? Thanks in advance

can you check what is missing by adding a print?

 local popen=io.popen   if popen   then function print(...) io.popen 
(...) flush() return popen  (...) end end



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


[NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
When I try to install ConTeXt with install.sh (Linux 64 bit), the following
happens:

lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad
argument #2 to 'popen' (invalid mode)
cp: no se puede efectuar `stat' sobre
'/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el archivo o
el directorio
cp: no se puede efectuar `stat' sobre
'/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua': No
existe el archivo o el directorio
cp: no se puede efectuar `stat' sobre
'/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua':
No existe el archivo o el directorio

Messages in Spanish say the directory or file doesn't exist. Am I missing
something? Thanks in advance

Jairo
___
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] setupquotation[method=font] problem

2021-06-24 Thread Rik Kabel
I get no quotation marks at all (and no protrusion) with 
\quotation{text} using \setupquotation[method=font]. This seems to have 
started earlier this month, but for the record, I am using ConTeXt  ver: 
2021.06.24 19:19 LMTX.


Wolfgang's example from a related thread earlier this month 
(https://www.mail-archive.com/ntg-context@ntg.nl/msg98669.html) should 
have quotation marks and protrusion for the third line, matching the 
second line.


   \definefontfeature
  [default]
  [default]
  [protrusion=quality,expansion=quality]

   \setupquotation
  [method=font]

   \setupalign[hz,hanging]

   \starttext

   oh hi there

   “you are so”

   \quotation{you are so}

   here here

   \stoptext

Similarly with \setupquote. Help, please!

--
Rik

___
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] lmtx upload

2021-06-24 Thread Hans Hagen

Hi,

I uploaded a new version. I got sidetracked by an experiment. We can 
read from zip files, but as I had some tar archives I wondered if we 
could read from them. They happened to be compressed. It uses an already 
present infrastructure (early mkiv I played a bit with reading from zip 
files).


\starttext

\dorecurse{100}{
\input {tar:///e:/temporary/test/foo.tar?name=test.tex}\par
\input {tar:///e:/temporary/test/foo.tar.xz?name=test.tex}\par
\input {tar:///e:/temporary/test/foo.tar.gz?name=test.tex}\par
}

\stoptext

The tar files are handled by lmtx itself, the gzipped variant uses the 
basic decompressor of the engine (different in lmtx than in mkiv but 
that should not matterl i only tested lmtx). The xz one is a bit more 
special as it uses the external xz program unless one has limlzma 
installed, e.g. in:


  tex/texmf-win64/bin/lib/luametatex/lzma/liblzma.dll

(mtxrun --generate makes it locatable).

In all three examples performance is quite ok. It might a nice solution 
for cases where one has many small files cluttering the system.


It actually might be more efficient to use tar.xz instead of zip files 
but then we also need to ship the lib and that is not on the agenda. I'm 
in no hurry with such alternatives (most of todays bandwidth is wasted 
with ads and related crap anyway).


Concerning math  we have several fonts, and the public ones don't 
really play the game like cambria does. So, th emore bugs become 
features, the more we're stuck with it. Now, once fonts are stable 
(including bugs) we cna think of goodie files that fix things but an 
other option is to tell the math machinery in what aspects as font is 
not really opentype. Read: when to follow a traditional code path.


For the moment that is just an experiment and mostly meant for myself to 
explore things but it is likely to stay. Contrary to other variabls that 
control the math engine, here we have a bitset (adding dozens more 
commands makes no sense):


\setupbodyfont[newcomputermodern-book]

\starttext

\startTEXpage[offset=10pt]
$
\showglyphs\showmakeup[math] f = 10
$

$
\mathcontrolmode\plusone

\bitwiseflip\mathfontcontrol\orditalickernmathcontrolcode
\bitwiseflip\mathfontcontrol\charitalicnoreboxmathcontrolcode
\bitwiseflip\mathfontcontrol\orditalickernmathcontrolcode
\bitwiseflip\mathfontcontrol\charitalicnoreboxmathcontrolcode
\bitwiseflip\mathfontcontrol\overrulemathcontrolcode
\bitwiseflip\mathfontcontrol\underrulemathcontrolcode
\bitwiseflip\mathfontcontrol\radicalrulemathcontrolcode
\bitwiseflip\mathfontcontrol\fractionrulemathcontrolcode
\bitwiseflip\mathfontcontrol\accentskewhalfmathcontrolcode
\bitwiseflip\mathfontcontrol\accentskewapplymathcontrolcode
\bitwiseflip\mathfontcontrol\accentitalickernmathcontrolcode
\bitwiseflip\mathfontcontrol\delimiteritalickernmathcontrolcode
\bitwiseflip\mathfontcontrol\charitalicwidthmathcontrolcode
\bitwiseflip\mathfontcontrol\boxednoitalickernmathcontrolcode
\bitwiseflip\mathfontcontrol\nostaircasekernmathcontrolcode
\bitwiseflip\mathfontcontrol\textitalickernmathcontrolcode

\showglyphs\showmakeup[math] f = 10
$

\stopTEXpage

\stoptext

Here, when \mathcontrolmode larger than zero, the \mathfontcontrol 
bitset will control code paths. When the value is zero, a normal 
opentype font is assumed. There might be some more options but it's a 
bit tricky (maybe I already introduced some issues, who knows).


A font can also communicate a bitset and this is supported by a font 
feature in lmtx:


% \definefontfeature[newcm-mathextra][mathcontrol={%
% over_rule,%
% under_rule,%
% radical_rule,%
% fraction_rule,%
% accent_skew_half,%
% accent_skew_apply,%
% accent_italic_kern,%
% delimiter_italic_kern,%
% ord_italic_kern,%
% char_italic_width,%
% char_italic_no_rebox,%
% boxed_no_italic_kern,%
% no_staircase_kern,%
% text_italic_kern,%
% }]

the newcm-mathextra is for instance applied with that font when defined 
(as usual with features), Again there is some detailed control and more 
can be added. So we have a control variable at the tex end and one that 
goes with a font. The 'bits' have funny names but such are the 
internals. Eventually I'll wrap this up in a progress article.


In addition to the above there are a few fixes for issues discussed on 
the mailing list.


I'm still trying to get tracing a bit nicer, so here is another trick:

\starttext

 \def\MyPrimitiveCommandA#1{\hbox to 3cm{#1}}
\untraced\def\MyPrimitiveCommandB#1{\hbox to 3cm{#1}}

\bgroup
\tracingall
\MyPrimitiveCommandA{oeps}
\MyPrimitiveCommandB{oeps}
\egroup

The first one gives:

2:3: \MyPrimitiveCommandA #1->\hbox to 3cm{#1}
2:3: #1<-oeps
2:4: {\hbox}
2:5: {entering adjusted hbox group (level 2) at line 10}

and the second one:

2:3: \MyPrimitiveCommandB
2:4: {\hbox}
2:5: {entering adjusted hbox group (level 2) at line 11}

not 

Re: [NTG-context] injectors not working in LMTX?

2021-06-24 Thread Rik Kabel

In March, Pablo wrote:

   the following sample (from
   https://pragma-ade.com/general/manuals/workflows-mkiv.pdf#search=resort)
   doesn’t get right output with LMTX (current latest from 2021.03.25 14:04):

  \showinjector
  \setinjector[register][3][\column]
  \setinjector[list][2][{\blank[3*big]}]
  \starttext
\placelist[section][criterium=text]
\blank[3*big]
\placeregister[index][criterium=text]
\page
\startsection[title=Alpha] first \index{first}
\startsection[title=Beta] second \index{second}
\startsection[title=Gamma] third \index{third}
\startsection[title=Delta] fourth \index{fourth}
  \stoptext

   MkIV compiles this source fine, so I think this might be a bug.

   Many thanks for your help,

   Pablo

In trying to tune a toc, I discovered that this is still an issue.

--
Rik
___
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] typescripts and variants

2021-06-24 Thread BPJ
> > And, what about adding more styles so that you could have Light, Medium,
> SemiBold, Bold, ExtraBold, Black etc. all defined in a single fontfamily?
> If that was available each font family would then define all the styles for
> one variant (SemiCondensed, ExtraCondensed, Condensed, each with 18 styles!)
>
> You can add more alternatives (\it, \bf ...) to the font mechanism but
> this requires additional settings (\definebodyfont ...) to get it
> working. A limiting factor is that you have to stick to two-letter names
> for each alternative


If you don't mind a question from a lapsed user: what is the reason for
this restriction? It seems arbitrary but I have a feeling it's some
vanilla-TeX thing which I have forgotten.


and the easier solution is to create additional
> typefaces.
>

Also most likely sanity preserving!


> 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] Proper ligatures in Malayalam

2021-06-24 Thread Pablo Rodriguez
On 6/24/21 10:25 AM, Ajith R wrote:
> Hi,
>
> I tried to make a document in Malayalam, an Indian language. However, the 
> ligatures don't form as expected. 
> [..]
> What setting am I missing?

Hi Ajith,

I don’t have any idea about Malayalam (or any other Indic language [I
can deal with Latin and Greek scripts only, I’m afraid]), but this seems
to work fine.

\mainlanguage[ml]
\definefontfamily [malayalam] [rm] [RIT Rachana]
[features=malayalam-two]
\setupbodyfont [malayalam]
\starttext
\tf അദ്ധ്യായം\\
\em അദ്ധ്യായം\\
\bf അദ്ധ്യായം\\
\em അദ്ധ്യായം
\stoptext

Fonts are RIT Rachana from http://www.rachana.org.in/.

The relevant feature here malayalam-two. I used serif (or rm), since the
font looked to me more serif than sans-serif (Latin glyphs are clearly
from a serif font).

> The expected form is show in libre office with the same text and font, 
> attached as an image

I would say that with malayalam-two ligatures are the same ones as in
LibreOffice.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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] LMTX, BIdi, full paragraph, and spurious empty line

2021-06-24 Thread Rik Kabel


On 6/23/2021 19:44, Rik Kabel wrote:



On 6/23/2021 18:10, Hans Hagen wrote:

On 6/22/2021 4:52 AM, Rik Kabel wrote:

[...]ome an alternative way to do that.)
I'll send you a possible fix but it needs a bit of testing. It has to 
do with (probably spurious) spaces which means that the parbuilder 
then considers the dir node to be a reasoable breakpoint (well, kin 
dof okay as one gets what one asks for), but I'll be a bit more 
agressive in dealing with that.


Hans


Thank you, Hans, for looking into this so soon.

[...]



Hans and all,

I mistakenly put the new code in the wrong instance. When I put it in 
the right place and remade ConTeXt, all is well as far as my test 
examples go and the spurious lines are gone.


Thank you for the fix.

--
Rik

___
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] Proper ligatures in Malayalam

2021-06-24 Thread Ajith R
Hi,

I tried to make a document in Malayalam, an Indian language. However, the 
ligatures don't form as expected. 

A minimal example is 

\mainlanguage[ml] 
\definefontfamily [malayalam] [ss] [Rachana] [features=malayalam-one]
\definefontfeature[default] [mode=node,kern=yes, liga=yes,tlig=yes, 
ccmp=yes,language=dflt, protrusion=quality, expansion=quality]
\setupbodyfont [malayalam]
\starttext
അദ്ധ്യായം
\stoptext

What setting am I missing?

The expected form is show in libre office with the same text and font, attached 
as an image


The sequence of Malayalam characters used is 

U+0D05 U+0D26 U+0D4D U+0D27 U+0D4DU+0D2F U+0D3E U+0D2F U+0D02

Thanks,
ajith

NB: This is my second attempt to send this email. Excuse me if this results in 
duplication.___
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] Heading for endnotes / grouped by chapter endnotes

2021-06-24 Thread denis.maier
Hi,

I have two questions regarding endnotes:

1. Is there a way to add a heading automatically to the endnotes placed with 
\placenotes[endnote]?

2. I reset the endnote number at each part. Is there a way to insert the title 
of the corresponding part heading to the endnotes?

I have searched the wiki and the mailing list, and I've found two relevant 
questions, but no answers.
https://www.mail-archive.com/ntg-context@ntg.nl/msg68490.html
https://www.mail-archive.com/ntg-context@ntg.nl/msg34163.html

Best,
Denis

===
\setuphead[part][placehead=yes]
\setupnotation
  [endnote]
  [way=bypart]

\starttext

\part{First Part}
asdf\endnote{asdf}

jklö\endnote{jklö}


\part{Second Part}

asdf\endnote{asdf}

jklö\endnote{jklö}


\placenotes[endnote]

\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] Proper ligatures in Malayalam

2021-06-24 Thread Hans Hagen

On 6/24/2021 10:25 AM, Ajith R wrote:

Hi,

I tried to make a document in Malayalam, an Indian language. However, the 
ligatures don't form as expected.

A minimal example is

\mainlanguage[ml]
\definefontfamily [malayalam] [ss] [Rachana] [features=malayalam-one]
\definefontfeature[default] [mode=node,kern=yes, liga=yes,tlig=yes, 
ccmp=yes,language=dflt, protrusion=quality, expansion=quality]
\setupbodyfont [malayalam]
\starttext
അദ്ധ്യായം
\stoptext

What setting am I missing?

The expected form is show in libre office with the same text and font, attached 
as an image


The sequence of Malayalam characters used is

U+0D05 U+0D26 U+0D4D U+0D27 U+0D4DU+0D2F U+0D3E U+0D2F U+0D02

Thanks,
ajith

NB: This is my second attempt to send this email. Excuse me if this results in 
duplication.
I'm consulting the indian script expert that parcipates in the code on 
this so ... patience is needed,


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
___


Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-24 Thread Hans Hagen

On 6/24/2021 5:42 AM, Aditya Mahajan wrote:

On Wed, 23 Jun 2021, Aditya Mahajan wrote:


On Thu, 24 Jun 2021, Jeong Dal wrote:


Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t the 
correct result yet.
Using \startuseMPgraphic, and \dorecurse, the code is simpler. But, it seems to 
me that \startanimation … \stopanimation is not working with \dorecurse{}{} …
It just list all the graphics.
Any hint is welcome.


A while back, I wrote some code to easily generate metapost animations.

https://adityam.github.io/context-blog/post/metapost-animation/

I haven't used it much because I am mostly on linux, and its is a PITA to get 
an older version of Adobe Reader to work under wine.


Here's a version using these macros. It runs with MkIV but not with LMTX. 
Sorry, no time to debug what's going wrong in LMTX right now.

mp variable handling in lmtx is a bit more sophisticated

when we pass colors, numerics, dimensions there is some guess work going 
on wrt the type of the variable and on the average that works ok but in 
lmtx we can also fetch variables


so here is a basic setup for you (not much animation but it shows the idea

\unprotect

% this is similar to mkiv, although we add protection against
% overload; i should  still use the new argument handling here

\permanent\protected\def\startMPanimation
  {\dodoublegroupempty\meta_start_animation}

\permanent\protected\lettonothing\stopMPanimation

\def\meta_start_animation#1%
  {\normalexpanded{\meta_start_animation_indeed{#1}}}

\permanent\protected\def\meta_start_animation_indeed#1#2#3\stopMPanimation

{\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_use_graphic{#1}{#2}{#3}}}

% this one is like yours too but it has more wrapping inside
% wrt namespace, picking up variables etc; as you can see,
% we just operate in the normal mp related variable namespace

\permanent\tolerant\protected\def\useMPanimation#=#*#=%
  {\meta_begin_graphic_group{#1}%
   \checkmpcategoryparent
   \let\currentmpcategory\currentMPgraphicname
   \setupcurrentmpcategory[#2]%
   \dorecurse{\mpcategoryparameter{n}}{%
  \letmpcategoryparameter{i}\recurselevel
  \begincsname\??mpgraphic#1\endcsname\empty
   }%
   \meta_end_graphic_group}

% so, the main thing here is that we added the loop and
% for convenience i store the current step

\protect

\starttext

\setupMPvariables
  [animation]
  [n=4]

% watch how we *pick up* a variable, no expansion mess, we
% avoid heuristics, it might even be faster (not that it
% matters because tex is already pretty fast)

\startMPanimation{circle}
fill fullcircle scaled (10cm / mpvarn("i"));
\stopMPanimation

% there currently are mpvarn, mpvard, mpvars, mpvarb

\useMPanimation{circle}{n=4}

\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 / 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] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-24 Thread Jeong Dal
Dear Hans,

Your code works fine.

> \starttext
> 
> \startMPcode
>numeric maxCount;
>maxCount := 10;
>setglobalmacro("MyMacro",decial maxCount);
>setglobalcount("MyCount",maxCount);
> \stopMPcode
> 
> 
> \dorecurse{\MyMacro}{It is \recurselevel. }\par
> \dorecurse{\MyCount}{It is \recurselevel. }\par
> 
> \stoptext

I applied your method to my code as following. 

\newcount\udCount  %%% add count
\startMPinitializations%{UDBasic}
  pair A,B,C,D;
  pair E, F, G, H;
  path p,q;
  numeric ang,maxNum;

  numeric n; %AM Added

  u:=1in;
  A=(.95*TextWidth,u); B=(0,u); C=(0,0); D=(.95*TextWidth,0);
  p := A--B--C--D;
  q := (TextWidth,1.5u)--(0,1.5u)--(0,-.5u)--(TextWidth,-.5u)--cycle;
  z0=(.1u,0);
  
   vardef nextPt (expr M,N) = 
   if ypart(N) = 0: 
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[A,B];
   else:
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[C,D];
   fi;
   H
   enddef;

   def grayUD(expr i) =
  draw G -- if ypart(B)=ypart(G): B -- C else: C -- B fi --z[i];
  filldraw z[i]+2*(G-z[i])*u -- z[i] -- z[i+1] -- z[i+1]+(G-z[i])*u -- 
cycle withcolor .75white; 
  draw G -- z[i+1] dashed evenly;
  draw z[0] for k=0 upto i: --z[k] endfor dashed evenly;
  clip currentpicture to q;
   enddef;

   def linesUD(expr i) =
  draw p;
  draw z0 for k=0 upto i+1: --z[k] endfor dashed evenly;

  % AM: removed. Set in in the main code
  % setbounds currentpicture to boundingbox q;
   enddef;

   ang := 40;
   z[1] = whatever[z[0], z[0]+dir(ang)*u] = whatever[A,B];

   % AM: Changed next line from G to z[-1]
   z[-1] = whatever[z[0], z[0]+dir(2*ang)*u] = whatever[A,B];
   for k = 2 upto 20:
  z[k] = nextPt(z[k-2],z[k-1]);
  maxNum := k;
  exitif xpart(z[k]) > TextWidth;
   endfor;
   maxNum := maxNum-1;
   setglobalmacro("udMacro",decimal maxNum);  %%% define udMacro and udCount
   setglobalcount("udCount",maxNum);

\stopMPinitializations

\startuseMPgraphic{foldUD}{num}
   numeric n;
   n := \MPvar{num}-1;
   G := z[n-1];
   grayUD(n);
\stopuseMPgraphic
\startuseMPgraphic{dotLines}{num}
   numeric n;
   n := \MPvar{num}-1;
   linesUD(n);
\stopuseMPgraphic

\setupinteraction[state=start]
\usemodule[animation]
\starttext
%\startanimation[menu=yes]
%{
\dorecurse{\udCount}
 {\useMPgraphic{foldUD}{num=\recurselevel}}
 {\useMPgraphic{dotLines}{num=\recurselevel}}
%}
%\stopanimation
\stoptext

1. Using “udCount” doesn’t issue error message, but it draws the path p only.
2. Using “udMacro” issue the error message.

Is there anything that I miss?

Best regards,

Dalyoung

**
tex error   > tex error on line 75 in file /Users/graph/Library/Mobile 
Documents/com~apple~CloudDocs/texMain/funmath/foldBandMPnew.tex: Undefined 
control sequence

 \udMacro 

 \dorecurse #1->\ifcase #1
\relax \expandafter \gobbletwoarguments \or \expandafter 
\syst_helpers_recurse_y \else \expandafter \syst_helpers_recurse_x \fi {#1}
 \dorecurse{\udMacro}

65numeric n;
66n := \MPvar{num}-1;
67linesUD(n);
68 \stopuseMPgraphic
69 
70 \setupinteraction[state=start]
71 \usemodule[animation]
72 \starttext
73 %\startanimation[menu=yes]
74 %{
75 >>  \dorecurse{\udMacro}
76  {\useMPgraphic{foldUD}{num=\recurselevel}}
77  {\useMPgraphic{dotLines}{num=\recurselevel}}
78 %}
 ___
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] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-24 Thread Hans Hagen

On 6/24/2021 5:39 AM, Aditya Mahajan wrote:


You need to call the setglobalmacro(...) macro. The code inside 
\startMPinitializations is only executed when you call any MP environment. But 
you are using \udCount before \useMPgraphic. A simple solution is to run dummy 
MP code so that MP initializations are run:

 \starttext
 \setbox\scratchbox\hbox{\startMPcode draw unitcircle; \stopMPcode}
 \dorecurse{\udCount}
  {\useMPgraphic{foldUD}{num=\recurselevel}}
  {\useMPgraphic{dotLines}{num=\recurselevel}}
 \stoptext

A run with no sideeffects in the content stream is:

\startMPcalculation
 
\stopMPcalculation

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
___