Re: [NTG-context] atan2 function

2022-10-14 Thread Taco Hoekwater via ntg-context


> On 14 Oct 2022, at 14:26, Alan Braslau via ntg-context  
> wrote:
> 
> Are you using MP in scaled integer or in doubleprecision mode?
> 
> I have not looked into the MP angle operator code, but my suspicion is that 
> it is based on some super-clever John Hobby scheme optimized for scaled 
> integer calculations.

The scaled version of “angle” is a handwritten approximation in web, not using
any math library. I really doubt that that code is faster than calling atan2()
on a modern machine, but I’ve kept it in because using a lib might give 
slightly 
different results.

The double version of “angle" uses atan2() internally already, so that the 
atantwo macro is just duplicating the internals for that case.

The decimal version of “angle’ uses a dedicated decNumberAtan2() library call.

> 
> Hans has integrated the entire math library (and more) into lmtx.
> 
> On 13/10/22 13/10/22, 13:51, Thangalin via ntg-context wrote:
>> Thank you, Max.
>> The angle function doesn't appear to provide the same calculation as
>> my atantwo in all cases.
>> https://pdfhost.io/v/Oqj7XmibJ_scaled
>> The shorter line segment should be directed towards the vertex closest
>> to the longer line segment. I tried using both:
>> theta := angle( dx, dy );
>> theta := angle( dy, dx );
>> Neither made a difference, in some cases the angle differs from what I'd 
>> expect.
>> My implementation is based on the first version given here:
>> https://en.wikipedia.org/wiki/Atan2#Definition_and_computation
>> I have something that works, so this is more of a curiosity as to
>> there being a difference between my implementation of atantwo and the
>> angle function.
>> Here's an example with many lines and the angle function:
>> https://pdfhost.io/v/1T4jgBnxh_scaled
>> On Wed, Oct 12, 2022 at 11:42 PM Max Chernoff  wrote:
>>> 
>>> Hi,
>>> 
>>>> How is atan2 called? I rolled my own as follows:
>>> 
>>>> Is atan with two parameters supposed to behave like atan2?
>>> 
>>> At mp-math.mpxl:167 there is:
>>> 
>>>vardef atan   primary x = angle(1,x)   enddef ;
>>> 
>>> The MetaPost manual says:
>>> 
>>>The angle operator takes a pair and computes the two-argument
>>>arctangent; i.e., angle is the inverse of the dir operator
>>> 
>>> So it looks like "angle" is the function that you want for "atan2".
>>> 
>>> Thanks,
>>> -- Max
>> ___
>> 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
> ___

— 
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://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] Fwd: [CG Wiki] ConTeXt with VS Code (https://wiki.contextgarden.net/VSCode)

2022-10-03 Thread Taco Hoekwater via ntg-context
Message below is forwarded from the wiki mailing list.

Anybody?

> Begin forwarded message:
> 
> From: Michal Kvasnička 
> Subject: [CG Wiki] ConTeXt with VS Code 
> (https://wiki.contextgarden.net/VSCode)
> Date: 20 September 2022 at 16:31:06 CEST
> To: w...@contextgarden.net
> 
> Hi!
> 
> I tried to use the VS Code extension described in 
> https://wiki.contextgarden.net/VSCode <https://wiki.contextgarden.net/VSCode> 
> but in
> 
> xxx
> 
> I got the following error:
> 
> /home/qasar/Stažené/cont/tex/texmf-context/context/data/vscode/extensions/context/node_modules/vsce/out/package.js:136
> return (translations ?? [])
>   ^
> 
> SyntaxError: Unexpected token '?'
> at wrapSafe (internal/modules/cjs/loader.js:915:16)
> at Module._compile (internal/modules/cjs/loader.js:963:27)
> at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
> at Module.load (internal/modules/cjs/loader.js:863:32)
> at Function.Module._load (internal/modules/cjs/loader.js:708:14)
> at Module.require (internal/modules/cjs/loader.js:887:19)
> at require (internal/modules/cjs/helpers.js:74:18)
> at Object. 
> (/home/qasar/Stažené/cont/tex/texmf-context/context/data/vscode/extensions/context/node_modules/vsce/out/main.js:27:19)
> at Module._compile (internal/modules/cjs/loader.js:999:30)
> at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
> 
> Is there any way to discuss it with the extension developer? Can I find 
> somewhere the extension source code (on github or so)? Many thanks.
> 
> Note: I downloaded the last ConTeXt and compiled it in its directory. But 
> I've got an older version (part of TeXLive) installed on my Ubuntu 22.04, 
> too. I hope this is not the cause of the problem.
> 
> Best wishes,
> Michal
> 
> ___
> Wiki mailing list
> w...@contextgarden.net
> https://lists.contextgarden.net/mailman/listinfo/wiki

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

2022-09-07 Thread Taco Hoekwater via ntg-context
As Hraban said: it is my script that checks for new ConTeXt uploads by Hans, 
which currently cannot connect to Hans’ server. 

Usually that is because Hans is reconfiguring something in his internal network 
at Pragma, and it will eventually sort itself out.

Best wishes,
Taco

> On 7 Sep 2022, at 16:51, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Don’t panic, all is well with the list. Nothing to do, nothing to see here.
> 
> Taco included the mailing list in the message recipients of the cron demon in 
> order to get notified of ConTeXt updates.
> Seems like there is a connection problem with the pragma servers, but it 
> doesn’t affect the list.
> 
> Hraban
> 
> Am 07.09.22 um 16:32 schrieb Ursula Hermann via ntg-context:
>> I got the same Mail.
>> Uschi Hermann
>> -Ursprüngliche Nachricht-
>> Von: ntg-context  Im Auftrag von Jeong Dal via 
>> ntg-context
>> Gesendet: Mittwoch, 07. September 2022 16:27
>> An: mailing list for ConTeXt users 
>> Cc: Jeong Dal 
>> Betreff: Re: [NTG-context] Cron  
>> /var/www/aanhet.net/context/bin/cron/context-mirror
>> Dear Taco,
>> The following mail came every hour since a few days ago.
>> But I don’t get any other mail from the list.
>> I think that there is something wrong between my mail system and the server.
>> However, I don’t know how to solve it.
>> Would you please tell me what to do?
> 
> ___
> 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
> ___

— 
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://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] searching in the source browser

2022-09-06 Thread Taco Hoekwater via ntg-context


> On 5 Sep 2022, at 20:28, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Hi, this is probably for Taco:
> 
> Is there a possibility in the source browser to search for macros 
> (\something) or anything containing dots (logs.errors)?
> Because neither “simple” nor with Lua patterns I get any results.

That is something we can look at next week. 

The sourcebrowser is using an lpeg-based lua script to create its search index, 
meaning
it is not impossible to extend it. :)

Best wishes,
Taco

— 
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://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] update old MP code

2022-09-01 Thread Taco Hoekwater via ntg-context


> On 1 Sep 2022, at 18:28, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Am 01.09.22 um 15:40 schrieb Taco Hoekwater:
>> Adding grouping makes sense:
>>> 
>>> def Moire(expr size)(text densities)=
>> begingroup
>> endgroup
>> As that at least makes it an expression instead of a statement list.
>> But also depthless() is never defined?
> 
> Oops, I forgot to copy that part (confusing source...)
> 
> It still doesn’t compile:

Missing definition of “width()”, from this line:

> 
>  xs := width(q)-width(p);

Adding that should do the trick.

Best wishes.

Taco

— 
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://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] update old MP code

2022-09-01 Thread Taco Hoekwater via ntg-context
Hi Hraban,

Adding grouping makes sense:
> 
> def Moire(expr size)(text densities)=

begingroup

>  save dn,a,b,k,labit,n,p,q,s,xs;
>  n := 32;
>  dn := 0;
>  for i := densities:
>d[incr dn] := abs(i);
>if i>1: labit[dn]:=1; fi
>  endfor
>  a := min(d[1],d[dn]);
>  b := max(d[1],d[dn]);
>  image(
>for i=-n upto n:
> draw (0,i*in/a)--(size,i*in/b);
>  %withpen pencircle scaled 3/5defaultthickness;
>endfor
>for i=1 upto dn:
>  k:=(a/d[i]-1)/(a/b-1);
>  if known labit[i]:
>string s; s:=decimal(d[i]); xs:=0;
>picture p,q; q := p := depthless(s);
>if i=dn:
>  q := depthless(s & "  lpi");
>  xs := width(q)-width(p);
>fi
>label.top(q, (k*size+1/2xs, n*in/a+1.5mm));
>  fi
>  draw (k*size, n*in/a+1.5mm)--(k*size, k[n*in/a,n*in/b]+.5mm);
>  draw (k*size, -n*in/a-1.5mm)--(k*size, -k[n*in/a,n*in/b]-.5mm);
>endfor
>  )

endgroup

> enddef;
> draw Moire(57.5mm)(200, 175, 150, 125, 100, 75);
> % ulshiftedto (142mm, 38.5mm);
> \stopreusableMPgraphic


As that at least makes it an expression instead of a statement list.

But also depthless() is never defined?

— 
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://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] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

2022-08-15 Thread Taco Hoekwater via ntg-context


> On 15 Aug 2022, at 13:02, amano.kenji via ntg-context  
> wrote:
> 
> Typesetting furigana over kanji characters is common for japanese educational 
> materials.

Yes, using the \ruby command. That used to require a module, but is now in the 
core. 

The wiki page on CJK fonts should probably be updated (new fonts, broken ftp 
links, etc.) 
but at least it mentions this:

  https://wiki.contextgarden.net/CJK_fonts

Best wishes,
Taco

— 
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://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] issue with lpath

2022-08-05 Thread Taco Hoekwater via ntg-context


> On 4 Aug 2022, at 18:39, Pablo Rodriguez via ntg-context  
> wrote:
> 
> On 8/4/22 17:32, Taco Hoekwater via ntg-context wrote:
>> [...]
>> PS This sort of confusing filtering is why I do most of my xml
>> processing from the lua end, where it is much clearer to me what is
>> what.
> Many thanks for clarifying the issue, Taco.
> 
> BTW, according to the last slide from
> https://meeting.contextgarden.net/2019/talks/02-xmlprocessing/02-xmlprocessing.pdf,
> you had plans to document how to deal with XML in proper Lua.
> 
> I wonder whether you are still interested in adding this information to
> the manual.

In theory, yes. In reality, life is too short, and it is on the bottom of an 
ever rising pile of things to do. :sadface

Best wishes,
Taco

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://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] issue with lpath

2022-08-04 Thread Taco Hoekwater via ntg-context


