[NTG-context] Lua and inject.path to make a disconnected MetaPost path?

2024-01-08 Thread Gavin via ntg-context
Hello LuaMetaFun Fans,

Can I use mp.inject.path in Lua to create a disconnected path in MetaPost?

This is for my module that draws globes. I currently do something like this for 
drawing the continents. (This MWE has two triangular continents.)

\startluacode
  continents = {}
  continents[1] = {{0,0}, {-1,-1}, {-1,0}, cycle = true }
  continents[2] = {{0,1}, {1,0}, {1,-1}, cycle = true }
  function mp.getglobepath(continentnum)
mp.inject.path(continents[continentnum])
  end
\stopluacode

\startMPpage
  path p[], q ;
  p1 = (lua.mp.getglobepath(1) scaled 1cm) ;
  p2 = (lua.mp.getglobepath(2) scaled 1cm) ;
  q = p1 && p2 && cycle ;
  draw p1 withpen pencircle scaled 2pt withcolor .7 ;
  draw p2 withpen pencircle scaled 2pt withcolor .7 ;
  fill q withcolor 0.9 ;
  draw q withcolor red ;
\stopMPpage

The path q has both of the continents, disconnected.

I’d like to produce the two continents in Lua and pass them to MetaPost as a 
single disconnected path, using something like this: 

\startluacode
  continents = {
{0,0}, {-1,-1}, {-1,0}, — Change this to make a disconnected path!
{0,1}, {1,0}, {1,-1},
cycle = true }
  function mp.getglobepath()
mp.inject.path(continents)
  end
\stopluacode

\startMPpage
  path p ;
  p = (lua.mp.getglobepath() scaled 1cm) ;
  fill p withcolor 0.9 ;
  draw p withcolor red ;
\stopMPpage

If I can make the path p disconnected, this would allow me to make exactly the 
path I want in Lua, before passing it to MetaPost, rather than passing lots of 
paths and connecting them in MetaPost with the mysterious (to me) && or .

Thanks!
Gavin


___
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: Why the way key-value argument is called affected the document's output?

2024-01-08 Thread Ali Ali
Since in the "setup-en.pdf" on p. 234, in "\setuplayout" the possible values 
for "grid" key is "yes", "no" (default), and "off" respectively.

So what does the "yes " (with a trailing space) sets "grid" key to?

Ali
___
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: Why the way key-value argument is called affected the document's output?

2024-01-08 Thread Wolfgang Schuster

Ali Ali schrieb am 08.01.2024 um 23:33:

So is
"\setuplayout[grid=yes]"
AND
"\setuplayout[
grid=yes
]"
not same?

I mean, we are initializing "grid" to "yes" in both cases.


No, in the first case you end the value of the grid-key with ] which 
results in "yes" as argument but in the second case you have a linebreak 
before ] which adds a space to the argument which results in "yes " 
(with a trailing space) as argument.


Wolfgang

___
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: Why the way key-value argument is called affected the document's output?

2024-01-08 Thread Ali Ali
So is
"\setuplayout[grid=yes]"
AND
"\setuplayout[
grid=yes
]"
not same?

I mean, we are initializing "grid" to "yes" in both cases.

Ali
___
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: Why the way key-value argument is called affected the document's output?

2024-01-08 Thread Hans Hagen

On 1/8/2024 11:05 PM, 1114...@gmail.com wrote:

Hi,

I was cleaning and formatting my context file and then when I compiled it, the 
output I got introduced extra vertical spacings at the section headings that 
weren't there in the previous compilations. I had to spend enormous amount of 
time trying to fix it so to emulate my previous outputs. Turns out the problem 
was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different 
outputs, meaning the vertical spacings are not same, on my device running the 
version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]


Here you set the grid variable to "yes".


%% Type 2.
%\setuplayout[
%grid=yes
%]


Here you set the grid variable to "yes " so a trailing space.


\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext

So this is ok:

\setupfoo
 [a=A,
  b=B]

\setupfoo
 [a=A,
  b=B,
 ]

I'm not aware of funmdamental changes in the parse, apart from that in 
many setup commands one can now do this:


