Re: [NTG-context] upload

2021-10-20 Thread Hans Hagen via ntg-context

On 10/19/2021 8:43 AM, Axel Kielhorn via ntg-context wrote:




Am 18.10.2021 um 23:17 schrieb Hans Hagen via ntg-context :

Hi,

I uploaded a new lmtx. This one is a little experimental because I removed so 
redundant / intermediate code still present from teh transition from mkiv to 
lmtx (mostly backend related). I might have missed something (not all is in the 
test suite) but nothing that can't be fixed easy, most has to do with the 
timing of definitions.

But I assume users save their stable trees anyway …


Of course we do, especially after Hraban recommended the 2021-10-10 tree last 
week.

Just one question:

LMTX comes with an empty texmf-modules tree.
Are we still supposed to copy the context version?

There have been updates to letter, filter and some others lately.
That means we have to update the context tree as well.

Do you plan to include this tree in the future?


at some point yes, but then we can also sync from the garden server (on 
the todo list)

 Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] precedence of texmf trees

2021-10-20 Thread Hans Hagen via ntg-context

On 10/19/2021 8:24 PM, Henning Hraban Ramm via ntg-context wrote:

Hi wizards,

if I have files with the same name in several texmf trees (e.g. texmf-context, 
texmf-local, texmf-project, ~/texmf or TeX Live’s texmf-dist, texmf-var), which 
one will be used?

I guess “local” trees or “local” directories take precedence over 
“distribution”, but which is “the localest” of ~/texmf/..., 
texmf-dist/.../local, texmf-local/... ?


> context --generate

show all this


Where is the order defined? (Not in TDS.)

mtxrun --show-variables

mtxrun -var-value TEXMF

etc ... it's all TDS

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] marginals from footnotes

2021-10-20 Thread Hans Hagen via ntg-context

On 10/19/2021 7:16 PM, Henning Hraban Ramm via ntg-context wrote:

Hi, this is an edge case, but I tried to replicate a feature from DANTE’s LaTeX 
DTK style where links in the text (and also in footnotes) get a QR code in the 
margin.

It works for me (using zint) in the running text, but not in footnotes. 
Actually, marginals in footnotes are never displayed. Maybe I shouldn’t expect 
it to work, but I’d like to have this... Is it possible?


you should know by now that in tex 'all is possible' somehow


\starttext

\samplefile{tufte}\inmargin{margin note}
bla\footnote{footnote\inmargin{margin note from footnote}} bla

\stoptext

\starttext
\samplefile{tufte}\inmargin{margin note}
bla\footnote{footnote\inmargin[scope=local]{margin note from 
footnote}} bla

\stoptext

(note content is not part of the page flow)

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] marginals from footnotes

2021-10-20 Thread Henning Hraban Ramm via ntg-context

> Am 20.10.2021 um 10:29 schrieb Hans Hagen :
> 
> On 10/19/2021 7:16 PM, Henning Hraban Ramm via ntg-context wrote:
>> Hi, this is an edge case, but I tried to replicate a feature from DANTE’s 
>> LaTeX DTK style where links in the text (and also in footnotes) get a QR 
>> code in the margin.
>> It works for me (using zint) in the running text, but not in footnotes. 
>> Actually, marginals in footnotes are never displayed. Maybe I shouldn’t 
>> expect it to work, but I’d like to have this... Is it possible?
> 
> you should know by now that in tex 'all is possible' somehow

Yes, but I didn’t want to assume too much, and since inserts are tricky...

> 
>> \starttext
>> \samplefile{tufte}\inmargin{margin note}
>> bla\footnote{footnote\inmargin{margin note from footnote}} bla
>> \stoptext
> \starttext
>\samplefile{tufte}\inmargin{margin note}
>bla\footnote{footnote\inmargin[scope=local]{margin note from footnote}} bla
> \stoptext
> 
> (note content is not part of the page flow)

Thank you, that works great so far!

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
___


[NTG-context] Add ssty to libertinus

2021-10-20 Thread Mikael Sundqvist via ntg-context
Hi,

looking at the output of

\setupbodyfont[libertinus]
%\setupmathematics[stylealternative={ssty}]
\starttext
%\addff{ssty}
$y'=f'$
\switchtobodyfont[newcomputermodern-book]
$y'=f'$
\stoptext