> On 4 Aug 2022, at 16:07, Hans Hagen  wrote:
> 
> On 8/4/2022 12:22 PM, Taco Hoekwater via ntg-context wrote:
>>> On 3 Aug 2022, at 15:54, Pablo Rodriguez via ntg-context 
>>>  wrote:
>>> 
>>> BTW, is there any way to rephrase "{h3 + blockquote}" in proper Lua?
>> I was wondering about that as well, and I really had no clue how to do that. 
>> Some
>> reading and studying later, I realised that there is a preceding-sibling:: 
>> axis.
>> That is not documented in xml-mkiv.pdf I think, but it inherited from xpath, 
>> and that means this works:
>>   \xmlsetsetup{#1}{blockquote/preceding-sibling::h3[-1]/} {xml:section}
>> “Take all blockquotes, then tests their immediate preceding siblings (index 
>> [-1]) that are h3."
>> But the CSS version is nicer. Still, both solutions fail on generic input.
>> Sorry, out of clues
> \startbuffer[demo]
> ...


That puts the whole  content inside the \section, and I don’t think that 
was the intent. I understood that Pablo only wants the “h3” node.

In the original request, the CSS “{h3 + blockquote}” matches a “blockquote” 
anyplace where it is immediately preceded by a “h3” (and nowhere else). 
After that, some trickery was needed to try and get back to the actual “h3”. 

My trick above with preceding-sibling above also gets the “h3” that is 
immediately followed by a “blockquote”, but it got easily
confused if there were multiple “h3” or “blockquote” objects in the input.

Best wishes,
Taco

PS This sort of confusing filtering is why I do most of my xml processing from 
the lua end, where it is much clearer to me what is what.

— 
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://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] issue with lpath

2022-08-04 Thread Taco Hoekwater via ntg-context


> On 3 Aug 2022, at 15:54, Pablo Rodriguez via ntg-context  
> wrote:
> 
> BTW, is there any way to rephrase "{h3 + blockquote}" in proper Lua?


I was wondering about that as well, and I really had no clue how to do that. 
Some
reading and studying later, I realised that there is a preceding-sibling:: 
axis. 

That is not documented in xml-mkiv.pdf I think, but it inherited from xpath, 
and that means this works:

  \xmlsetsetup{#1}{blockquote/preceding-sibling::h3[-1]/} {xml:section}

“Take all blockquotes, then tests their immediate preceding siblings (index 
[-1]) that are h3."

But the CSS version is nicer. Still, both solutions fail on generic input.

Sorry, out of clues


Best wishes,Taco


— 
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://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] issue with lpath

2022-08-03 Thread Taco Hoekwater via ntg-context


> On 2 Aug 2022, at 21:14, Pablo Rodriguez via ntg-context  
> wrote:
> 
> Dear list,
> 
> 
> I need an lpath to select the h3 node above, but only the one with "h3 +
> blockquote" as a CSS selector (which could be added the lpath "../h3"
> after).

Lpath supports CSS selectors between curly braces as parts, so simply:

  \xmlsetsetup{#1}{{h3 + blockquote}/../h3} {xml:section}

should do. The xml-mkiv.pdf manual has lots of other lpath examples as well.

Best wishes,
Taco

— 
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://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] How to switch off the numbering of a float in a CLDocument?

2022-07-21 Thread Taco Hoekwater via ntg-context


> On 21 Jul 2022, at 13:18, Willi Egger via ntg-context  
> wrote:
> 
> Hraban thank you for your answer.
> 
> I tried diffrent approaches in the meantime, however I am unable to get it 
> working.
> 
> What is wrong with this code? — The code woks a for the context.framedtext()
> 
> \setupexternalfigures[location={local,default}]
> 
> \startluacode
> 
>   function Foto_page() --thirddata
> 
>  context.startplacefigure({number="",textstyle="red",title="A Test"})
>context.externalfigure("{cow.pdf}",{width="0.5\\textwidth"}) 

It is subtle, but you need:

   context.externalfigure({“cow.pdf"},{width="0.5\\textwidth"}) 

A “lua table” becomes [] stuff, a “lua string” becomes {} stuff. Your original 
resulted in

  \externalfigure{{cow.pdf}}[width={0.5\textwidth}]

Best wishes,
Taco

PS \enabletrackers[context.*]


>  --context.framedtext(
>   --  {frame="on",style="\\bfd"},
>   --  "{This is a test}")
>  context.stopplacefigure()
>   end
>   
> \stopluacode
> 
> \define\Test{\ctxlua{Foto_page()}}
> 
> \starttext
>   \strut
>   \Test
> \stoptext
> 
> KR
> Willi
> 
>> On 18 Jul 2022, at 20:56, Henning Hraban Ramm via ntg-context 
>>  wrote:
>> 
>> Am 18.07.22 um 20:31 schrieb Willi Egger via ntg-context:
>>> Hi all,
>>> I wanted to place a figure in a cld. The example in the cld manual does not 
>>> reveal how to influence bahavior except for the caption.
>>> context.placefigure(
>>> “caption”,
>>>   function() context.externalfigure({i}, { width = "\\textwidth" } ) end )
>>> Can anybody enlighten me?
>> 
>> Just use
>> 
>> context.startplacefigure({ option = "some", otheroption = "thing" })
>> ...
>> context.stopplacefigure()
>> 
>> 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
> ___

— 
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://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] number of chapters

2022-07-20 Thread Taco Hoekwater via ntg-context


> On 20 Jul 2022, at 09:40, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Am 20.07.22 um 09:06 schrieb Henning Hraban Ramm via ntg-context:
>> Hi,
>> how do I access the current chapter number and the number of chapters 
>> (including appendixes; after the first run)?
>> I’d like to setup a chapter color like
>> \definecolor[ChapterColor][
>>   s=1,v=1,
>>   h=360*\namedstructurevariable{chapter}{number}/\numberofchapters,
>> ]
>> and use it for a thumb index...
>> (I can’t access the wiki ATM; downforeveryoneorjustme.com says it would be 
>> just me.)
> 
> Ok, I can access the wiki via Tor and found
> 
> \somenamedheadnumber{chapter}{current}
> \somenamedheadnumber{chapter}{last}

These are expandable

> 
> or
> 
> \someheadnumber[chapter][current]
> \someheadnumber[chapter][last]

These are not
> 
> What’s the difference?
> 
> And even if I use \definecolor within a setup, I get the same color for every 
> chapter – how and where must I delay expansion?
> 
> \usemodule[visual]
> 
> \startsetups[MyChapterSetup]
> \definecolor[MyChapterColor][h={360*\somenamedheadnumber{chapter}{current}/\somenamedheadnumber{chapter}{last}},s=1,v=1]

\definecolor[MyChapterColor][h={\the\numexpr 
360*\somenamedheadnumber{chapter}{current}/\somenamedheadnumber{chapter}{last}\relax},s=1,v=1]

Best wishes,
Taco

— 
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://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] What is going wrong with this use of --mode for switching language?

2022-07-08 Thread Taco Hoekwater via ntg-context


> On 8 Jul 2022, at 11:42, Gerben Wierda via ntg-context  
> wrote:
> 
> I have this minimal example:
> 
> \startmode[EL]
> \setuplanguage[el][patterns={el}]\mainlanguage[el]

That (‘el’) is a non-existent language, so it never becomes active.

Best wishes,
Taco

— 
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://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] "pragma-ade.com" is now a domain parking page

2022-07-01 Thread Taco Hoekwater via ntg-context


> On 1 Jul 2022, at 09:46, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Am 01.07.22 um 09:33 schrieb Hans Hagen via ntg-context:
>> On 7/1/2022 9:02 AM, Taco Hoekwater via ntg-context wrote:
>>> Well,
>>> 
>>> Hans had been complaining about networksolutions not allowing him to move 
>>> the domain away from them, so I guess this was to be expected.
>> indeed, and transfer is pending for ages now ... looks liek they don't like 
>> to transfer
>> make me wonder if we should just ditch that domain and stick to the nl one 
>> only, saves money too
> 
> Well, we must change a lot of dead links on the wiki now.
> 
> Taco, can you automate it? Otherwise I’ll start...

I do not know of a clean way to automate that. It may be possible, but then it 
is outside of my knowledge set. So yeah, by hand.

Best wishes,
Taco

— 
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 / 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] "pragma-ade.com" is now a domain parking page

2022-07-01 Thread Taco Hoekwater via ntg-context
asd-rc0001-cr101-be60-2.core.as33915.net (213.51.64.5)  168.494 ms  
> 169.741 ms  169.712 ms
>12  zl-rc0001-dr101-ae0-0.core.as9143.net (213.51.158.47)  178.211 ms  
> 178.195 ms  245.442 ms
>13  * * *
>14  * * *
>15  * * *
>16  * * *
>17  * * *
>18  * * *
>19  * * *
>20  * * *
>21  * * *
>22  * * *
>23  * * *
>24  * * *
>25  * * *
>26  * * *
>27  * * *
>28  * * *
>29  * * *
>30  * * *
> 
> 
> Can anyone else confirm this issue?
> 
> -- Max
> ___
> 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
> ___

— 
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 / 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] Graphviz and ConTeXt

2022-06-23 Thread Taco Hoekwater via ntg-context
Hi,

You could just convert these separately to pdf/svg/jpg/png and then load them 
as \externalfigure. 

You could also use the filter module to be able to take them inline into the 
ConTeXt code:


\usemodule[filter]

\define[1]\ReadFigure{\externalfigure[#1]}

\defineexternalfilter[graphviz]
  [cache=yes,
   readcommand=\ReadFigure,
   output={\externalfilterbasefile.pdf},
   filtercommand={dot -Tpdf -o "\externalfilterbasefile.pdf" 
"\externalfilterinputfile"}]
  
\starttext
\startTEXpage
\startgraphviz
digraph G {
main -> parse -> execute;
main -> init;
main -> cleanup;
execute -> make_string;
execute -> printf
init -> make_string;
main -> printf;
execute -> compare;
}
\stopgraphviz
\stopTEXpage
\stoptext


See the filter module documentation for more details about that.

Best wishes,
Taco

> On 23 Jun 2022, at 14:08, juh via ntg-context  wrote:
> 
> Dear all,
> 
> I have a legacy project that I shall convert to a new ConTeXt project. 
> 
> There are a lot of Graphviz dot-files. What shall I do with these? 
> 
> Any hints?
> juh
> -- 
> Autoren-Homepage: . http://literatur.hasecke.com
> Satiren & Essays: . http://www.sudelbuch.de
> Privater Blog:  http://www.hasecke.eu
> Netzliteratur-Projekt:  http://www.generationenprojekt.de
> 
> 
> ___
> 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
> ___

— 
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 / 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] Cyrillic UTF8 works, greek does not?

2022-06-22 Thread Taco Hoekwater via ntg-context


> On 22 Jun 2022, at 11:44, Gerben Wierda via ntg-context  
> wrote:
> 
> What am I doing wrong?


Either use   

  range={greekandcoptic,greekextended},

or

  preset=range:greek,

The presets are defined based on combinations of ranges. The preset 
"range:greek" is defined as:

\definefontfamilypreset
  [range:greek]
  [range={greekandcoptic,
  greekextended,
  ancientgreeknumbers}]

Best wishes,
Taco

— 
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 / 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] arm osx

2022-05-30 Thread Taco Hoekwater via ntg-context
Hi,


> On 29 May 2022, at 22:15, Keith McKay via ntg-context  
> wrote:
> 
> Hi Steffen
> 
> I have TeXshop setup on my mac mini M1 but I rarely use it.

I do not use TeXshop, but I did just upgrade to an M1 Mac, and I had some 
issues with
intel binaries 'sticking around’. Perhaps this page helps (esp. point 3)?

https://www.macrumors.com/how-to/tell-apps-optimized-for-m1-apple-silicon-macs/

Best wishes,
Taco

— 
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 / 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] Fwd: ConTeXt meeting registration

2022-05-25 Thread Taco Hoekwater via ntg-context
Hi all,

I just registered myself to attend the ConTeXt meeting in 2022. This is a good 
moment to remind you all of the
meeting (September 12-18, in Dreifelden  DE) and —especially— of the need to 
register if you plan to attend,
either in person or online!

There is no finished programme yet, so I can repeat the call for papers also. 
The theme for this meeting is

  digging deep

But, as in previous years, anything at all related to ConTeXt that you would 
like to share is an acceptable 
subject for a presentation, tutorial, discussion, Q session, demonstration, 
workshop, recital, sketch, or sermon.

More details are on the website:

  https://meeting.contextgarden.net/


Hoping to see many of you in Dreifelden,

Taco

> Begin forwarded message:
> 
> From: 16th ConTeXt Meeting Registration 
> Subject: t...@bittext.nl ConTeXt meeting registration
> Date: 25 May 2022 at 09:08:47 CEST
> To: cg-treasu...@contextgarden.net
> Reply-To: t...@bittext.nl
> 
> Hi Taco,
> 
> Taco Hoekwater has registered at 2022-05-25 09:08:47.


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





— 
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 / 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] ignore not closed tags in XML input

2022-05-16 Thread Taco Hoekwater via ntg-context


> On 16 May 2022, at 18:50, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> On 5/16/22 17:30, Hans van der Meer via ntg-context wrote:
>> Can't you use an editor with grep, searching for something like the
>> pattern ?
> 
> Many thanks for your reply, dr. van der Meer.
> 
> If I want to typeset the whole book
> (https://seumasjeltzz.github.io/LinguaeGraecaePerSeIllustrata/), I will
> have to download and sanitize over 20 HTML files.

Which can be done with a couple of command lines. Xmllint usually does a good
job of cleaning up dodgy html input:

  xmllint --html --xmlout  > 

(As good as can be expected from a program, anyway).

> It is really a pity that ConTeXt cannot totally ignore any given XML elements.

This statement is a little unfair: the problem is exactly that your input is 
NOT proper XML.
 
If it was proper XML, ConTeXt would not have problems with it. ConTeXt 
explicitly has
the capability to handle XML files, which your input simply is not. In fact, it 
is
sloppy HTML-esque data that modern webbrowsers happen to be able to handle more 
or less
correctly. It is not valid HTML either, because valid HTML has to be valid 
SGML, which your
input clearly is not.

That said, Tools like xmllint exist for this stuff. Just write a small batch 
driver file in 
some scripting language ((power)shell, lua, python, perl, etc.) to preprocess 
the HTML 
stuff into clean XML, and you should be fine.

Taco

— 
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 / 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] Can I use language as a mode (set on the command line) and simplify this?

2022-05-11 Thread Taco Hoekwater via ntg-context


> On 10 May 2022, at 23:40, Gerben Wierda via ntg-context  
> wrote:
> 
> Fix

>> I was wondering if this can be simplified, e.g. by setting language on the 
>> command line instead, enable a mode derived from a language set on the 
>> command line, 

The language settings trigger a system mode, see

https://wiki.contextgarden.net/Modes#System_modes

Best wishes,
Taco

— 
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 / 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] a cross-reference query

2022-05-10 Thread Taco Hoekwater via ntg-context


> On 10 May 2022, at 04:03, jbf via ntg-context  wrote:
> 
> Can anyone give me a hint as to what I might be doing wrong? I realise that 
> usually these references call on page numbers or section numbers, but I don't 
> want/need (or do I?) to use those. I simply the reader to be able to click on 
> a hyperlink which takes them to the referenced entry.

Check for duplicates (referenced definitions with the same key). That problem 
has hit me a number of times.

Best wishes,
Taco

— 
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 / 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] How to place "Content" and other chapter-level titles the same vertical distance from the top?

2022-05-09 Thread Taco Hoekwater via ntg-context
ings. But when calling \completecontent or a similar
>> title that won't get a number, because the number isn't placed, it is 
>> vertically
>> higher on the page, but I need it to be printed the same height, as it it 
>> had an
>> invisible number.
>> 
>> I've tried adding strut (the code has it in two places), but don't know if 
>> I've
>> used it appropriately, and it didn't solve the problem.
>> 
>> --Joel
> ___
> 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
> ___

— 
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 / 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] Citeproc-lua

2022-05-06 Thread Taco Hoekwater via ntg-context
Hi,

I had a quick look at this and it seems very extensible if-not-quite 
ConTeXt-ready right away.

On the input side, it reads a LaTeX .aux file to parse things like options, 
databases, and requested citations.
For this, it uses a dedicated “citeproc” lua script that should be easy to 
modify/copy for someone who knows what
is actually in the ConTeXt .tuc file.

On the output side, it uses a lookup table to generate the desired markup (in 
citeproc-formats.lua). Right now,
there are definitions provided for HTML and LaTeX, but that is very simple to 
extend.

There is a LaTeX package for the integration (making sure the right commands 
appear in the aux file, 
option processing, et cetera), and that file I do not understand *at all*. It 
seems to be completely isolated 
from the core citeproc processing, though.

Very promising stuff, I think. 

But: I personally do not understand how to do the integration with ConTeXt’s 
new biblio system. I only understand
half of what ConTeXt does these days, and much less of what the LaTeX package 
is trying to achieve i.r.t. options.

Best wishes,
Taco

> On 3 May 2022, at 22:00, Denis Maier via ntg-context  
> wrote:
> 
> Hi,
> 
> I just came across this: https://github.com/zepinglee/citeproc-lua
> Thats’s an lua implemenation of the CSL language targeting LaTeX.
> I don’t know if the processor itself contains any LaTeX specific code, but it 
> looks like the integration basically happens here 
> :https://github.com/zepinglee/citeproc-lua/blob/main/latex/citation-style-language.sty
> So, at least in theory, shouldn’t it be possible to make this workable also 
> with context?
> 
> Best,
> Denis 
> ___
> 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
> ___

Taco Hoekwater
Elvenkind BV




___
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] XML: calculations on attribute values before output

2022-05-05 Thread Taco Hoekwater via ntg-context


> On 4 May 2022, at 22:10, Duncan Hothersall via ntg-context 
>  wrote:
> 
> Hi.
> 
> I'm processing an XML table and need to set a row span. Because we use a 
> variant of the CALS table model, spans are defined by an attribute saying how 
> many *additional* rows should be spanned, as opposed to how many *in total*. 
> So to translate this into TABLE \bTD[nr=X] syntax I need to add 1.
> 
> I'm guessing this is very easily doable (in lua?) but I've tried various 
> permutations and can't work it out. If anyone could give me a pointer that 
> would be great.
> 
> (In reality I'm going to need to handle lots of other conversions of 
> attribute values into \bTD[...] commands, so if there's a generalised way of 
> doing that sort of thing, or even better if someone has already tackled CALS 
> tables in this way, that would also be great!)