\setupfoo
  [A=\this[works],
   B=\that[doestoo]]

as nested brackets are handled.

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] Why the way key-value argument is called affected the document's output?

2024-01-08 Thread 111414w
Hi,

I was cleaning and formatting my context file and then when I compiled it, the 
output I got introduced extra vertical spacings at the section headings that 
weren't there in the previous compilations. I had to spend enormous amount of 
time trying to fix it so to emulate my previous outputs. Turns out the problem 
was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different 
outputs, meaning the vertical spacings are not same, on my device running the 
version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]

%% Type 2.
%\setuplayout[
%grid=yes
%]

\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext
"""


Best regards,
Ali
___
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: Links

2024-01-08 Thread Henning Hraban Ramm

Am 08.01.24 um 14:10 schrieb Ursula Hermann:

Dear List,

Is this the right way?

I want to use linked bibliography numbers, linked Chapter, section 
subsection, linked margin numbers, in the text.


\setupinteraction[state=start]


This is essential.



\starttext

Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par von 
\m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par 
(Beutelspacher [\hyphenatedurl {10},S.54]).


\stoptext


\hyphenatedurl only changes the hyphenation of its content, it doesn’t 
create a link. In your example it makes no sense.


Generally, you need an anchor (link target) to link to, e.g.

\startchapter[title={My chapter},reference=chap:first]
or
\chapter[chap:first]{My chapter}

This works the same for other structure levels. I’m not sure about 
bibliography, but I think you must use the bib entry code.


You can also set anchors manually using \textreference and \pagereference.

Then you can use \in[chap:first], \about[chap:first] or \at[chap:first].

For external links, you use \goto (it’s a bit extensive).

Please look up the syntax reference in the wiki.

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
___


[NTG-context] Links

2024-01-08 Thread Ursula Hermann
Dear List,
Is this the right way?
I want to use linked bibliography numbers, linked Chapter, section subsection, 
linked margin numbers, in the text.

\setupinteraction[state=start]
\starttext
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par von \m{x\doubleprime} 
ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par (Beutelspacher 
[\hyphenatedurl {10},S.54]).
\stoptext

Many thanks
Uschi
___
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: vim syntax highlighting bug?

2024-01-08 Thread Vincent Hennebert
I was in touch with the maintainer of the context.vim syntax file about 
this. It turns out to be an issue with the lua.vim file that is included 
in the context one. Lua.vim highlights trailing parentheses as errors, 
but that’s done in a way that doesn’t work well when the file is 
included by other syntax files. It somehow steals the syntax context and 
makes Vim stay in Lua mode when it should go back to ConTeXt mode (I’m 
not too savvy of the details).


The maintainer came up with a workaround [1] to force returning to 
ConTeXt mode, although the parenthesis remains highlighted as an error.


That highlight bothers me, so my own workaround is to copy the lua.vim 
file in my own .vim/syntax folder and comment out the ‘syn match 
luaParenError ")"’ line (l.61 in my Vim version).


Maybe playing with the ‘contained’ keyword (in lua.vim) could lead to a 
proper solution, but I’m happy enough with my workaround that I haven’t 
felt the need to investigate this issue any further.


Hope that helps,
Vincent

[1] https://github.com/vim/vim/pull/13778

On 06/01/2024 12:28, Damien Thiriet via ntg-context wrote:

Hello,


Happy New Year!

I got into a bug in my Vim syntax highlighting version.
Highlight stays in lua mode after ctxlua macro is closed.
Here is a MWE, where «this should not be highlitghted as
a comment indeed is.

\starttext

Hello!
\ctxlua{context("does the parser work?")}

-- this should not be highlighted as a comment

\stoptext

Do other Vim users come into this?
Is my syntax file outdated?

I am using this Vim version on OpenBSD 7.3 -stable:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep  6 2023 08:55:14)
Included patches: 1-1876

Best regards,

Damien Thiriet
___
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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-01-08 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 show-gra-1.htm
 show-gra-10.htm
 show-gra-11.htm
 show-gra-12.htm
 show-gra-13.htm
 show-gra-14.htm
 show-gra-15.htm
 show-gra-16.htm
 show-gra-17.htm
 show-gra-18.htm
 show-gra-19.htm
 show-gra-2.htm
 show-gra-20.htm
 show-gra-21.htm
 show-gra-22.htm
 show-gra-23.htm
 show-gra-24.htm
 show-gra-25.htm
 show-gra-26.htm
 show-gra-27.htm
 show-gra-28.htm
 show-gra-29.htm
 show-gra-3.htm
 show-gra-4.htm
 show-gra-5.htm
 show-gra-6.htm
 show-gra-7.htm
 show-gra-8.htm
 show-gra-9.htm
 show-gra.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/colors-mkiv.pdf
 general/manuals/luametatex.pdf
 general/manuals/ontarget.pdf
 general/manuals/primitives.pdf
 general/manuals/sql-mkiv.pdf
 general/qrcs/
 general/qrcs/setup-mapping-de.pdf
 general/qrcs/setup-mapping-en.pdf
 general/qrcs/setup-mapping-fr.pdf
 general/qrcs/setup-mapping-it.pdf
 general/qrcs/setup-mapping-nl.pdf
 
 sent 234,726 bytes  received 76,243,717 bytes  4,635,057.15 bytes/sec
 total size is 577,881,441  speedup is 7.56


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12
245335154   
/var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12/current
372084567   
/var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12
372084567   total
___
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] update

2024-01-08 Thread Hans Hagen via ntg-context

Hi,

With the build farm still down I now use an alternative build, that is, 
I run a compile script on s bunch of machines and hope for the best.


In the process I decided to drop 32 bit installers (users can generate 
bins themselves if needed). I also drop bsd version and just use the 
latest. For OSX I use a retired macbook air that Hans vd Meer sent me 
that has an old operating system but new enough so that its xcode can 
make intel and arm binaries. The linux binaries have teh problem that 
they depend on glibc versions and I'm assuming a reasonable up to date 
system so I use opensuse leap (which is not even that new with it comes 
to glibc but we use it on servers here).


texmf-win64 : laptop  (linux subsystem on windows)
texmf-windows-arm64 : laptop  (native visual studio)
texmf-linux-64  : linux-opensuse-leap (latest leap 15)
texmf-linux-aarch64 : raspberrypi (latest debian)
texmf-linuxmusl-64  : linux-alpine-64 (whatever)
texmf-osx-64: airbook/118/hvdm(older xcode)
texmf-osx-arm64 : airbook/118/hvdm(older xcode)
texmf-freebsd-amd64 : openbsd-amd64-14(latest)
texmf-openbsd-amd64 : openbsd-amd64-74(latest)

If your platform doesn't work you can download the texmf.zip, 
context-texmf.zip and installation.pdf and start from there: create the 
tree, compile from source, move the binaries and it should just work.


I have no clue if the uploaded files are working but let's see ... (some 
paths have been renamed)


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 docs

2024-01-08 Thread Hans Hagen via ntg-context

On 1/8/2024 1:50 AM, Shiv Shankar Dayal wrote:
I see many libraries for Metapost in Context source. Where are these 
documented? I see Metafun manual as well, but I do not find all the 
included libraries described.


i'm not sure what you mean with library ... can you give an example?

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: Question to a formular

2024-01-08 Thread Ursula Hermann
Dear Taco, 

many thanks. 

Uschi 

-Ursprüngliche Nachricht-
Von: Taco Hoekwater  
Gesendet: Freitag, 05. Jänner 2024 15:29
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Re: Question to a formular


> On 05/01/2024 14:27, Ursula Hermann wrote:
> 
>> Can someone help me please?
> 
> 
> \starttyping
> 0! := 1
> (n + 1)! := (n + 1) n!
> \stoptyping

Or:

\startformula
\startalign[n=1,align={1:left}]
\NC 0! := 1\NR
\NC (n + 1)! := (n + 1) n!\NR
\stopalign
\stopformula

https://wiki.contextgarden.net/Multiline_equations


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