I think that the primes in libertinus are too small. Indeed, looking
in the font, they look like the output. In lualatex* I get larger
primes, and as far as I understand it is because unicode-math enables
ssty.

I was not able to do so with \addff{ssty} or with
\setupmathematics[stylealternative={ssty}]. What do I miss?

Best regards, Mikael

*The file I used in lualatex was this:
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{LibertinusMath-Regular.otf}
\begin{document}
$u'f'$
\end{document}
___
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] setting date in \setupinteraction

2021-10-20 Thread Hans Hagen via ntg-context

On 10/19/2021 10:38 PM, Michal Vlasák via ntg-context wrote:


I don't know how official these interfaces are. But you can try adapting
the following to your use case.

 \setupinteraction[state=start]
 
 %\luacode{lpdf.settime("2020-02-02 12:00")}

 %\luacode{lpdf.settime(1580641221)}
 
 \startluacode
 
 local Y, M, D, h, m, s, Zs, Zh, Zm = string.match("D:20200202120021+02'00'", "^D:(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)([%+%-])(%d%d)%'(%d%d)%'$")
 
 local time = os.time{year=Y,month=M,day=D,hour=h,min=m,sec=s}

 lpdf.settime(time)
 \stopluacode
 
 \starttext

 This document is from 02.02.2020 at 12:00:21.
 \stoptext

The pattern doesn't catch all the PDF spec cases, but should match what
ConTeXt emits. The timezone info gets overwritten by current timezone
though.

Requires the below patch.

Michal

--- a/tex/context/base/mkiv/core-con.lua
+++ b/tex/context/base/mkiv/core-con.lua
@@ -1991,7 +1991,7 @@ function converters.totime(s)
  end
  local n = tonumber(s)
  if n and n >= 0 then
-return date("*t",n)
+return osdate("*t",n)
  end
  end
  
diff --git a/tex/context/base/mkxl/lpdf-ini.lmt b/tex/context/base/mkxl/lpdf-ini.lmt

index 7979b80..9703ac0 100644
--- a/tex/context/base/mkxl/lpdf-ini.lmt
+++ b/tex/context/base/mkxl/lpdf-ini.lmt
@@ -1123,7 +1123,7 @@ do
  n = converters.totime(n)
  if n then
  converters.settime(n)
-timestamp = osdate("%Y-%m-%dT%X") .. ostimezone(true) -- 
probably not ok
+timestamp = osdate("%Y-%m-%dT%X", ostime(n)) .. 
ostimezone(true) -- probably not ok
  end
  end
  if metadata then

i'll fix it but also clean up the existing code a bit

(much has to do with omitting date and is for comparison reasons)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Add ssty to libertinus

2021-10-20 Thread Hans Hagen via ntg-context

On 10/20/2021 1:01 PM, Mikael Sundqvist via ntg-context wrote:

Hi,

looking at the output of

\setupbodyfont[libertinus]
%\setupmathematics[stylealternative={ssty}]
\starttext
%\addff{ssty}
$y'=f'$
\switchtobodyfont[newcomputermodern-book]
$y'=f'$
\stoptext


ssty doesn't kick in as we're in textstyle here (and even then \addff 
doesn't work in math mode; ssty is applied when we load a font, if at 
all because not all characters in a math font have a ssty feature 
definition)



I think that the primes in libertinus are too small. Indeed, looking
in the font, they look like the output. In lualatex* I get larger
primes, and as far as I understand it is because unicode-math enables
ssty.


it's a design decision ... (imo the tex and math font community never 
could make up its mind about primes so it will always be a pain) .. 
looks like here the creator assumed a script design size for text size



I was not able to do so with \addff{ssty} or with
\setupmathematics[stylealternative={ssty}]. What do I miss?

Best regards, Mikael

*The file I used in lualatex was this:
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{LibertinusMath-Regular.otf}
\begin{document}
$u'f'$
\end{document}
whatever latex does to make these primes large is unlikely going to 
happen in context ... at some point, when these fonts stay as they are 
(all math fonts seem to have issues, but different ones) we can write 
font goodie files to 'fix them' at the font level, adding all kind of 
hacks to the context math handler is just stimulating 'not fixing a font'