Not CALS, but I do a lot of HTML table processing. I find it all much easier on 
the lua side, because there the 
attributes are just in a table entry of the argument node t ( t.at ):

set up a lua function in the setups:

\startxmlsetups xml:demo:base
 \xmlsetsetup{#1}{*}{xml:demo:*}
 \xmlsetfunction {\xmldocument}{entry}{userdata.xmlfunctions.entry}
\stopxmlsetups

and then add this lua code:

\startluacode
userdata.xmlfunctions = {}
function userdata.xmlfunctions.entry (t)
  local rows = (t.at.morerows or 1) + 1
  context.bTD({nr=rows})
  lxml.flush(t) 
  context.eTD()
end
\stopluacode

All of the tex-side commands also exist in lua, in the lxml and/or xml table, 
e.g.:

direct output flushing: 
  lxml.flush(t)
  lxml.all(t, ‘entry’)

filter for processing:
  for b in xml.collected(lxml.getid(t),'../row/entry') do … end


(those are the ones I use a lot, there are many more)

Best wishes,
Taco
___
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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2022-05-03 Thread Taco Hoekwater via ntg-context
Hi,

So this cron forwarding actually works ;)



> On 2 May 2022, at 17:01, Cron Daemon via ntg-context  
> wrote:
> 
> receiving incremental file list
> ./
> ctan.lsr
> document-2.htm
> download-1.htm
> download-2.htm
> install.htm
> logo-ade.png
> logo-cts.png
> logo-pod.png
> rss.xml
> show-fil.pdf
> context/latest/
> context/latest/cont-mpd.zip
> context/latest/cont-ppc.zip
> context/latest/cont-sci.zip
> context/latest/cont-tmf.zip
> 
> sent 90,352 bytes  received 18,536,958 bytes  3,386,783.64 bytes/sec
> total size is 456,819,434  speedup is 24.52

That block above means that Hans has uploaded new files to the pragma website.
That is not exactly the same thing as the packaged distribution, so bear in mind
that you probably (?) have to allow for a little bit of delay before running the
installation updater.

> 
> Running archiver:
> 
> New dir: /var/www/aanhet.net/context//htdocs/archives/context-2022-05-02.17
> 137316935 
> /var/www/aanhet.net/context//htdocs/archives/context-2022-05-02.17/latest
> 126745317 
> /var/www/aanhet.net/context//htdocs/archives/context-2022-05-02.17/current
> 18956262  
> /var/www/aanhet.net/context//htdocs/archives/context-2022-05-02.17/alpha
> 126707516 
> /var/www/aanhet.net/context//htdocs/archives/context-2022-05-02.17/beta
> 409730126 
> /var/www/aanhet.net/context//htdocs/archives/context-2022-05-02.17
> 409730126 total

This last bit is just my archiving code reporting local space requirements. I 
keep a fairly 
large collection of older downloads as well:

  http://context.aanhet.net/archives/

You may have to hunt backward in time to find a specific zip, because I delete 
duplicates 
occasionally, only keeping the oldest/first (Hans nowadays mostly updates 
‘latest’, with a
‘current’ now and then. ‘alpha’ and ‘beta’ are typically don’t change at all).

Also, the site is still plain http. I am not going to install https right now.

Best wishes,
Taco

— 
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 / 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] Need some hints to fix my standalon installation

2022-04-20 Thread Taco Hoekwater via ntg-context
Hi,

I have an rsync cron job running each hour that alerts me if there is a new 
upload. If nobody objects, I could direct the cron notification email to the 
list?

Taco

> On 20 Apr 2022, at 19:41, Pablo Rodriguez via ntg-context 
>  wrote:
> 
> On 4/20/22 19:22, Christoph Hintermüller via ntg-context wrote:
>> 
>> That's fine. As soon as post that update is ready for pulling I will
>> pull.
>> Till then i can wait.
> 
> Hi Christoph,
> 
> to check when there is a new release I use:
> 
> curl -I https://lmtx.pragma-ade.com/install-lmtx/texmf-context.zip 2>&1
> | grep -i Last-Modified
> 
> Just in case it might help you,
> 
> Pablo
> ___
> 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] Fwd: \vfill doesn't work in this example

2022-04-11 Thread Taco Hoekwater via ntg-context
Hi,

Message below forwarded on behalf of Dalyoung , who has problems submitting 
messages.

Best wishes,
Taco

> Begin forwarded message:

> 
> Hi,
> 
> To add the same vertical space in column mode,
> I usually use \vfill as in the following sample before.
> But this example doen’t add spaces after first item.
> How to locate the two subitems evenly spaced in vertically?
> 
> Thank you for reading.
> 
> Best regards,
> 
> Dalyoung
> 
> 
> %%
> \starttext
> \startcolumns[n=2]
> \startitemize[n]
> \item 111
>   \startitemize[a]
>   \item 1-1
>   \vfill
>   \item 1-2
>   \vfill
>   \stopitemize
> 
> \column
> 
> \item 222
>   \startitemize[a]
>   \item 2-1
>   \vfil
>   \item 2-2
>   \vfil
>   \stopitemize
> 
> \column
> 
> \stopitemize
> \stopcolumns
> \stoptext
> 
>> 2022. 4. 8. 오후 6:33, Taco Hoekwater > <mailto:t...@bittext.nl>> 작성:
>> 
>> Hi Dalyoung,
>> 
>> 
>>>  Forwarded Message 
>>> Subject:Re: \vfill doesn't work in this example
>>> Date:   Fri, 8 Apr 2022 15:00:21 +0900
>>> From:   Jeong Dal mailto:hak...@icloud.com>>
>>> To: ntg-context-ow...@ntg.nl <mailto:ntg-context-ow...@ntg.nl>
>>> 
>>> Hi,
>>> 
>>> I received the following mail.
>>> But I think that my message is rejected in error.
>>> 
>>> I have an account in this list for long time.
>>> 
>>> The email address of this mail may cause the error.
>>> I used email address given from Mac.com <http://mac.com/> <http://Mac.com 
>>> <http://mac.com/>>.
>>> 
>>> hak...@mac.com <mailto:hak...@mac.com> <mailto:hak...@mac.com 
>>> <mailto:hak...@mac.com>>, hak...@me.com 
>>> <mailto:hak...@me.com><mailto:hak...@me.com <mailto:hak...@me.com>>, and 
>>> hak...@icloud.com <mailto:hak...@icloud.com><mailto:hak...@icloud.com 
>>> <mailto:hak...@icloud.com>> are actually the same address.
>> 
>> Well, the mailing list did not know that. Only hak...@mac.com 
>> <mailto:hak...@mac.com> was actually subscribed. I have now added the two 
>> aliases.
>> 
>> Best wishes,
>> Taco
>> 
>> — 
>> Taco Hoekwater  E: t...@bittext.nl <mailto:t...@bittext.nl>
>> genderfluid (all pronouns)
> 

— 
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 / 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] Nested $$ in inline math

2021-12-13 Thread Taco Hoekwater via ntg-context


> On 13 Dec 2021, at 16:15, Jack Hill via ntg-context  
> wrote:
> 
> Dear list,
> 
> I was playing around and found that nesting $$s inside of \m blocks typesets 
> the code as text.
> I can't find anything about this on the wiki or in the math-mkiv manual, so 
> I'm asking whether this is supported behaviour or just a bug?

I would say that this is unsupported expected behaviour ;) 

It is better not to use $ at all (except when using it as a dollar sign when 
\asciimode is active).

> 
> \starttext
> % All the same
> \mathematics{math $text here$ math} \\
> \math{math $text here$ math} \\
> \m{math $text here$ math} \\
> \m{math \text{text here} math} \\

A bit over-precise maybe, but while the first three are the same, the last line 
is 
actually very subtly different. 

The first three lines are essentially this in TeX82 :

  $math $text here$ math\hfill\break

while that last line is 

  $math \hbox{text here} math\hfill\break

Best wishes,
Taco

— 
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 / 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] upload ... new feature

2021-12-10 Thread Taco Hoekwater via ntg-context


> On 10 Dec 2021, at 11:46, Hans Hagen via ntg-context  
> wrote:
> 
> Hi,
> 
> This time the lmtx upload has a (for some maybe) interesting new features: 
> runtime pdf encryption.
> 
> 
> I would be surprised if the native apple viewer works but I can't test that.

Apple Preview works without any problems, with a quick test.

It forces a popup dialog for “user password” on opening when that is set, and 
with 

  context .. --permissions="-print”

it shows an "owner password" dialog before allowing to print

— 
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 / 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] Bad linebreak in figure caption

2021-12-03 Thread Taco Hoekwater via ntg-context


> On 2 Dec 2021, at 19:37, Marco Patzer via ntg-context  
> wrote:
> 
> On Mon, 29 Nov 2021 16:44:07 +0100
> Marco Patzer via ntg-context  wrote:
> 
>> Why does ConTeXt not break the line between "unnecessary" and "FOO"?
> 
> Any ideas how to fix this?

Captions have their own alignment setting:

 \setupcaption[figure][align={verytolerant,stretch}]

Best wishes,
Taco


___
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] double underbars

2021-11-30 Thread Taco Hoekwater via ntg-context


> On 30 Nov 2021, at 14:38, Denis Maier via ntg-context  
> wrote:
> 
> Thanks, Taco. Good to know. Although it's not what I wanted to hear, of 
> course...
> 
> I was thinking using mp to draw the combination could be solution, but 
> unfortunately I don't know metafun yet.
> 
> If my understanding of https://source.contextgarden.net/node-rul.mkiv is 
> correct, it should be possible to build upon the defintion of 
> rules:under:dots (l. 327) Any hints how I could get this started?

Yes, that is the right part to get started with. You could just copy the whole 
\startuseMPgraphic and rename it for editing (to let’s say 
rules:under:bardots), then do

  \definebar[underbardot][undergraphic][mp=rules:under:bardots]

and play with the mp until you are happy with the output.

But the problem is that you have to create an “underbardot" that contains both 
the bar and the dots, to fix the non-nesting problem. It is then quite hard to 
get that definition to align properly with any enclosing “underbar” (I tried 
something like that a while ago and basically gave up. I did not want to spend 
a whole of time on it so I just told the client “computer says no").


> Another question: what do you mean with a dy-shift version?

Nested bars have a parameter ‘dy’ which controls the vertical shifts needed to 
make sure that they do not overlap. Text backgrounds do not have that option at 
all.

> 
> Best,
> Denis
> 
>> -Ursprüngliche Nachricht-
>> Von: Taco Hoekwater 
>> Gesendet: Dienstag, 30. November 2021 14:19
>> An: mailing list for ConTeXt users 
>> Cc: Maier, Denis Christian (UB) 
>> Betreff: Re: [NTG-context] double underbars
>> 
>> 
>> 
>>> On 30 Nov 2021, at 12:06, Denis Maier via ntg-context > cont...@ntg.nl> wrote:
>>> 
>>> Hi,
>>> 
>>> for a current project I’ll need different variants of underbars.
>>> 
>>> - A normal underbar
>>> - A dotted underbar
>>> - A combination of both
>>> 
>>> Is there a way to combine them? I was hoping to have the dotted variant
>> above the normal bar.
>> 
>> I would like to have this type of “complete” bar nesting as well.
>> 
>> As it stands, you can nest \underbars inside \underbars and \overstrikes
>> inside \overstrikes and \overbars inside \overbars, but no other
>> combinations work. Interoperability between these (as well as \underdot,
>> \underdash, \underrandom ...) would be really cool.
>> 
>> Either with \bar or a nestable dy-shift version of textbackgrounds would
>> be really handy sometimes. :)
>> 
>> 
>> 
>>> 
>>> This is not working
>>> 
>>> %%%
>>> \starttext
>>> 
>>> \underbar{asdf}
>>> 
>>> \underdot{asdf}
>>> 
>>> \underbar{\underdot{asdf}}
>>> 
>>> \stoptext
>>> %%%
>>> 
>>> 
>>> Best,
>>> Denis
>>> 
>>> 
>> __
>> ____
>>> _ 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
>>> 
>> __
>> 
>>> _
>> 
>> —
>> 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 / 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
> ___

— 
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 / 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] double underbars

2021-11-30 Thread Taco Hoekwater via ntg-context


> On 30 Nov 2021, at 12:06, Denis Maier via ntg-context  
> wrote:
> 
> Hi,
>  
> for a current project I’ll need different variants of underbars.
>  
> - A normal underbar
> - A dotted underbar
> - A combination of both
>  
> Is there a way to combine them? I was hoping to have the dotted variant above 
> the normal bar.

I would like to have this type of “complete” bar nesting as well. 

As it stands, you can nest \underbars inside \underbars and \overstrikes inside 
\overstrikes and \overbars inside \overbars, but no other combinations work. 
Interoperability between these (as well as \underdot, \underdash, \underrandom 
...) would be really cool.

Either with \bar or a nestable dy-shift version of textbackgrounds would be 
really handy sometimes. :)



>  
> This is not working
>  
> %%%
> \starttext
>  
> \underbar{asdf}
>  
> \underdot{asdf}
>  
> \underbar{\underdot{asdf}}
>  
> \stoptext
> %%%
>  
>  
> Best,
> Denis
>  
> ___
> 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
> ___

— 
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 / 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 \head inside \itemize

2021-11-22 Thread Taco Hoekwater via ntg-context


> On 22 Nov 2021, at 14:15, Jean-Philippe Rey via ntg-context 
>  wrote:
> 
> Dear list,
> 
> The following code worked perfectly well with ConTeXt  ver: 2021.01.05 10:45 
> LMTX
> but produces an error with the current LMTX version (at least since ConTeXt  
> ver: 2021.09.26 17:00 LMTX).
> Adding an explicit \par at the end of the \head line allows the example to 
> work.

It seems like the newest LMTX versions don’t handle implicit \par (empty lines) 
as argument 
delimiter any more, the argument has to be terminated by the explicit string 
“\par", just 
like any other argument delimiter. 

This is definitely a change, but I would vote for that change to stay. ;)

Best wishes,
Taco

— 
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 / 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] Can modes be used for content control?

2021-11-17 Thread Taco Hoekwater via ntg-context
Hi Idris,

I think Hans was trying to point you to the blocks mechanism. Blocks *do* nest:

\defineblock[sectionblock]
\defineblock[myblock]

\startmode[variantone]
\keepblocks[sectionblock]
\keepblocks[myblock]
\stopmode

\startmode[varianttwo]
\keepblocks[sectionblock]
\stopmode

\starttext
\beginsectionblock
\section{A to B}
\beginmyblock
A is for Amy, who fell down the stairs.
\endmyblock
\beginmyblock
B is for Basil, assaulted by bears.
\endmyblock
\endsectionblock

\stoptext



— 
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 / 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] Footnotes in margins

2021-11-16 Thread Taco Hoekwater via ntg-context
Hi,

Like Hraban said, inserts are generally tricky and they tend to disappear when 
used inside
other elements like floating objects / boxes / tables. However, ConTeXt has an 
easy way out
at least for your case:

\starttext
\startpostponingnotes
\inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.}
\stoppostponingnotes
\stoptext

Best wishes,
Taco

> On 16 Nov 2021, at 12:57, Marcus Vinicius Mesquita via ntg-context 
>  wrote:
> 
> Dear list,
> 
> When running the MWE below, the first footnote does not appear.
> What am I missing?
> 
> \starttext
> \inmargin{Foo\footnote{Foo 1.}}Foo\footnote{Foo 2.}
> \stoptext

— 
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 / 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] \startbodymatter forcing new page in document

2021-11-15 Thread Taco Hoekwater via ntg-context


> On 15 Nov 2021, at 15:07, A A via ntg-context  wrote:
> 
> Dear All,
> 
> The following code generates a title and some fake text:
> 
> \setuppagenumbering[location=right]
> 
> \usemodule[visual]
> 
> \usebtxdataset[bibliography.bib]
> \starttext
> \title{test}
> \fakewords{1000}{1200}
> 
> \stoptext
> 
> The following code does the same, but wraps the fakewords in a bodymatter 
> environment:
> 
> \setuppagenumbering[location=right]
> 
> \usemodule[visual]
> 
> \usebtxdataset[bibliography.bib]
> \starttext
> \title{test}
> \startbodymatter
> \fakewords{1000}{1200}
> \stopbodymatter
> 
> \stoptext
> 
> 
> In the first case, the title remains on the same page as the fake text. In 
> the second case, a new page is forced after the title. Why does this occur? 

\startbodymatter starts a sectionblock (the “bodypart” block, to be exact) and
by default these blocks all switch to a ‘right’ page. Add this in your preamble 
to
get rid of the page switch:

\setupsectionblock[bodypart][page=no]



> 
> Regards,
> 
> Amine
> 
> ___
> 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
> ___

— 
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 / 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] check installed program using Lua

2021-11-01 Thread Taco Hoekwater via ntg-context


> On 1 Nov 2021, at 14:26, Pablo Rodriguez via ntg-context  
> wrote:
> 
> Dear list,
> 
> is there a way if a program is installed on the computer using Lua.
> 
> I have the following sample:
> 
>  \starttext
>  \startluacode
>  filename = tex.jobname .. ".pdf"
>  os.exec("dir " .. filename)
>  \stopluacode
>  \stoptext
> 
> Is there a way to wrap os.exec() in the sample so that it only runs if
> "dir" is available?

if os.which(‘dir’) then
  ...
end

But note that os.which() may be unreliable in various cases (like it will fail 
for shell/command interpreter builtins, in cron jobs, in special scripted 
environments, and may incorrectly succeed for disabled/forbidden commands), as 
it just runs through the PATH environment variable to check for executable file 
existence. 

Often times, it is better to just try to run the command to see if that 
produces satisfactory results.

Best wishes,
taco

— 
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 / 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] Wiki's ConTeXt updated

2021-10-29 Thread Taco Hoekwater via ntg-context
Hi,

Since yesterday  wiki.contextgarden.net, live.contextgarden.net, and 
source.contextgarden.net all use

  ConTeXt 2021.10.28 10:19 LMTX

as the installed ConTeXt.

I have also tried to reset all the “” output images so that they will 
be automatically
regenerated with this new ConTeXt, but sometimes that reset does not work 
properly, and the wiki 
has to be ‘helped' manually. 

If you see a ‘broken image’ icon (or no output at all) from a “” 
demonstration block, do this:

* right click on the ‘Edit’ link of the page so it opens in a new tab,
* go to the new tab and press ’Show preview’,
* close the tab.

The ’Show preview' will force the wiki to refresh the cached images. ’Save 
changes’ is not needed.

Best wishes,
Taco

— 
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 / 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] The certificate of the mailman site has expired

2021-10-22 Thread Taco Hoekwater via ntg-context


> On 22 Oct 2021, at 02:21, Gerben Wierda via ntg-context  
> wrote:
> 
> Just to let you know: The certificate of the mailman site has expired

Which one exactly? 

Both https://lists.contextgarden.net/ and https://mailman.ntg.nl/ seem fine to 
me

Best wishes,
Taco

— 
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 / 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] Clickable url problem with \useurl and \url

2021-10-12 Thread Taco Hoekwater via ntg-context
Hi,

> On 12 Oct 2021, at 04:30, Rik Kabel via ntg-context  
> wrote:
> 
> Hello List,
> 
> I notice an inconsistency in the clickable area when using \useurl. With the 
> following example, both the \from and the \url are clickable in some lines 
> (as noted iin the value of \from) but in others, the \from is clickable but 
> not the \url.
> 
> It does seem sensitive to the urlL, but I cannot see a pattern.

It is the pdf viewer program that automatically interprets the \url-produced 
text and 'invents' a link, it is not
ConTeXt itself. The exact rules may therefore vary depending on the pdf viewer 
you use. 

In Apple's Preview, all items are in fact clickable. But only \from produces 
actual pdf hyperlink annotations.

> Should I use something other than \url[earlXX] here to get the clickable 
> literal url from useurl?

This, maybe

\goto{\url[earlLH]}[url(earlLH)]

(perhaps wrapped in a short macro)

Best wishes,
Taco

— 
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 / 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] TLS Certificate Expired for the Wiki

2021-10-12 Thread Taco Hoekwater via ntg-context


> On 12 Oct 2021, at 08:41, Ramkumar KB via ntg-context  
> wrote:
> 
> Hello,
> 
> The TLS certificate for the Context wiki expired yesterday - valid only upto 
> 12-October-2021.

I’ll fix that in a bit.

> 
> Just an alert as Chrome now pops up the "Unsafe" alerts.
> 
> Thank you,
> 
> best regards,
> Ramkumar 
> ___
> 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
> ___

— 
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 / 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] MkIV missing?

2021-10-04 Thread Taco Hoekwater via ntg-context
Hi,

Here is what I assume has happened:

Hans gave LMTX its own "luametatex-cache” directory (around August 20). 
Previously, the cache for LMTX still used files under luatex-cache, just like 
MKIV. But since that change, the “context -—generate” call no longer updates 
files in luatex-cache, only in luametatex-cache. 


That is not a big problem unless something happens to clear any existing cache 
in that folder (like a re-install from scratch, say). 

Normally, one runs “context —-generate” to fix the cache and “context —-luatex” 
to run luatex Combined, that would be 
  “context —-generate —-luatex”. 
But the problem is that luatex cannot find “mtx-context.lua” exactly because of 
the missing cache that we are actually trying to create with that command line. 
Missing “mtx-context.lua” is usually fixed by running the more basic “mtxrun 
—generate”.

However, “mtxrun -—generate”  does not currently support a "-—luatex” argument, 
so the only way I know of right now to get the luatex-cache restored|updated is 
to run the command below.

(Incidentally, this sort of issue is why the core command is not “context 
-—generate” but “mtxrun -—generate”. It is unfortunate that that does not help 
in this case).

Best wishes,
Taco

> On 4 Oct 2021, at 15:33, Taco Hoekwater via ntg-context  
> wrote:
> 
> We are busy with this off-list.
> 
> If it is urgent: 
> 
> luatex --luaonly ~/lmtx/tex/texmf-osx-64/bin/mtxrun.lua --generate
> 
> fixed it for me (you’ll need to adjust the path, of course)
> 
> Best wishes,
> Taco
> 
>> On 4 Oct 2021, at 15:28, Marcus Vinicius Mesquita via ntg-context 
>>  wrote:
>> 
>> Same problem here, on a linux64, context current version: 2021.09.26 17:00
>> 
>> Greetings
>> 
>> Marcus Vinicius
>> 
>> On Mon, Oct 4, 2021 at 8:55 AM Henning Hraban Ramm via ntg-context 
>>  wrote:
>> 
>>> Am 04.10.2021 um 13:06 schrieb Hans Hagen :
>>> 
>>> On 10/4/2021 12:39 PM, Henning Hraban Ramm via ntg-context wrote:
>>>> Hi,
>>>> since a while, I can’t run MkIV any more, even after several runs of 
>>>> install.sh (and mtxrun --generate, of course).

— 
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 / 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] MkIV missing?

2021-10-04 Thread Taco Hoekwater via ntg-context
We are busy with this off-list.

If it is urgent: 

 luatex --luaonly ~/lmtx/tex/texmf-osx-64/bin/mtxrun.lua --generate

fixed it for me (you’ll need to adjust the path, of course)

Best wishes,
Taco

> On 4 Oct 2021, at 15:28, Marcus Vinicius Mesquita via ntg-context 
>  wrote:
> 
> Same problem here, on a linux64, context current version: 2021.09.26 17:00
> 
> Greetings
> 
> Marcus Vinicius
> 
> On Mon, Oct 4, 2021 at 8:55 AM Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> > Am 04.10.2021 um 13:06 schrieb Hans Hagen :
> > 
> > On 10/4/2021 12:39 PM, Henning Hraban Ramm via ntg-context wrote:
> >> Hi,
> >> since a while, I can’t run MkIV any more, even after several runs of 
> >> install.sh (and mtxrun --generate, of course).
> >> It’s the same on my Mac and my Linux laptop (of course the bin dir is 
> >> different on the latter):
> >> $ context --version
> >> mtx-context | ConTeXt Process Management 1.04
> >> mtx-context |
> >> mtx-context | main context file: 
> >> /Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> >> mtx-context | current version: 2021.09.26 17:00
> >> mtx-context | main context file: 
> >> /Users/hraban/lmtx/tex/texmf-context/tex/context/base/mkxl/context.mkxl
> >> mtx-context | current version: 2021.09.26 17:00
> >> $ context --version --luatex
> >> mtx-context | redirect luametatex -> luatex: luatex --luaonly 
> >> "/Users/hraban/lmtx/tex/texmf-osx-64/bin/mtxrun.lua" --script mtx-context 
> >> --version --luatex --redirected
> >> mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
> >> $ which context
> >> /Users/hraban/lmtx/tex/texmf-osx-64/bin/context
> >> $ which luatex
> >> /Users/hraban/lmtx/tex/texmf-osx-64/bin/luatex
> >> $ luatex --version
> >> This is LuaTeX, Version 1.13.0 (TeX Live 2021)
> >> ...
> >> $ mtxrun --version
> >> mtxrun  | ConTeXt TDS Runner Tool 1.32
> >> mtxrun  | source path
> >> I thought that was related to the server/provider move, but I guess it 
> >> isn’t.
> >> It’s a bit annoying that install.sh leaves ~/lmtx/bin in the PATH, so that 
> >> a call to mtxrun can’t find any configuration.
> > works here ... maybe a --generate issue?
> 
> I re-ran the install script with a shell ("sh install.sh" instead just ". 
> install.sh"), but that doesn’t change the "unknown script" issue.
> 
> "mtxrun --generate" seems to work without problems; or do you see something 
> suspicious in the attached log?
> 
> 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
> ___
> 
> 
> -- 
> Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo 
> nem seus membros, por ser descanso da alma, primavera do coração, distração 
> do aflito, entretenimento do solitário, e viático do viajante.
> 
> Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
> _______
> 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
> ___

— 
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 / 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] MkIV missing?

2021-10-04 Thread Taco Hoekwater via ntg-context


> On 4 Oct 2021, at 12:39, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> I thought that was related to the server/provider move, but I guess it isn’t.
> 
> It’s a bit annoying that install.sh leaves ~/lmtx/bin in the PATH, so that a 
> call to mtxrun can’t find any configuration.

That is why I always run “sh install.sh” instead of executing the script 
directly.

Best wishes,
Taco

— 
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 / 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] website

2021-09-29 Thread Taco Hoekwater via ntg-context
Hi,

There is also a mirror of the website at http://context.aanhet.net

Best wishes,
Taco

> On 28 Sep 2021, at 23:34, Hans Hagen via ntg-context  
> wrote:
> 
> Hi,
> 
> Due to domain transfer issues (provider quits services) there is the 
> possibility that the coming days the pragma-ade.com address fails.
> The pragma-ade.nl and other addresses are okay, If all works well the 
> installer handles fallbacks. Eventually the context garden will also have the 
> files.
> 
> 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
___


Re: [NTG-context] Test for displaying a header

2021-08-26 Thread Taco Hoekwater via ntg-context

Hi,

> On 26 Aug 2021, at 16:07, Fabrice Couvreur via ntg-context 
>  wrote:
> 
> Hi, 
> I know I asked the question a few years ago, but I don't remember ! 
> The idea is to test whether the document contains only one page or not. 

Perhaps not the nicest solution, but this works:

\doifvalueelse
  {\lastpage}
  {1}
  {\message{true}}
  {\message{false}}

> If it contains only one page, the header is enabled. 
> If it contains several pages, the header is enabled only on the first page 
> but not on the others. 
> 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
> ___

— 
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 / 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] Indexing redux

2021-08-26 Thread Taco Hoekwater via ntg-context
Hi Rik,

> On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context  
> wrote:
> 
> List,
> 
> I am trying to create an index with both "see" and "see also" cross-reference 
> entries.[1] At this point, ConTeXt provides basic support for "see" entries 
> via the \seeREGISTER command (it does not properly support references to 
> sub-entries) and it provides no support at all for "see also" entries.
> 
> Can somebody suggest a way to generate these entries? Perhaps a way of 
> inserting entries into the index before it is formatted, in the manner of 
> \writetolist or \writebetweenlist? (MkII has \writetoregister, but that did 
> not carry forward and I do not know if it would have helped here.)


Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best 
bet is to create an
actual functional example along with an explanation of what you want the 
typeset result to look 
like in the cases where it is not doing what you want.

Generally, explicit examples / test files are the best way to get replies to 
questions 
(either by Hans or anyone else).

Best wishes,
Taco

>  
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 / 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] Control of Titles appearing in \completelistoftables and \completelistoffigures

2021-08-25 Thread Taco Hoekwater via ntg-context
Hi,

There is \startplacefigure / \startplacetable , which has a ‘list’ key

 https://wiki.contextgarden.net/Command/_startplacefloat

Best wishes,
Taco