\setupbodyfont[cambria]
\starttext
$y'=f'$
$\textstyle\prime$
$\scriptstyle\prime$
$\scriptscriptstyle\prime$
\switchtobodyfont[libertinus]
$y'=f'$
$\textstyle\prime$
$\scriptstyle\prime$
$\scriptscriptstyle\prime$
\switchtobodyfont[newcomputermodern-book]
$y'=f'$
$\textstyle\prime$
$\scriptstyle\prime$
$\scriptscriptstyle\prime$
\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] precedence of texmf trees

2021-10-20 Thread Henning Hraban Ramm via ntg-context

> Am 20.10.2021 um 10:10 schrieb Hans Hagen :
> 
> On 10/19/2021 8:24 PM, Henning Hraban Ramm via ntg-context wrote:
>> Hi wizards,
>> if I have files with the same name in several texmf trees (e.g. 
>> texmf-context, texmf-local, texmf-project, ~/texmf or TeX Live’s texmf-dist, 
>> texmf-var), which one will be used?
>> I guess “local” trees or “local” directories take precedence over 
>> “distribution”, but which is “the localest” of ~/texmf/..., 
>> texmf-dist/.../local, texmf-local/... ?
> 
> > context --generate
> 
> show all this
> 
>> Where is the order defined? (Not in TDS.)
> mtxrun --show-variables

Oh, yes, of course. Thank you!

> etc ... it's all TDS

I meant, the order of trees is not defined in the TDS proposal 
(http://tug.org/tds/tds.html).


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
___


Re: [NTG-context] precedence of texmf trees

2021-10-20 Thread Hans Hagen via ntg-context

On 10/20/2021 4:21 PM, Henning Hraban Ramm via ntg-context wrote:



Am 20.10.2021 um 10:10 schrieb Hans Hagen :

On 10/19/2021 8:24 PM, Henning Hraban Ramm via ntg-context wrote:

Hi wizards,
if I have files with the same name in several texmf trees (e.g. texmf-context, 
texmf-local, texmf-project, ~/texmf or TeX Live’s texmf-dist, texmf-var), which 
one will be used?
I guess “local” trees or “local” directories take precedence over 
“distribution”, but which is “the localest” of ~/texmf/..., 
texmf-dist/.../local, texmf-local/... ?



context --generate


show all this


Where is the order defined? (Not in TDS.)

mtxrun --show-variables


Oh, yes, of course. Thank you!


etc ... it's all TDS


I meant, the order of trees is not defined in the TDS proposal 
(http://tug.org/tds/tds.html).
it's kind of defined by texlive but there it changed over time, (main, 
dist, local, var, home etc and also unix distributers add / patch these 
variables; some definitions and order can be hard coded in the binary 
part that deals with kpse file lookup)


anyway, in contest it hasn't changed much and we dont' use the kpse 
library in mkiv/lmtx so we're not affected by changes; you can of course 
add more of use a different order (in a local configuration file in e.g. 
texmf-local)


(there are plenty of trackers for checking how files are looked up)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] precedence of texmf trees

2021-10-20 Thread Henning Hraban Ramm via ntg-context


> Am 20.10.2021 um 16:38 schrieb Hans Hagen :
> 
> On 10/20/2021 4:21 PM, Henning Hraban Ramm via ntg-context wrote:
>>> Am 20.10.2021 um 10:10 schrieb Hans Hagen :
 Where is the order defined? (Not in TDS.)
>>> mtxrun --show-variables
>> Oh, yes, of course. Thank you!
>>> etc ... it's all TDS
>> I meant, the order of trees is not defined in the TDS proposal 
>> (http://tug.org/tds/tds.html).
> it's kind of defined by texlive but there it changed over time, (main, dist, 
> local, var, home etc and also unix distributers add / patch these variables; 
> some definitions and order can be hard coded in the binary part that deals 
> with kpse file lookup)

I thought so...

> anyway, in context it hasn't changed much and we don’t use the kpse library 
> in mkiv/lmtx so we're not affected by changes; you can of course add more of 
> use a different order (in a local configuration file in e.g. texmf-local)
> 
> (there are plenty of trackers for checking how files are looked up)

I just wanted to give an overview in my book what is where in all those trees, 
and then I recognized I didn’t know the search order.
(Yes, I’m in ConTeXt book writing mode again.)

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
___