> On 25 Aug 2021, at 05:20, Richard Mahoney via ntg-context 
>  wrote:
> 
> List,
> 
> I've been wondering if there is some syntax that one can use in:
> 
> \placetable or \placefigure
> 
> to control the Table of Figure Title appearing in:
> 
> \completelistoftables and \completelistoffigures
> 
> 
> At the moment one can do this for the output of:
> 
> \completecontent
> 
> with something such as the following:
> 
> \startsection[title={Title in body},list={Title in contents}]
> 
> 
> Such a thing would be *extremely* useful for a current 
> publication. :)
> 
> 
> Best, Richard
> 
> 
> 
> -- 
> T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
> IM https://t.me/rmahoney  W https://indica-et-buddhica.org/
> 
> Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
> ___
> 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
> ___

Taco Hoekwater
Elvenkind BV






— 
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 / 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] lua

2021-08-17 Thread Taco Hoekwater via ntg-context
Hi Hans,

> On 17 Aug 2021, at 16:39, Hans van der Meer via ntg-context 
>  wrote:
> 
> I am still interested in this luacondition 733 allthough the culprit has been 
> spotted. Very nasty typo and hard to spot fo me. 

The “luacondition 733” is the \ifxmlatt . You get these numbers because the 
command is
defined using lua ‘interfaces.implement’ (lxml-ini.lua) instead of directly as 
a TeX conditional.

And yes indeed, the new lua-defined commands are hard to derive from the log 
information
(for the other Hans: is this reporting not controlled via ‘public=true’ ? ).

Best wishes,
Taco

> Shudder and enjoy:
> 
> \ifxmlatt{#1}{regime}{xml}\let\Flush\ModuleFlushXML\else\let\FlushModuleFlushTEX\fi
> instead of
> \ifxmlatt{#1}{regime}{xml}\let\Flush\ModuleFlushXML\else\let\FlushModule\FlushTEX\fi
> 
> dr. Hans van der Meer
> 
> 
>> On 17 Aug 2021, at 15:49, Hans van der Meer via ntg-context 
>>  wrote:
>> 
>> Where is this message on luacondition 733 coming from? I would be glad to 
>> get rid of it. The message does not pinpoint the problem location enough for 
>> me to find its cause.
>> 
>> close source> level 2, order 7, name './modules-docs.tex'
>> close source> level 1, order 7, name 'cont-yes.mkiv'
>> (\end occurred when luacondition 733 on line 8 was incomplete)
>> 
>> 
>> dr. Hans van der Meer
>> 
>> 
>> ___
>> 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
> ___

— 
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 / 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] 15th International ConTeXt Meeting (registration closes Aug 22)

2021-08-13 Thread Taco Hoekwater via ntg-context
Hi all,

There is still room for some extra participants for the ConTeXt meeting in 
Bassenge, 
Belgium from Sept 20 to Sept 25. Despite the still somewhat lingering situation 
wrt
COVID-19, we are now certain that the meeting can and will in fact take place in
person. Hurrah!

Even if we still have room by then, registration will close on Aug 22, because 
by 
that time we need to make final arrangements for T-shirt printing and catering. 
So if you are still on the fence about attending, do not wait too long!


Also remember that it is possible for ConTeXt Group members to attend 
online-only
for free. That is less than ideal because you cannot join us for a drink and a 
chat,
but it gives you bragging rights for attending, and you will get a T-shirt as 
well !
(if you register before Aug 22)

You can easily become a member of CG by filling in the form at

  https://group.contextgarden.net/register.shtml

Besides being able to register for the online portion of the upcoming meeting,
you will also receive the nicely printed ConTeXt journal, and additionally you
will help the ConTeXt Group to do more for the community in the future. 

Even if you are not going to attend the online meeting, we think becoming a 
CG member is a great idea! More that fifty people have joined already!

To see more details about the upcoming meeting, see the website at

  https://meeting.contextgarden.net/


In other news, there is now a provisional programme page:

  https://meeting.contextgarden.net/2021/programme.shtml


I can't wait to see (some of) you in person in Bassenge!

Best wishes,
Taco

— 
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 / 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] nil from TeX to Lua

2021-08-10 Thread Taco Hoekwater via ntg-context


> On 9 Aug 2021, at 22:05, Aditya Mahajan via ntg-context  
> wrote:
> 
> On Mon, 9 Aug 2021, Hans van der Meer via ntg-context wrote:
> 
>> In the TeX to Lua interface with
>> 
>> \def\Macro#1{\directlua{luafunction("#1")}}
>> 
>> the transfer from TeX to Lua is by string. However what to do at the Lua end 
>> when calling \Macro{}?
>> As I understand it, then on the Lua side an empty argument and an empty 
>> string are indistinguishable. 
> 

On the TeX side, these are always indistinguishable (as TeX doesn’t have 
’strings’) so depending
on the called macro, you could just assume str == "” actually means nil?

But a clearer example of where you run into trouble would be helpful.

Best wishes,
Taco


— 
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 / 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] Strange new behaviour of the mailing list

2021-08-02 Thread Taco Hoekwater via ntg-context
Hi,

> On 31 Jul 2021, at 15:56, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> 
> Ah, I didn’t recognize you mean this.
> 
> Since the mail goes through the mailing list software, the sender must not be 
> the original sender any more – ntg.nl is not allowed to send emails for a 
> different domain. Many securely configured mail servers reject “faked” sender 
> addresses, as they should. Look up DANE etc.


Which is exactly why that setting was changed. So yes, the change is on purpose.

Best wishes,
Taco

— 
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 / 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] Rolling out a pandoc-context publication workflow in an organization

2021-07-01 Thread Taco Hoekwater


> On 1 Jul 2021, at 13:31, Jan U. Hasecke  wrote:
> 
> Hi Taco,
> 
> thanks for this hint.
> 
> Am 01.07.21 um 08:44 schrieb Taco Hoekwater:
>> I would put the whole context distribution in the git. That way, you can
>> potentially hotfix something centrally.
> 
> Would you put texmf-cache into .gitignore?

probably, but it depends on how homogenous your setups are. 

In principle texmf-cache can be shared, but only if nobody has personal files.

> 
> Or is the cache portable to other machines?
> 
> juh
> ___
> 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
> _______

— 
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 / 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] Rolling out a pandoc-context publication workflow in an organization

2021-07-01 Thread Taco Hoekwater
Hi,

> On 1 Jul 2021, at 08:02, Jan U. Hasecke  wrote:
> 
> I come up with the idea of an "organizational context distribution" that has 
> all requirements preinstalled. That could look like this:

I would put the whole context distribution in the git. That way, you can
potentially hotfix something centrally.

Best wishes,
Taco

— 
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 / 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] 15th International ConTeXt Meeting (early bird closes)

2021-06-30 Thread Taco Hoekwater


> On 30 Jun 2021, at 19:34, Bruce Horrocks  wrote:
> 
> 
>> On 30 Jun 2021, at 15:23, Taco Hoekwater  wrote:
>> 
>> Just a quick reminder that early bird registration for the ConTeXt meeting 
>> 2021
>> in Bassenge officially ends today. I’ll be a bit lenient about the actual 
>> money 
>> transfer, but you should fill in the registration form today or at the very 
>> last
>> tomorrow, if you want to be eligible for the early bird discount.
>> 
>>  https://meeting.contextgarden.net/
>> 
>> In other news, there is now an abstracts page with lots of talk topics added 
>> by Hans himself. Check that out as well!
> 
> In other news the early bird deadline in the table header row on the linked 
> page is 11th July.

You are not even the first person to point that out. 

Ok, so July 11 it is. It is still better to register right away :)

Best wishes,
Taco

___
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] 15th International ConTeXt Meeting (early bird closes)

2021-06-30 Thread Taco Hoekwater

Hi all,

Just a quick reminder that early bird registration for the ConTeXt meeting 2021
in Bassenge officially ends today. I’ll be a bit lenient about the actual money 
transfer, but you should fill in the registration form today or at the very last
tomorrow, if you want to be eligible for the early bird discount.

   https://meeting.contextgarden.net/

In other news, there is now an abstracts page with lots of talk topics added 
by Hans himself. Check that out as well!

   https://meeting.contextgarden.net/2021/abstracts.shtml

Finally: this year for the first time we do have a (small) bursary fund.
Applications can be added in the remark fields of the registration page, or
by sending a message directly to me.

I can't wait to see (some of) you in person in Bassenge!

Best wishes,
Taco

— 
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 / 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] PDF forms not creating proper children

2021-06-09 Thread Taco Hoekwater
Hi,

> On 9 Jun 2021, at 16:41, Pablo Rodriguez  wrote:
> 
> 
> Only mupdf-gl sees the signature annotation after signing it. Acrobat,
> Evince, Okular and xpdf cannot deal with the signature.

Just FYI:

On the Mac, I can sign the processed example using Adobe Acrobat Reader DC,
and it can save a signed pdf as well as re-open it, including showing that
verification bar that says it is a signed pdf.

mupdf-gl ‘sees’ the original field also, but mine is compiled without openssl 
so it cannot actually sign. It happily correctly opens the signed version 
from AR DC, of course.

Apple Preview does not recognize the signature field (well, it has zero
support for signing to begin with, so that is not a surprise).



— 
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 / 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] keep text strictly inside box

2021-06-08 Thread Taco Hoekwater


> On 7 Jun 2021, at 23:07, Wolfgang Schuster 
>  wrote:
> 
> Use the align key.
> 
> \starttext
> 
> \startframedtext[width=10cm,align={flushleft,nothyphenated}]

Also, ‘verytolerant’ helps:

> align={flushleft,nothyphenated,verytolerant}]

Best wishes,
Taco
> 
> Martinus, zoon van Johannes van Zonnevelt en Johanna
> Teikenbort: getuigen Adrianus van Zonnevelt en Anna
> van Oostbroek.
> \stopframedtext
> 
> \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] [metafun example does not compile]

2021-05-21 Thread Taco Hoekwater
Hi,

It looks like textext.dflt is undefined in the latest lmtx because it is now
renamed to textext.dlft :)


> On 21 May 2021, at 14:03, Floris van Manen  wrote:
> 
> Using the example from the wiki
> https://wiki.contextgarden.net/textext_positioning
> 
> then using the latest version of lmtx
> 
> $ context --version
> mtx-context | ConTeXt Process Management 1.04
> mtx-context |
> mtx-context | main context file: 
> /home/vm/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2021.05.20 16:06
> mtx-context | main context file: 
> /home/vm/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2021.05.20 16:06
> 
> 
> it will produce an error (and an empty page)
> 
> 
> metapost> initializing instance 'metafun:1' using format 'metafun' 
> and method 'default'
> metapost> loading 'metafun' as 'metafun.mpxl' using method 'default'
> metapost> initializing number mode 'scaled'
> metafun > log >
> metafun > log > error: Unknown relation will be considered false
> metafun > log >
> metapost> log >
> metapost> log > 
> metapost> log >)
> metapost> log > 
> thetextext->...FIX2)(rawtextext(ddecimal(EXPR3)),(EXPR4))else:if.anchortextexts>0:image(draw(EXPR3)withprescript"tx_anchor="(EXPR4))else:(EXPR3)fi.if(mfun_labtype(SUFFIX2)>=10)
> metapost> log > :shifted(0,y...
> metapost> log > 
> thetextext->begingroup.if.string(EXPR3):thetextext(SUFFIX2)(rawtextext((EXPR3)),(EXPR4))
> metapost> log > 
> elseif.numeric(EXPR3):thetextext(SUFFIX2)(rawtextext(decimal(EXPR3)),(EXPR4))elseif.pair(EXPR3):thetextext(SU...
> metapost> log > 
> textext->begingroup.thetextext(SUFFIX2)((EXPR3),origin)
> metapost> log >   endgroup
> metapost> log > <*> ...A; draw PA withpen pencircle scaled 1.5mm 
> withcolor red; pair PB ; PB := PA shifted decal ; draw textext.drt ("DRT-" & 
> MonTexte) shifted PB; draw textext.dflt("DFLT-" & MonTexte)
> metafun > log >
> metafun > log > Oh dear. I can't decide if the expression above is 
> positive, negative, or zero.
> So this comparison test won't be 'true'.
> 
> 
> 
> 
> As in most of the cases with software, there is (probably) a reason to it ;-)
> 
> 
> .F
> ___
> 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
> ___

— 
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 / 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] \char not working with private unicodes

2021-05-12 Thread Taco Hoekwater


> On 12 May 2021, at 14:03, Taco Hoekwater  wrote:
> 
> But \char”F1538 still shows the wrong icon (though probably a different wrong 
> one). 
> 
> I did a bit of digging, and here is where it starts to goes wrong right now 
> (tma excerpt):
> 
> 
>  [….]


Never mind that, that was wrong of me and not the problem at all! Sorry!

Retry:

  [983943]={
   ["boundingbox"]=58,
   ["index"]=903,
   ["name"]="music-note",
   ["unicode"]=983943,
   ["width"]=512,
  },
  [983944]={
   ["boundingbox"]=187,
   ["index"]=904,
   ["name"]="music-note-half",
   ["unicode"]=983945,
   ["width"]=512,
  },

“music-note” appears twice in the font encoding, at F0387 and F0388. 
The cheat sheet says that the second of those should be “music-note-eight”,
but it has the wrong name, which is probably why ConTeXt removes it.

The next one is “checkbox-blank-circle-outline”, which is at F0766 and F043D.
The latter should have been named “radiobox-blank” according to the cheat sheet.

Etc.

On my earlier note: I still think it is bad to assign unicode code points
in ’this’ case. A logo that is encoded in the PUA and happens to be named 
“minus” is very unlikely to actually be a mathematical minus.


— 
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 / 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] \char not working with private unicodes

2021-05-12 Thread Taco Hoekwater


> On 11 May 2021, at 17:31, Hans Hagen  wrote:
> 
> On 5/11/2021 3:40 PM, Taco Hoekwater wrote:
>>> On 11 May 2021, at 15:16, Hans Hagen  wrote:
>>> 
>>> On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
>>>> Hi, list! Following this thread: 
>>>> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint
>>>>  
>>>> <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>,
>>>>  I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display 
>>>> the right symbol and, as it's discussed in the linked page, there's an 
>>>> offset by 14. Is this intentional (in ConTeXt)? A bug? Minimal 
>>>> (non-)working example:
>>>> %Font available here: https://materialdesignicons.com/ 
>>>> <https://materialdesignicons.com/>
>>>> \starttext
>>>> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
>>>> \stoptext
>>> You need to employ a sense of humour for that font:
>>> 
>>> \starttext
>>>\definefontfeature[materialicons][default][rlig=yes]
>>>\definedfont[file:materialiconsregular.ttf*materialicons]
>>>baby_changing_station
>>> \stoptext
>> That only works with the regular font, not with the webfont version from the 
>> ‘easy download’
>> link (it is cool, though :)).
>> But that is not the issue. The issue is that you have this super-useful page 
>> online:
>>   https://pictogrammers.github.io/@mdi/font/5.4.55/
>> where you can just copy the code point and/or the encoding hex value. But 
>> those values
>> do not match the ones in ConTeXt because the duplicates are removed while 
>> creating the tma,
>> which condenses the encoding, resulting in an encoding offset, and that in 
>> turns make cut
>> useless. :(
>> Also, it is a bit of a shame that the XXX-webfont.ttf has postscript glyph 
>> names that map to the
>> online cheat sheet, but these names are not preserved in the tma file (at 
>> least not in my lmtx
>> version). Keeping those would make the whole typset-a-specific-glyph 
>> procedure be a lot less
>> error-prone, at least.
> i suppose you noted the message -)
> 
> can you confirm / check that we can safely assume zero length names to be 
> okay?
> 
>local length = readbyte(f)
>if length > 0 then
>glyphs[mapping].name = readstring(f,length)
>else
> -- report("quit post name fetching at %a of %a: 
> %s",i,maxnames,"overflow")
> -- break
>end
> 
> i bet this check is there because of some other font needed it in order to 
> get loaded


With that “break" removed glyph naming works and I can safely do:

 \getnamedglyphdirect{file:materialdesignicons-webfont.ttf}{access-point-check}

which is the font glyph encoded at “F1538. The above line produces the correct 
output now.

But \char”F1538 still shows the wrong icon (though probably a different wrong 
one). 

I did a bit of digging, and here is where it starts to goes wrong right now 
(tma excerpt):


  [983923]={
   ["boundingbox"]=1,
   ["index"]=883,
   ["name"]="minecraft",
   ["unicode"]=983923,
   ["width"]=512,
  },
  [983924]={
   ["boundingbox"]={ 0, 0, 406, 214 },
   ["index"]=884,
   ["name"]="minus",
   ["unicode"]=8722,
   ["width"]=512,
  },
  [983925]={
   ["boundingbox"]=6,
   ["index"]=885,
   ["name"]="minus-box",
   ["unicode"]=983925,
   ["width"]=512,
  },

That “minus" is moved back to the spot for Unicode MINUS SIGN, and then the 
rest 
of the encoding shifts down by one. That happens a few dozen times in total, for
various glyphs with “standard” names. So probably the name-based remapping of
glyphs is a bad idea for glyphs that are explicitly PUA-encoded in the font ...

Best wishes,
Taco


— 
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 / 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] \char not working with private unicodes

2021-05-11 Thread Taco Hoekwater


> On 11 May 2021, at 15:16, Hans Hagen  wrote:
> 
> On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
>> Hi, list! Following this thread: 
>> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint
>>  
>> <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>,
>>  I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the 
>> right symbol and, as it's discussed in the linked page, there's an offset by 
>> 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working example:
>> %Font available here: https://materialdesignicons.com/ 
>> <https://materialdesignicons.com/>
>> \starttext
>> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
>> \stoptext
> You need to employ a sense of humour for that font:
> 
> \starttext
>\definefontfeature[materialicons][default][rlig=yes]
>\definedfont[file:materialiconsregular.ttf*materialicons]
>baby_changing_station
> \stoptext

That only works with the regular font, not with the webfont version from the 
‘easy download’ 
link (it is cool, though :)).

But that is not the issue. The issue is that you have this super-useful page 
online:

  https://pictogrammers.github.io/@mdi/font/5.4.55/

where you can just copy the code point and/or the encoding hex value. But those 
values
do not match the ones in ConTeXt because the duplicates are removed while 
creating the tma, 
which condenses the encoding, resulting in an encoding offset, and that in 
turns make cut
useless. :(


Also, it is a bit of a shame that the XXX-webfont.ttf has postscript glyph 
names that map to the 
online cheat sheet, but these names are not preserved in the tma file (at least 
not in my lmtx 
version). Keeping those would make the whole typset-a-specific-glyph procedure 
be a lot less 
error-prone, at least.

Best wishes,
Taco

— 
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 / 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] 15th International ConTeXt Meeting

2021-05-03 Thread Taco Hoekwater
TL;DR:  See https://meeting.contextgarden.net/ for registration!


Hi all,


Registration for the next ConTeXt meeting is now open!

15th International ConTeXt Meeting
==

The thirteenth ConTeXt meeting will take place in Bassenge, Belgium on

  September 20-25, 2021

You are cordially invited to join the 15th ConTeXt meeting. The meeting will 
host ConTeXt and Lua(Meta)TeX developers and users and gives you the 
opportunity 
to present your results, experiences and ideas on future development. The talks 
will be followed-up by tutorials on different ConTeXt and Lua(Meta)TeX 
techniques.

Our meeting will take place in person since we assume vaccination levels will 
be high enough by then that travel restrictions will be lifted (yeah!). 

Alternatively, it is also possible to register for on-line attendance so you
can listen to the talks from your home office. On-line attendance is free, but 
only open to ConTeXt Group members. 


Thematic context


The theme for this meeting is:

 expanding orbits

You can interpret that any way you want.

But, as in previous years, anything at all related to ConTeXt that you would 
like 
to share is an acceptable subject for a presentation, tutorial, discussion, 
Q session, demonstration, workshop, recital, sketch, or sermon.


The programme committee is Hans Hagen and Taco Hoekwater.


Social context
==

Registration opened today. 

We will be back in ’t Sjetootje in Bassenge-Boirs, the same location as the
meetings in 2011, 2014 and 2019. There has been some remodelling (there is now
an actual conference room with built-in wifi!) but the basic layout of 
the chateau has not changed so, as before, (single) rooms are very scarce.

Note that the meeting starts on Monday evening and ends on Saturday morning.
It is possible to stay on for another day (or even two, if you are OK with
getting up early on Monday the 27th). Arriving early is not possible, though.


Calendric context
=

• May 3, 2021, beginning of registration
• July 1, 2021, deadline for early bird payment
• September 20-25, 2021, 13th ConTeXt Meeting


See https://meeting.contextgarden.net/ for more details.

Hope to see you in September,

Taco
(your local organizer this year)

— 
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 / 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] nbsp in XML (S01E01)

2021-04-22 Thread Taco Hoekwater
Hi,


> On 21 Apr 2021, at 23:09, Jano Kula  wrote:
> 
> On Wed, Apr 21, 2021 at 8:37 PM Hans van der Meer  wrote:
>> Why tilde is displayed?
> 
> Wouldn't the simple answer not be: because XML is not TeX?

You are never going back to “TeX mode”: the preprocessor converts XML into 
*other* XML. 
And tilde in XML is just that: the ascii tilde glyph.

> 
> I still would expect unicode nbsp to be expandable, 

I agree with that, but for fine-tuning XML output I would use a trick like this:

\startluacode
function lxml.preprocessor(data)
return string.gsub(data, "nbsp;", "")
end
\stopluacode

\startxmlsetups xml:name
...
\xmlsetsetup{\xmldocument}{document|nbsp}{xml:name:*}
\stopxmlsetups

\startxmlsetups xml:name:nbsp
\penalty1\hskip .3em plus 2em % or something, just a wild example.
\stopxmlsetups

Using an xml element would also allow your code to ‘look around’ to make sure 
all is 
well with its (typesetting) environment.

Best wishes,
Taco

— 
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 / 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] README for pending new subscribers March 2021

2021-04-01 Thread Taco Hoekwater
Hi all,

Regretfully, we have had problems with a hacker messing with the html 
subscription page of this mailing list. In mitigation, we have disabled web - 
based subscription requests completely. 

From now on, subscription to this mailing list can only be requested by sending 
an email message to ntg-context-requ...@ntg.nl with “subscribe" as the Subject.

Unfortunately, it was impossible for us to differentiate between "hacked" and 
“legit” subscription requests made during the month of March 2021 so to prevent 
our mail server from being blacklisted as email sender we have had to discard 
all pending subscription requests. 

This means that anyone that has tried to subscribe to ntg-context during the 
past month (that has not received a confirmation message from mailman welcoming 
them to the mailing list) will have to re-start the subscription process. 

Apologetically,
Taco

— 
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 / 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] ConTeXt Meeting 2021 announcement; Call for submissions

2021-03-31 Thread Taco Hoekwater

Hi all!


15th International ConTeXt Meeting
==

The fifteenth ConTeXt meeting will take place in Bassenge, Belgium on

September 20–25, 2021

This will be our fourth meeting at ’t Sjetootje / Château Boirs (!) 

Registration


Registration will start on May 1.


Call for submissions


The theme for this meeting is:

expanding orbits

But, as in previous years, anything at all related to ConTeXt that you 
would like to share is an acceptable subject for a presentation, 
tutorial, discussion, Q session, demonstration, workshop, recital, 
sketch, or sermon.

The programme committee is Hans Hagen and Taco Hoekwater, feel free to 
email them with hints and ideas.

Hoping to see many of you in person in September, your organiser,

Taco

— 
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 / 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] Help figuring why long document stops short in xml export

2021-02-24 Thread Taco Hoekwater


> On 24 Feb 2021, at 10:42, Christoph Hintermüller  
> wrote:
> 
> Hi
> What command line parameters, trackers etc I should activate when i

There is 

  \enabletrackers[export.*]

Best wishes,
Taco

— 
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 / 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] Question about parsing XML and attributes (normally var.at.attrib) with a name with ':' in it

2021-02-14 Thread Taco Hoekwater
Hi Gerben,

Not behind a computer right now, but you should look at the output of 

   table.print(foo)

Best wishes,
Taco

> On 14 Feb 2021, at 23:12, Gerben Wierda  wrote:
> 
> 
> foo.at[“attribute:B”]
> 
> I looked at the code and guessed this. Still haven’t found really good 
> documentation for lua, lua in ConTeXt, and especially theXML stuff (it’s all 
> written as \xmlsomething TeX commands. No idea if this is ConTeXt, lua or 
> whatever but it works.
> 
> Gerben Wierda (LinkedIn)
> R Enterprise Architecture (main site)
> Book: Chess and the Art of Enterprise Architecture
> Book: Mastering ArchiMate
> 
>> On 14 Feb 2021, at 22:40, Gerben Wierda  wrote:
>> 
>> If I have an XML element like this:
>> 
>> 
>> 
>> and it has been read in a lua variable foo, I can get at attribute x with 
>> foo.at.x 
>> 
>> But how do I get at attribute:B?
>> 
>> Gerben Wierda (LinkedIn)
>> R Enterprise Architecture (main site)
>> Book: Chess and the Art of Enterprise Architecture
>> Book: Mastering ArchiMate
>> 
>> ___
>> 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
> ___
___
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] Metapost: directionpoint gives unexpected point(?)

2021-02-12 Thread Taco Hoekwater


> On 12 Feb 2021, at 10:31, Mikael Sundqvist  wrote:
> 
> Hi Taco,
> 
> thanks, from your observation and the way I build the paths, I found
> out that I can avoid the problem by shortening the paths I join just
> slightly:
> 
> cl := (fullcircle scaled 4u) shifted z0;
> cl := cl cutbefore point (1/6+epsilon) along cl cutafter point
> (2/6-epsilon) along cl;
> cs := (fullcircle scaled 16u) shifted z1;
> cs := cs cutafter point (1/6-epsilon) along cs;
> 
> and indeed, it works here now, with different values of the scale u,
> and it seems more stable.


Here is a quick hack I wrote that does the cleanup in a postprocessing stage. 
It is not very generic or clever, but it works for your case:

def clean_path(suffix p) =
  begingroup;
  save q,precontrols,postcontrols,points, skip, i,j;
  boolean skip;
  pair precontrols[],postcontrols[],points[] ;
  j := 0;
  for i = 0 upto length p:
skip := false;
if abs(xpart point i of p - xpart point i+1 of p)<0.01:
   if abs(ypart point i of p - ypart point i+1 of p)<0.01:
 skip := true;
   fi
fi
if not skip:
   points[j] := point i of p;
   postcontrols[j] := postcontrol i of p;
   precontrols[j+1] := precontrol i+1 of p;
   j := j + 1;
fi
  endfor;
  if abs(xpart point 0 of p - xpart point length p of p)<0.01:
 if abs(ypart point 0 of p - ypart point length p of p)<0.01:
   j := j - 1;
 fi
  fi
  p := for i=0 upto j-1: points[i] .. controls postcontrols[i] and 
precontrols[i+1] .. endfor cycle;
  endgroup;
enddef;

show p0;
clean_path(p0);
show p0;

> 
> PS I found out that eps and epsilon both worked, and I do not see in
> the metafun manual if there is a difference.

The original intent was for eps to be just a ’small enough value that a human 
will not notice it’ where epsilon is intended as ’the smallest representable 
value’. Neither really work that way because depending on how you use metapost 
eps can be quite visible (especially in non-scaled number systems) and (more 
importantly) in the new non-scaled number systems epsilon cannot really be the 
smallest representable value for numerical and practical reasons.

So in reality, we always use these definitions:

  eps  := .00049 ;  % this is a pretty small positive number
  epsilon  := 1/256/256 


Best wishes,
Taco

— 
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 / 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] Metapost: directionpoint gives unexpected point(?)

2021-02-12 Thread Taco Hoekwater
Hi,

> On 11 Feb 2021, at 17:41, Mikael Sundqvist  wrote:
> 
> Thanks for your investigation and extended example!
> 
> So, if I understand it correctly, the problem occurs where the
> different circles are glued together with the .. construction.

Took me a while to get it, but the problem is the definition of p0:

p[0] := cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated 240) .. 
(cl rotated 240) .. cycle;

Here are cs and cl after your earlier definition:

cs := (141.732246,-49.097491614210789)
  ..(75.312386775380347,111.25424516116959)
  ..(28.347427842053655,147.2925755432174);
   
cl := (28.346108531095332,147.29283827977969)
  ..(0,154.88788322842163)
  ..(-28.346108531095332,147.29283827977969);

Note how the last point of cs and the first point of cl are nearly the same. 
When you combine these bits into p0, p0 becomes a cyclic path with 18 points 
(where you really want/need only 12 points).

The micro-segments between these nearly-identical paths are the problem. At 
smaller u values the differences between the points become zero, and the 
directionpoint of a path of length zero is mathematically undefined. 

I do not know a quick generic solution off hand, but that is what the issue is.

Best wishes,
Taco


___
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] About baseline alignment in metapost - issue on the wiki ?

2021-01-29 Thread Taco Hoekwater


> On 29 Jan 2021, at 09:33, Garulfo  wrote:
> 
> The dlft version doesn't seem to work on the wiki.
> 
> A MVE here https://wiki.contextgarden.net/textext_positioning#Test_dlft

Version issue? The wiki is still running a context from june last year.
> 
> 
> 
> 
> Le 29/01/2021 à 09:01, Garulfo a écrit :
>> To align with the baseline :
>> thetextext.drt("Hello, World!", (1cm, 5cm)) ;
>> Also existing :
>> thetextext.d  (center)
>> thetextext.dlft   (left)
> ___
> 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
> ___

— 
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 / 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] Missing images in Wiki?

2021-01-25 Thread Taco Hoekwater


> On 22 Jan 2021, at 20:41, Andres Conrado Montoya Acosta 
>  wrote:
> 
> This is one example: 
> 
> https://wiki.contextgarden.net/Command/externalfigure
> 
> However, now I checked the source, and the image files are there... and they 
> are being correctly linked, but the image attributes width and height are set 
> to zero. Maybe something wrong with lazy loading?

The remote cat was missing from ConTeXt’s image cache. I fixed that now by 
editing the source (added a space),
which made the wiki rerun ConTeXt, and that in turn made ConTeXt re-fetch the 
url contents.

The other images all load fine for me.



Images for ‘’ blocks can be a little tricky, because the wiki software 
caches them based on a hash of the block’s contents. So if something transient 
goes wrong in the ConTeXt processing but ConTeXt still outputs some sort of 
PDF, then that output will never get fixed unless you edit the wiki source 
again. 

That does not happen a lot, but it is likelier to happen with remote content.

There are two ways around this:

1. edit the block source slightly, by adding a space or a % or something else 
that is harmless. That changes the hash key of the content, and the wiki will 
(probably) regenerate the graphic.

2. There is a ‘secret’ force attribute for , but that should only be 
used to apply fixes like the one I did above, and it should be removed 
afterwards. That attribute bypasses the wiki caching altogether. But as that is 
really bad for the webserver’s performance, it should only be used if there is 
no other way. 

See also:  https://wiki.contextgarden.net/Help:Context


Best wishes,
Taak


— 
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 / 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] Missing images in Wiki?

2021-01-22 Thread Taco Hoekwater


> On 21 Jan 2021, at 20:30, Andres Conrado Montoya  
> wrote:
> 
> It seems a lot of image examples from the wiki are gone now. Most articles 
> lost many images. Is this on purpose? 

Seems unlikely, but provide a few examples, please. I will check.

— 
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 / 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 dimensions in Lua

2021-01-18 Thread Taco Hoekwater


> On 18 Jan 2021, at 10:45, Hans Hagen  wrote:
> 
> On 1/18/2021 1:58 AM, Jairo A. del Rio wrote:
>> Hi, list.
>> I want to get some dimensions in Lua. See, for instance
>> \starttext
>> \the\dimexpr\availablehsize\relax %say, 426pt
>> \stoptext
>> Is there an equivalent in ConTeXt for Lua, i.e. without passing values from 
>> TeX or, at least, using only Lua commands? Thank you in advance.
> tex being tex, there is always a way ...

There is also this option:

   % function returns scaled points
   \startluacode
   function availablehsize() 
  local l = tex.dimen.hsize - tex.skip.leftskip.width - 
tex.skip.rightskip.width
  if tex.count.hangafter<0 then
 local h = tex.dimen.hangindent
 if h>0 then  l = l - h else l = l + h end
  end
  return l 
   end
   \stopluacode

But I suspect that there are multiple cases where this does not work
(like when used in horizontal mode, for example if the par setting changes 
before the \par is seen, or when there is data in the local par node)

Best wishes,
Taco

— 
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 / 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] question about vardef variables

2021-01-18 Thread Taco Hoekwater


> On 17 Jan 2021, at 11:17, Damien Thiriet  wrote:
> 
> Hi,
> 
> 
> I have some troubles with understanding metafun's macro mechanism.
> 
> Given this MWE:
> 
> \starttext
> \startMPpage
> 
> vardef Test (expr ab,cd)=
>   %numeric ab;
>   %numeric cd;
>   draw unitsquare scaled 10 xshifted ab;
>   draw unitsquare scaled 10 yshifted cd;
> enddef;
> 
> Test (50,100);
> \stopMPpage
> \stoptext
> 
> Uncommenting the two declarations makes me run intro a silent error. I was 
> lucky enough yesterday to get an explicit error message with a more 
> complex macro.  It made me figure out where my problems came from.
> 
> So here are my two questions:
> - Why shouldn't we tell metafun if expr is a path, a pair or so on?

You were (attempting to) redefine the macro’s arguments, but they are read-only.

A somewhat longer answer: the type of macro arguments in this case is “expr”. 
Metapost argument types are based solely on what the internal language parser 
needs to interpret the code; the language is not strongly typed.

Also, during macro expansion, your code is replaced by:

  %numeric (READONLY TEMP VALUE 1);
  %numeric (READONLY TEMP VALUE 2);
  draw unitsquare scaled 10 xshifted (READONLY TEMP VALUE 1);
  draw unitsquare scaled 10 yshifted (READONLY TEMP VALUE 2);

Best wishes,
Taco

— 
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 / 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] dutch calendars 3 months

2021-01-05 Thread Taco Hoekwater

Knew that one. AKA: what is the weekday for “XX in month XX”?

> On 5 Jan 2021, at 14:06, Otared Kavian  wrote:
> 
> Best wishes for the new year !
> 
> Talking of calendars, this one is even more compact: each year is shown on 
> one page, and when changing the year only the three lines where the months 
> are shown will change:
> 
> http://www.professores.im-uff.mat.br/hjbortol/c1p/?fbclid=IwAR3EkoYjcxA2MCkfWU8J-KqaEReMluNaQ1DPkDNM8dxtWEwnGZ0mXsvQ640
> 
> Best regards: Otared
> 
>> On 5 Jan 2021, at 11:46, luigi scarso  wrote:
>> 
>> I guess this is a challenge for Willi :
>> a module to typeset "dutch calendars"
>> as in 
>> https://www.calendari.it/
>> (I am not involved at all with the site, it's the first I have found )
>> 
>> I like the slim version, with 3 months, the saint(s) of the day, the moon 
>> phases, the week number,
>> the day from the beginning and to the end of the year 
>> 
>> 
>> -- 
>> 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
>> ___
> 
> ___
> 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
> ___

— 
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 / 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] dutch calendars 3 months

2021-01-05 Thread Taco Hoekwater


> On 5 Jan 2021, at 11:46, luigi scarso  wrote:
> 
> I guess this is a challenge for Willi :
> a module to typeset "dutch calendars"
> as in 
> https://www.calendari.it/
> (I am not involved at all with the site, it's the first I have found )

Being Dutch, I never realised there was such a thing as a “Dutch calendar”. 

These are just calendars? What makes them “Dutch” from an Italian viewpoint?

Best wishes,
Taco

___
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] Migrating from LaTeX (was: A not so short introduction to ConTeXt Mark IV)

2021-01-04 Thread Taco Hoekwater


> On 4 Jan 2021, at 14:02, BPJ  wrote:
> 
> for searching for "index" on the ConTeXt wiki finds an error page!

Redirect page added. If you see more such issues, please do the same.

Best wishes,
Taco

— 
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 / 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] MetaFun - "remove the paths of text" from a rectangle to let the background visible

2020-12-24 Thread Taco Hoekwater


> On 24 Dec 2020, at 00:14, Garulfo  wrote:
> 
> Thanks Taco,
> 
> I made some progress :
> https://wiki.contextgarden.net/Talk:Cover_Pages
> 
> I now have two additional questions ... ;-)
> 
> - How can I deal with "space" characters (because current solution
>  requires to explicitly add the ~ character)

Here’s what I would do (which is probably not the nicest way of doing it). Just
enable \obeyspaces while reading the argument to \EmptyLetters, then disable
it again immediately (that is needed if you have to go back to TeX from Lua):

\def\EmptyLetters
 {\obeyspaces\doEmptyLetters}

\def\doEmptyLetters#1%
  {\normalspaces
   ...
  }

and in \whatever you then need \doifinstringelse{ }{#1}

Best wishes,
Taco

___
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] MetaFun - "remove the paths of text" from a rectangle to let the background visible

2020-12-21 Thread Taco Hoekwater


> On 21 Dec 2020, at 16:09, Garulfo  wrote:
> 
> Hi,
> 
> 
> * I try to "remove the paths of text" from a metapost pictures to let
>  the background visible.
> 
> * Using
>  https://mailman.ntg.nl/pipermail/ntg-context/2018/thread.html#92725
> 
> * I was able to get the following with one glyph (MVE code below)
> 
>  https://wiki.contextgarden.net/images/d/d2/test_extract_glyphs.pdf
> 
> 
> 2 questions:
> 
> 1/ for some fonts (e.g. dejavu vs latin modern) the "encompassing" path
>   of the B glyph can switch from B[1] to B[Bn]. Is there a trick to
>   identify which id match with "the encompassing" path ?

What you get is the order of the paths as defined in the font, which is 
arbitrary, as you discovered.

A quick trick (that will not always work, but should work quite well for font 
variations of alphabetics) is to check the actual arclength of the paths. The 
longest one will typically be the outer one. 

But much depends on the font, so a generic solution is likely quite 
complicated. Consider an outline font’s colon glyph ;)


> 
> 2/ now, I would like to do the same, but for text... a kind of
>   derivative of "textext" or "outlinetext".
>   Would you please give me some guidelines ?
>   does it already exist ?
>   should I use something like \handletokens, \scantokens ?
>   do you have examples where I can get inspiration ?
> 
> 
> Thanks again for your help,
> Garulfo
> 
> 
> %==
> 
> 
> 
> 
> \starttext
> 
> %--
> 
> \startluacode
> 
> function document.outlinepaths(character)
>local chardata  = fonts.hashes.characters[true] -- by unicode
>local shapedata = fonts.hashes.shapes[true] -- by index
>local c = chardata[character]
>if c and c.index and shapedata then
>local shapeglyphs = shapedata.glyphs or { }
>local glyph   = shapeglyphs[c.index]
>if glyph and (glyph.segments or glyph.sequence) then
>local units  = shapedata.units or 1000
>local factor = 100/units
>return fonts.metapost.paths(glyph,factor)
>end
>end
>return { }
> end
> 
> function document.defineoutline(char,target)
>local outlines = document.outlinepaths(char)
>local nofpaths = #outlines
>context("path %s[] ;",target)
>context("numeric %sn ; %sn := %s ;",target,target,nofpaths)
>for i=1,nofpaths do
>context("%s[%i] := %s ; ",target,i,outlines[i])
>end
> end
> 
> \stopluacode
> 
> %--
> 
> \def\mpdefineoutlines#1#2{\ctxlua{document.defineoutline(\number`#1,"#2")}}
> 
> %--
> 
> \startMPpage
> 
> numeric dimA ; dimA := 20cm;
> 
> path pathbackground ;
> pathbackground :=  unitsquare scaled dimA ;
> fill pathbackground withshademethod "linear" withshadedirection(0,1) 
> withshadecolors (red,blue);
> 
> %--
> 
> \mpdefineoutlines{B}{B}
> 
> %--
> 
> numeric dimB  ; dimB := 2cm;
> numeric vratio ; vratio := 2;
> 
> path frame ;
> frame :=  unitsquare
>  xscaled (dimA - 2 * dimB)
>  yscaled (dimA / vratio)
>  shifted (dimB , (dimA - (dimA / vratio))/2 );
> 
> %--
> 
> pair shift ; shift := center frame;
> numeric scal ; scal := (0.9) * (10cm / (bbheight B[1])) ;
> 
> picture monImageB; monImageB := nullpicture;
> addto monImageB contour
>  (B[1] shifted (- center B[1]) scaled scal)
>  shifted shift
>  withpostscript "collect";
> 
> addto monImageB contour
>  frame
>  withpostscript "evenodd";
> 
> for i=2 upto Bn :
>  addto monImageB contour
>(B[i] shifted (- center B[1]) scaled scal)
>shifted shift;
> endfor ;
> 
> %--
> 
> draw monImageB withcolor white;
> 
> \stopMPpage
> 
> \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/comm

Re: [NTG-context] Off-topic: Struggles with LPEG grammar

2020-12-21 Thread Taco Hoekwater
Hi,

Also good reading are the first sections in Roberto’s paper:

  http://www.inf.puc-rio.br/~roberto/docs/peg.pdf

> 
> In reality it just means that I was trying to add a new rule to solve
> the second part of the puzzle (hidden on the website until you solve
> the first part), which read something like
>6: 3 | 3 6
> which would in theory be translated into something like
>r6 = lpeg.V"r3" + lpeg.V"r3" * lpeg.V"r6",
> if PEGs worked the way I imagined they worked, that is. Apparently they don't 
> :)

Try this, blind guess: 

r6 = lpeg.V"r3" * lpeg.V”r6” + lpeg.V"r3",

Best wishes,
Taco


Taco Hoekwater
Elvenkind BV




___
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] Off-topic: Struggles with LPEG grammar

2020-12-21 Thread Taco Hoekwater


> On 21 Dec 2020, at 14:08, Mojca Miklavec  
> wrote:
> 
> Dear Taco,
> 
> On Mon, 21 Dec 2020 at 13:46, Taco Hoekwater wrote:
>>> On 21 Dec 2020, at 13:16, Mojca Miklavec wrote:
>>> 
>>> My only explanation would be that perhaps "^1" is so greedy that the
>>> rest of the pattern doesn't get found. But I don't want to believe
>>> that explanation.
>> 
>> Which (of course) means that that is exactly what happens ;)
>> 
>> The ones that match are
>> 
>> ababbb (a (ba+bb) b) => r4 r1(r3(r5 r4) r2(r5 r5)) r5
>> abbbab (a (bb+ba) b) => r4 r1(r2(r5 r5) r3(r5 r4)) r5
>> 
>> With the ^1, in the “bb” cases the first “b” eats all three “b”s:
>> 
>> ababbb fails the r5 at the end
>> 
>> abbbab fails the first r2 already (since the second r5 therein never happens)
> 
> Is this a deliberate choice, a limitation of the grammar
> expressiveness, some misuse on my side that could/should/needs to be
> implemented in a different way, or does it count as a "bug" on the
> lpeg side?
> 
> For example, I wouldn't expect a regexp "b+b" to fail on "bbb" just
> because "b+" would eat all three "b"s at once (the regexp "b+b" in
> fact finds "bbb", and I would expect a less-than-totally-greedy hit
> with lpeg as well). Or is my reasoning wrong here?

PEGs are greedy by design, which is a consequence of the fact that PEGS do not 
backtrack, which goes back to the underlying assumptive rule of PEGs that there 
is one (and only one!) ‘correct’ way to parse the input. Allowing backtracking 
destroys that assumption and by doing so would complicate the system to a level 
that would make it comparable to PCRE (with all the associated penalties on 
processing speed and a much greater codebase).

Another way of thinking of it (perhaps that helps): PEGs are _declarative_ on 
the input, whereas REs are _interpretive_.

Yet another way of thinking about it: PEGs rigorously define the (programming) 
language of the input.

It takes a bit of rewiring your brain to get comfortable with PEGs when you are 
used to REs, and unpredictable input is much harder to tackle in PEGs. OTOH, 
using PEGs are much better if there is an explicit grammar.

In your example, the fact that you even considered ^1 means that you were still 
thinking too much in terms of regular expressions, but I know it is very hard 
to learn how to do something that is _only a little_ different from something 
you know well already.

Best wishes,
Taco




___
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] Off-topic: Struggles with LPEG grammar

2020-12-21 Thread Taco Hoekwater


> On 21 Dec 2020, at 13:46, Taco Hoekwater  wrote:
> 
> 
> 
>> On 21 Dec 2020, at 13:16, Mojca Miklavec  
>> wrote:
>> 
>> My only explanation would be that perhaps "^1" is so greedy that the
>> rest of the pattern doesn't get found. But I don't want to believe
>> that explanation.
> 
> Which (of course) means that that is exactly what happens ;)
> 
> The ones that match are
> 
> ababbb (a (ba+bb) b) => r4 r1(r3(r5 r4) r2(r5 r5)) r5
> abbbab (a (bb+ba) b) => r4 r1(r2(r5 r5) r3(r5 r4)) r5
> 
> With the ^1, in the “bb” cases the first “b” eats all three “b”s: 
> 
> ababbb fails the r5 at the end

Sorry, that was wrong, it fails at the second r5 in the r2 as well, for the same
reason as below.

> 
> abbbab fails the first r2 already (since the second r5 therein never happens)
> 
> Best wishes,
> Taco

___
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] Off-topic: Struggles with LPEG grammar

2020-12-21 Thread Taco Hoekwater


> On 21 Dec 2020, at 13:16, Mojca Miklavec  
> wrote:
> 
> My only explanation would be that perhaps "^1" is so greedy that the
> rest of the pattern doesn't get found. But I don't want to believe
> that explanation.

Which (of course) means that that is exactly what happens ;)

The ones that match are

ababbb (a (ba+bb) b) => r4 r1(r3(r5 r4) r2(r5 r5)) r5
abbbab (a (bb+ba) b) => r4 r1(r2(r5 r5) r3(r5 r4)) r5

With the ^1, in the “bb” cases the first “b” eats all three “b”s: 

ababbb fails the r5 at the end

abbbab fails the first r2 already (since the second r5 therein never happens)

Best wishes,
Taco

___
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] Parallelizing typesetting of large documents with lots of cross-references

2020-12-03 Thread Taco Hoekwater


> On 3 Dec 2020, at 12:04, Stephen Gaito  wrote:
> 
> 1. Are there any other known attempts to parallelize context?

Not that I know of, except for the tricks I mentioned in my earlier mail today.

> 2. Are there any other obvious problems with my approach?

The big problem with references is that changed / resolved references can 
change other (future) references because the typeset length can be different,
shifting a following reference to another page, which in turn can push
another reference to yet another page, perhaps changing a page break, et 
cetera. 

That is why the meta manual needs five runs, otherwise a max of two runs would 
always be enough (assuming no outside processing like generating a bibliography 
or index is needed). So your —once approach may fail in some cases, sorry.

Actually, the meta manual really *needs* only four runs. The last run is the 
one 
that verifies that the .tuc file has not changed (that is why a ConTeXt document
with no cross-references at all uses two runs, and is one of the reasons for 
the existence of the —once switch).

Depending on your docs, you may be able to skip a run by using —runs yourself.

Best wishes,
Taco



___
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] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 1/2

2020-12-03 Thread Taco Hoekwater


> On 3 Dec 2020, at 11:35, Stephen Gaito  wrote:
> 
> Hans,
> 
> As I said my desktop is elderly... it has a 2.8GHz processor, 16Gb of
> DDR3 memory, and a couple of old SATA1 hard disks, and only 3Mb of CPU
> cache...
> 
> ... all well past its use by date for single threaded ConTeXt. ;-(
> 
> So one way to get better performance for ConTeXt is to invest in a new
> ultra fast processor. Which will cost a lot, and use a lot of power
> which has to be cooled, which uses even more power

Startup time can be improved quite a bit with an SSD. Even a cheap SATA
SSD is already much faster than a traditional harddisk. Doesn’t help
with longer documents, but it could be a fairly cheap upgrade.

I can’t comment on how to speed up the rest of what you are doing,
but generally multi-threading TeX typesetting jobs is so hard as to
be impossible in practise. About the only step that can be split off
is the generation of the PDF, and even there the possible gain is 
quite small (as you noticed already).

Typesetting is a compilation job, so the two main ways to speed things
along are

1) split the source into independent tasks, like in a code compiler
   that splits code over separate .c / .cpp / .m / .p etc. files,
   and then combine the results (using e.g. mutool)

2) precompile recurring stuff (in TeX, that would mean embedding
   separately generated pdfs or images)

Best wishes,
Taco





___
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] mathmatrix and internal lines

2020-11-30 Thread Taco Hoekwater


> On 29 Nov 2020, at 08:48, Otared Kavian  wrote:
> 
>> On 26 Nov 2020, at 23:23, Hans Hagen  wrote:
>> […]
>> A bit more code needed but the next upload will have it. Of course you have 
>> to wikify it.
>> 
>> Hans
> 
> Hi,
> I created a page on the wiki:
>   https://wiki.contextgarden.net/Matrix_in_maths
> However the LMTX code is not typeset on the wiki. I'll see with taco whether 
> it is possible to have lmtx mode on the wiki.

I plan to update the lmtx on the wiki sometime between now and new years’ eve. 
Sorry, I can not be more precise right now.

Best wishes,
Taco
___
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] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Taco Hoekwater


> On 26 Nov 2020, at 16:09, Keith McKay  wrote:
> 
> Hi,
> 
> I have been using xpart and ypart to extract these values from pairs of 
> points in a path but I wasn't getting the correct result. I was expecting:
> 
> pair (2cm, 11cm) to give xpart 2 and ypart 11

As explained by various people, Metapost does not have dimensions. All lengths 
are implicit Postscript big points
(72/inch). Variables like “cm” just add a multiplication factor to your 
expressions, at no point is a dimension stored inside Metapost. 

Your equation:

  a0 = (2cm,11cm)

first expands into 
  
  a0 = (2*28.34645,11*28.34645)

because “cm” is a variable with a value (Its definition in plain.mp is "cm = 
28.34645”)

Then, the two expressions in the a0 equation are resolved before the 
assignment, so what you actually wrote at the statement level is

  a0 = (56.6929, 311.8096);

At no point is there a “cm”-sized dimension.

===

Perhaps another option would be for you to do all your work without units, e.g. 

  a0 = (2,11) % assume scaling will happen later

and then in the end do the drawing on a scaled path:

  draw (pp scaled cm) …

as that may be less confusing? If the precision is an issue, you could counter 
the loss of precision you could use implied millimeters instead of centimeters.

Best wishes,
Taco





___
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] color epub reader

2020-11-09 Thread Taco Hoekwater


> On 6 Nov 2020, at 20:22, Hans Hagen  wrote:
> 
> Hi,
> 
> Playing with a pocketbook color epub reader (I just put some manuals on it):
> 
> - the colors are not bright enough, also not with lights on, why rgb and not 
> cmyk (i only tested pdf)

If I understand the tech right, it uses traditional e-ink pigments and a 
filter. The filter is subtractive, which means rgb, and that is also why it is 
not all that bright.

Best wishes,
Taco



___
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] Bug: context/mtxrun makes Firefox eat up cpu

2020-11-05 Thread Taco Hoekwater


> On 5 Nov 2020, at 11:48, Sylvain Hubert  wrote:
> 
> After dozens of compilations of various minimal examples using the newly 
> installed context, the problem reappeared.
> 
> Removing tex/texmf-cache does not help.
> 
> Does anyone know what files context modifies apart from tex/texmf-cache?

None. 

Are you sure your disk(-driver) is OK?

Taco

___
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] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-30 Thread Taco Hoekwater


> On 30 Oct 2020, at 09:34, n...@scorecrow.com wrote:
> 
> Hi Sylvain,
> 
> This bug tracker report 
>  describes lagging / 
> freezing (which are symptoms of excessive CPU usage, of course) for versions 
> of Firefox from 70 to 74 inclusive on Manjaro. They also report Chromium 
> seeing the same problem.

This basically says it is a bug in the video driver. 

You could test that theory by switching to a text terminal for running the 
‘context’ command (assuming the text-only terminal is still accessible in 
Manjaro) and see whether the output of ‘context —help’ causes lag there as 
well. Even a really, really crappy video driver should be able to handle the 
output stream in full-screen text mode, so if it still lags in that 
environment, that moves the needle toward a problem in ConTeXt (however 
unlikely Hans and I think that is).

Best wishes,
Taco
___
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] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 15:14, Sylvain Hubert  wrote:
> 
> > But it seems to be a big problem only on your machine
> I fail to see what this implies.

The point is that if this was a common problem, many users would complain or at 
least respond to your message with a “me too”. So it seems likely that there is 
something special going on with exactly your computer or your context 
installation.

What binary are you using for luametatex ? The normal linux 64-bit one from the 
lmtx distribution?

Best wishes,
Taco



___
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] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 12:44, Sylvain Hubert  wrote:
> 
> I've just tried chromium which behaves a bit better but still experiences a 
> sudden raise of cpu usage from <10% to >70% during ~1s.
> I've also noticed that, even without any browser running, each time after I 
> compile a file with `context`, my terminal get stuck for ~1s.
> So I'm pretty sure this is a context bug, probably caused by unnecessary 
> excessive disk operations or something.

But it seems to be a big problem only on your machine. What hardware are you 
running on? Is it a Raspberry PI?

Like any TeX-related program, ConTeXt does a fair bit of disk access while 
starting up, but I haven’t heard of that being an actual problem since the age 
of single-core CPUs. And it certainly should not have an effect on the CPU 
usage of any other program (it could affect system responsiveness, though).

Best wishes,
Taco




___
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] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 12:19, Sylvain Hubert  wrote:
> 
> And using safe mode here is just to make sure that the problem is not caused 
> by extensions.
> The annoyance started long before I bothered opening firefox with an extra 
> argument.

I am baffled then. I do not see the connection, at all. 

Best wishes,
Taco

___
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] Bug: context/mtxrun makes Firefox eat up cpu

2020-10-29 Thread Taco Hoekwater


> On 29 Oct 2020, at 11:29, Sylvain Hubert  wrote:
> 
> Hi,
> 
> sorry if this is not the best place to file a bug but I found no working bug 
> tracker for context.

Should you not be looking for a bug tracker for firefox instead?

It looks like firefox in safe mode is perhaps trying to do something with (or 
waiting for ?) a shell command called ‘context’, which is presumably not 
related to ‘our’ ConTeXt.

You can test that by (temporarily) redirecting the ‘context’ command from 
‘luametatex’ to ‘ls’ (but keep it at the same path), and see if the problem 
persists. If so, then it is the actual name giving problems, and then can you 
should file a firefox bug report because then it has nothing to do with ConText 
itself.

But even if the above is not the actual issue, it still sounds like a firefox 
problem to me.

Best wishes,
Taco

___
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] troubles with cutafter

2020-10-27 Thread Taco Hoekwater


> On 27 Oct 2020, at 14:06, Damien Thiriet  wrote:
> 
> Hello,
> 
> 
> I went into some troubles with cutafter.
> Must have missed something obvious.

Not so obvious: due to rounding/precision errors, the result of 
“intersectionpoint”
is rarely the actual point. It finds a point “close to” the actual intersection
of the two paths.

The intersectionpoint calculation works by limited recursive bisection of the 
two paths, 
and thus it  finds imprecise results in all but the most trivial cases. The 
result may
be an actual point on p1 or p2, or on both, or even on neither.

The better solution is to use intersectiontimes and subpath:

  draw subpath (0, xpart (p1 intersectiontimes p2)) of p1 withcolor red;

Best wishes,
Taco
___
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] Hyphenation patterns

2020-10-09 Thread Taco Hoekwater


> On 9 Oct 2020, at 08:52, Denis Maier  wrote:
> 
> Am 08.10.2020 um 19:05 schrieb Henning Hraban Ramm:
>> \starttext
>> 
>> {EN: \en\hyphenatedcoloredword{applicable}}
>> 
>> {DE: \de\hyphenatedcoloredword{applicable}}
>> 
>> \stoptext
>> 
> Wow, that's super helpful. The English pattern seems to be "ap-plic-a-ble"
> According to Meriam-Webster it should just be "ap·​pli·​ca·​ble".
> 
> {EN: \en\hyphenatedcoloredword{obligate}} gives me "ob-lig-ate"
> According to Meriam-Webster it should be "ob·​li·​gate".
> 
> I've had a look at the files mentioned by Tomáš, but as these are not just 
> wordlists I can not really tell what is happening.
> 
> So, is that a bug? 

Not really. hyphenation patterns are a bit like applying JPEG compression to 
a dictionary. It makes the data size smaller by recognising patterns while
ignoring outliers. 

Occasional errors are to be expected, which is why \hyphenation exists.

Best wishes,
Taco

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

2020-10-06 Thread Taco Hoekwater


> On 5 Oct 2020, at 22:26, Denis Maier  wrote:
> 
> Am 05.10.2020 um 22:04 schrieb Hans Hagen:
>> if it's an xml spec then using lua makes not that much sense (no gain) .. 
>> just process the xml 
> Hmm, but the XML is just a descriptive grammar of how bibliographies and 
> citations should be rendered. As Aditya has pointed out it's quite similar to 
> the role of bst style files for bibtex. So, a citeproc will take a style file 
> (in xml) and apply it to the metadata (based on the items actually cited in a 
> document).

I recall discussing this idea with Bruce D’Arcus a long time ago (somewhere in 
the early 00-es, maybe).

The CSL files look like XML, but really they are more like a macro processing 
language. Parsing and interpreting that should not be all that hard, I expect. 
If I had to do this, I would convert the XML  tags into actual lua 
functions while parsing the XML. The implied processing language is quite 
straightforward (unlike the stack-based postfix language in bibtex bst files). 
I don’t have time right now, but if someone reminds me in two months or so, I 
might have a go at it.

Best wishes,
Taco

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