[NTG-context] Re: list of used files

2024-07-20 Thread Hans Hagen

On 7/20/2024 9:31 AM, Henning Hraban Ramm wrote:

Hi,

is there some mechanism (directive?) that gives me a list of files that 
were involved in making a PDF? Preferably only those outside of the 
texmf trees, but I could filter that myself.


(With "latexmk -recorder somelatexfile" I get the file list as a .fls 
file.)


My goal is to commit all used images to my git repo, while I often have 
a big collection of images that I didn’t use in the end and don’t need 
in the repo.

subconscious you know the answer:

   look at the log file

files are tagged with "start used files"

of course you can also try

\enabledirectives[system.dumpfiles=lua]

and stare at the resulting job log file (jlg)

(the default is xml but i noticed some empty entries in there ... a very 
old feature so i need to travel back in time now)


if files are missing let me know

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Fwd: expansion and variables

2024-07-17 Thread Hans Hagen




 Forwarded Message 
Subject: Re: [NTG-context] expansion and variables
Date: Wed, 17 Jul 2024 23:10:23 +0200
From: Hans Hagen 
To: Henning Hraban Ramm 

On 7/17/2024 10:40 PM, Henning Hraban Ramm wrote:

Something’s wrong with my code.
I’ll try to keep a status to output a certain marker only the first time 
after a change. With the code below I get it never.


I guess it’s an expansion problem again, but I didn’t find the right 
places for \expanded – if I use it in front of every \getvariable, I get 
the output every time.


Please help…
Hraban


\setevariable



\setvariable{Thing}{Status}{1}
\setvariable{Thing}{PreviousStatus}{0}

\define[1]\startThing{
   \setvariable{Thing}{PreviousStatus}{\getvariable{Thing}{Status}}
   \setvariable{Thing}{Status}{#1}
   <<< %

\doifnot{\getvariable{Thing}{Status}}{\getvariable{Thing}{PreviousStatus}}{%
     \bold{\getvariable{Thing}{Status}}%
   }%
}

\def\stopThing{>>>\par}

\starttext

\startThing{A} a \stopThing
\startThing{B} b \stopThing
\startThing{A} c \stopThing
\startThing{C} d \stopThing
\startThing{C} e \stopThing
\startThing{A} f \stopThing
\startThing{A} g \stopThing
\startThing{A} h \stopThing

\stoptext
___
If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl

webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


--

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Extra space in numbers

2024-07-16 Thread Hans Hagen

On 7/16/2024 10:32 AM, Shiv Shankar Dayal wrote:

Much thanks, Hans. I am curious why this is not default behavior?

if could be(come) but we're not sure how it affects existing documents

tex has not really a concept of space and in math even less but in 
luametatex we carry around some more info so there we can actually plug 
into that and act upon it, meaning that in


  1, 2

meaning

  atom(1) atom(,) atom(2)

in our case the middle one among other things knows that it was followed 
by a space or not. Also, in (1,2) one actually might want the space so 
soem additional (lua) processing can be enabled to deal with that too.


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: [External] Extra space in numbers

2024-07-15 Thread Hans Hagen

On 7/16/2024 1:50 AM, Rogers, Michael K wrote:

Hi,
Braces around the comma, $10{,}000$, works for me. It’s the plain TeX 
way. If there’s a way to set up mathematics in ConTeXt to do this, 
perhaps someone else will fill us in.
in lmtx { } in math is just grouping, so no ordinary math atom is 
created; also, digits have their own class which is hoe we control 
inter-atom spacing


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Extra space in numbers

2024-07-15 Thread Hans Hagen

On 7/16/2024 7:01 AM, Shiv Shankar Dayal wrote:

Dear Lits,

Suppose I have  $10,000$ then in the output there is extra space after 
comma. How can I get rid of it?

\setupmathematics[autopunctuation=yes]

$10,000$

$10, 000$

no | yes | all | comma | {yes,semicolon} | {all,semicolon}

see math manual for all kinds of control

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: mtxrun error with script pattern

2024-07-15 Thread Hans Hagen

On 7/16/2024 1:00 AM, Marcus Vinicius Mesquita wrote:

Dear List

When using:

mtxrun --script pattern --convert --path=./source --destination=./patterns

with the file hyph-pt.tex v. 1.4 proposed by Leo Araujo and Aline Benevides,
(see: 
https://github.com/hyphenation/tex-hyphen/pull/62/commits/79f4327c7c94c435cfcb73ea61c001a525fc818e)

I got the following message:

…
mtx-patterns| converting language pt, file hyph-pt
mtx-patterns| using tex file hyph-pt.txt
lua error : function call:
...t/tex/texmf-context/scripts/context/lua/mtx-patterns.lua:331: bad
argument #1 to 'for iterator' (table expected, got string)

I tried also using the old version 1.3 and got the same message.

How can this error be corrected?
I'm using context version: 2024.06.21 23:45

i'll send you a fix


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Quotation mark in drop caps

2024-07-10 Thread Hans Hagen via ntg-context

On 7/10/2024 10:56 AM, Thangalin wrote:

Thank you Hans.

That's pretty close. Is there a way to make the opening quotation mark 
smaller? Ideally, control the font and colour?


You can try this (patch):

\protected\def\typo_initial_handle_indeed#1#2%
  {\dontleavehmode
   \begingroup
   \cdef\currentinitial{#1}%
   \setupcurrentinitial[#2]%
   \resetfontfeature % might be needed in more places
   \ifempty{\initialparameter\c!style}%
 \definedfont[\initialparameter\c!font]%
   \else
 \useinitialstyleparameter\c!style
   \fi
   \ifempty{\initialparameter\c!color}%
 \c_attr_color   \attributeunsetvalue
 \c_attr_transparency\attributeunsetvalue
   \else
 \useinitialcolorparameter\c!color
   \fi
   ..


\starttext

\setupbodyfont[dejavu,9pt]

\defineinitial[two][m=1,method=auto]

\setupquotation[symcolor=red]

\setinitial[two] Knuth   :\ignorespaces\input knuth \par
\setinitial[two] \quotation {Knuth}  :\ignorespaces\input knuth \par

\stoptext


Cheers!

On Wed, Jul 10, 2024 at 12:25 AM Hans Hagen via ntg-context 
mailto:ntg-context@ntg.nl>> wrote:


On 7/10/2024 9:10 AM, Thangalin wrote:
 >  From TeX.SE, the following solution works; however, it doesn't feel
 > like the "ConTeXt way":
 >
 > % SOT
 > \setuplocalboxes[leftmargin][
 >      style=\bfd,
 >      color=darkred,
 >      distance=0pt,
 > ]
 >
 > \unprotect
 > \define\quoteinitial{%
 >      \futureexpandisap“\quoteinitial_true\quoteinitial_false%
 > }
 >
 > \define\quoteinitial_true{%
 >      \localmargintext[leftmargin]{“}%
 >      \expandafter\placeinitial%
 >      \gobbleoneargument%
 > }
 >
 > \let\quoteinitial_false\placeinitial
 > \protect
 >
 > \starttext
 >      \quoteinitial “We held ConTeXt in high esteem.”
\samplefile{bryson}
 >
 >      \quoteinitial We held ConTeXt in high esteem.  
\samplefile{bryson}

 > \stoptext
 > %EOT
 >
 > Any suggestions for how to improve it?
 >
 > See also: https://tex.stackexchange.com/q/722275/2148
<https://tex.stackexchange.com/q/722275/2148>
 > <https://tex.stackexchange.com/q/722275/2148
<https://tex.stackexchange.com/q/722275/2148>>
\starttext

\setupbodyfont[dejavu,9pt]

\defineinitial[two][m=1,method=auto]

\setinitial[two]             Knuth   :\ignorespaces\input knuth \par
\setinitial[two] \quotation {Knuth}  :\ignorespaces\input knuth \par

\stoptext


-
                                            Hans Hagen | PRAGMA ADE
                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
         tel: 038 477 53 69 | www.pragma-ade.nl
<http://www.pragma-ade.nl> | www.pragma-pod.nl
<http://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 <mailto:ntg-context@ntg.nl> /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
<https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl>
webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl> /
https://context.aanhet.net <https://context.aanhet.net> (mirror)
archive  : https://github.com/contextgarden/context
<https://github.com/contextgarden/context>
wiki     : https://wiki.contextgarden.net
<https://wiki.contextgarden.net>

___


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
_______


--

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailm

[NTG-context] Re: Quotation mark in drop caps

2024-07-10 Thread Hans Hagen via ntg-context

On 7/10/2024 9:10 AM, Thangalin wrote:
 From TeX.SE, the following solution works; however, it doesn't feel 
like the "ConTeXt way":


% SOT
\setuplocalboxes[leftmargin][
     style=\bfd,
     color=darkred,
     distance=0pt,
]

\unprotect
\define\quoteinitial{%
     \futureexpandisap“\quoteinitial_true\quoteinitial_false%
}

\define\quoteinitial_true{%
     \localmargintext[leftmargin]{“}%
     \expandafter\placeinitial%
     \gobbleoneargument%
}

\let\quoteinitial_false\placeinitial
\protect

\starttext
     \quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson}

     \quoteinitial We held ConTeXt in high esteem.   \samplefile{bryson}
\stoptext
%EOT

Any suggestions for how to improve it?

See also: https://tex.stackexchange.com/q/722275/2148 
<https://tex.stackexchange.com/q/722275/2148>

\starttext

\setupbodyfont[dejavu,9pt]

\defineinitial[two][m=1,method=auto]

\setinitial[two] Knuth   :\ignorespaces\input knuth \par
\setinitial[two] \quotation {Knuth}  :\ignorespaces\input knuth \par

\stoptext


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: https://behdad.org/text2024/

2024-07-09 Thread Hans Hagen

On 7/9/2024 8:46 AM, Henning Hraban Ramm wrote:

Am 09.07.24 um 07:13 schrieb luigi scarso:


https://behdad.org/text2024/ <https://behdad.org/text2024/>

A lot of stuff.


The author is quite opinionated against ConTeXt/LuaTeX, knows only the 
HarfBuzz version and can’t appreciate an independent, complete OpenType 
renderer, it seems.
Different worlds, different audiences, different objectives so a waste 
of energy to discuss i guess.


I can only say that when we started with luatex there was nothing that 
fit the requirements (oriental tex sub project) so we decided to go the 
lua route and could always be amopng the first to support new stuff 
(color fonts, variable fonts, adaptations, etc). And I'm not even taling 
math in luametatex here.


But as said: we serve a different audience, not the applications and of 
course the tex community doesn't have the big-tech funding and resources 
so ... and we try to keep a low profile anyway.


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: index sort order (de)

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

On 7/7/2024 11:46 AM, Henning Hraban Ramm wrote:

Would any of the German users object to a change of the default?
Well, I'm sure that you can guess which german you need to convince for 
me to change it (apply a patch) without second thought.


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: ConTeXt has stopped working

2024-07-05 Thread Hans Hagen

On 7/5/2024 7:51 PM, Jethro Djan wrote:

Dear list,

Anytime I try make a document I get:

token call, execute: 
...ext/tex/texmf-context/tex/context/base/mkxl/toks-aux.lmt:291: attempt 
to call a nil value (field 'getmathvariantpresets')

stack traceback:

mismatch between tex/lua and binary?

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: SciTE

2024-06-28 Thread Hans Hagen via ntg-context

On 6/28/2024 11:45 AM, Lutz Haseloff wrote:

Hi Hans, hi all,

I try to use SciTE for ConTEXt.
One problem seems to be the file scite-context-internal.properties in 
recent cont-sci zip.

My Ubuntu says it is a binary file.

Is this intended?

hm, looks like that file got corrupted

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: (any) link with document breaks Reader DC

2024-06-27 Thread Hans Hagen via ntg-context

On 6/27/2024 10:03 AM, Taco Hoekwater wrote:




On 26 Jun 2024, at 18:01, Pablo Rodriguez via ntg-context  
wrote:

If it asks for permission, it is working fine.

It might be (a wild guess, since I don’t have access to  macOS system)
that the issue only happens with Windows computers.

BTW, I have just consistenly experienced it on another Windows computer.


On my Mac it did not crash, but that is a Reader from 2021 that I am not 
willing to
upgrade so I am not sure how useful that information is.

I also installed a new Reader on my Windows 11 machine, and that one worked ok 
as well.
It says “Continuous Release | Version 2024.002.20857 | 64 bit”, and it is the 
Win 11
specific EN (US) version.

it also opens here after asking of that link is okay (same version)

anyway, i noticed that the (messier by the day) user interface now 
offers "AI assistent, full access" and "Generative Summary, full acess" 
as well as some button in the top right corner with a weird attention 
seeking coloring os maybe i should remove rader or at least start 
thinking about quarantaining it in itrs own vm, one never knows


(it's a bit frightening to see what something as simple as pdf is 
turning into: ecosystems, dependencies, business models, hypes, etc)


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Inconsistencies with fonts/c2sc feature

2024-06-25 Thread Hans Hagen via ntg-context

On 6/24/2024 6:03 PM, Kirill Davidov wrote:

Greetings,

I have been trying to make font feature sets that allow me to write
abbreviations in small caps and corporate entity/product/etc names with
small caps replacing regular ones. I have run into an issue where c2sc
works as intended on some fonts and not in others. No idea what that's
about. MWE:

%\definefontfeature [default] [default] [script=latin]
\definefontfeature [default] [default] [script=cyrillic]
\definefontfeature [capstosc] [c2sc=yes]
\definefontfeature [smallcaps] [cpsp=yes, smcp=yes, lowercasing=yes]

\setupbodyfont[stix]
%\setupbodyfont[newcomputermodern-book]

\starttext

{\language[ru]Моя любимая
{\feature[+][smallcaps]ОС}---{\feature[+][capstosc]Линукс}.}\crlf
{\language[en]My favourite {\feature[+][smallcaps]OS} is
{\feature[+][capstosc]Linux}.}

\stoptext

With STIX Two, c2sc (and smcp) works with any language as long as one
doesn't select a script in the font features, else it only works with
the chosen script. With New Computer Modern, it just doesn't work with
any latin text no matter the script chosen. That is, plain small caps
work, caps to small caps don't. What could be the reason to it? Is there
anything I could do to mitigate it?

you can try

\definefontfeature [capstosc] [c2sc=always]

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: LMTX on iPad

2024-06-25 Thread Hans Hagen via ntg-context

On 6/24/2024 7:29 PM, Thomas Meyer wrote:

Hi folks,

is it possible to install LMTX and use it on an iPad and which editor do 
you recommend?

i can run on an adroid device so i suppose it's possible (taco knows best)

i think the biggest hurdle is that apps run oin thei rown storage space 
and also that they are supposed to be resident (keep running)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: getting LuaTeX to work

2024-06-24 Thread Hans Hagen

On 6/24/2024 12:50 PM, Henning Hraban Ramm wrote:

Am 24.06.24 um 11:11 schrieb Hans Hagen:

On 6/24/2024 10:02 AM, Henning Hraban Ramm wrote:

Am 24.06.24 um 09:31 schrieb Hans Hagen via ntg-context:
Does it work without --luatex, i.e. does it work for LMTX but not 
MkIV?


mtxrun --generate --luatex works for me (on OSX), but context 
--make --luatex doesn’t since forever.

Do you have a bin then? And ran mtxrun --generate --luatex ?


Sorry, I didn’t want to hijack the thread.

Good hint – of course I don’t have a luatex binary besides that from 
TeX live 2023 that doesn’t work with latest LMTX/MkIV.
hm, normally it should because nothign gets added to luatex but maybe 
one of these 'change default behaviour startup due to whataver 
security policy' interferes (not much we can do about that apart from 
trying to be in sync)


TeX Live binaries are a tangled web of symlinks, at least on OSX.

I finally found the real binary in 
/usr/local/texlive/2023/bin/universal-darwin/, but symlinking it into my 
~/context/tex/texmf-osx-64/bin doesn’t help, I get:


$ context --make --luatex
mtx-context | redirect luametatex -> luatex: luatex --luaonly 
--socket "/Users/hraban/context/tex/texmf-osx-64/bin/mtxrun.lua" 
--script mtx-context --make --luatex --redirected

mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'

… the same "unknown script" error as without the symlink, when the 
luatex binary is found on the PATH. And yes, "mtxrun --generate 
--luatex" worked.


Might it be a conflict of texmfcnf.lua ?
could be ... there was some change between tl2023 and tl 2024 and then 
again after the tl 2024 release


and indeed this symlink chain is a problem, hard to follow also, and 
afaik a long term side effect of a gwtex / mactex / texlive transition


but i guess you can just install and then adapt the path to your liking, 
no need to operate in the texlive structure


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-24 Thread Hans Hagen

On 6/24/2024 10:02 AM, Henning Hraban Ramm wrote:

Am 24.06.24 um 09:31 schrieb Hans Hagen via ntg-context:

Does it work without --luatex, i.e. does it work for LMTX but not MkIV?

mtxrun --generate --luatex works for me (on OSX), but context --make 
--luatex doesn’t since forever.

Do you have a bin then? And ran mtxrun --generate --luatex ?


Sorry, I didn’t want to hijack the thread.

Good hint – of course I don’t have a luatex binary besides that from TeX 
live 2023 that doesn’t work with latest LMTX/MkIV.
hm, normally it should because nothign gets added to luatex but maybe 
one of these 'change default behaviour startup due to whataver security 
policy' interferes (not much we can do about that apart from trying to 
be in sync)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-24 Thread Hans Hagen via ntg-context

On 6/24/2024 4:05 AM, Bryan Kaplan via ntg-context wrote:

On 2024-06-23 at 05:25:32-06:00, Hans Hagen via ntg-context set forth:

i just tested again an install (using the latest musl installer) on an
alpine WSL instance and it works ok; i can also process a tex file (when
i set the path right as reported by the installer)
\starttext test \stoptext :

mkiv lua stats  > used platform: linuxmusl-64, type: unix, binary
subtree: texmf-linuxmusl-64
mkiv lua stats  > used engine: luametatex version: 2.11.04,
functionality level: 2024014, format id: 703, compiler: gcc
mkiv lua stats  > tex properties: 807106 hash slots used of 2097152,
52050 control sequences, approximate memory usage: 49 MB
mkiv lua stats  > lua properties: engine: lua 5.5, used memory: 57 MB,
ctx: 54 MB, max: 54 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.488 seconds, 1 processed pages, 1 shipped
pages, 2.050 pages/second


I tried installing from scratch, and again I now face the exact same 
failure. I read the install log output a little closer, and noticed this:

forget about the --luatex flag, that's not for luametatex

Hans



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-24 Thread Hans Hagen via ntg-context

On 6/24/2024 7:20 AM, Henning Hraban Ramm wrote:

Am 24.06.24 um 04:05 schrieb Bryan Kaplan via ntg-context:
mtx-install | running: 
/opt/context/tex/texmf-linuxmusl-64/bin/context --luatex --generate
mtx-context | redirect luametatex -> luatex: luatex --luaonly 
--socket "/opt/context/tex/texmf-linuxmusl-64/bin/mtxrun.lua" 
--generate --redirected

sh: luatex: not found


I wonder if your test environment is really equivalent to a fresh 
Alpine install, or if there might be any previously installations that 
are allowing it to appear to succeed. Does it work if you try inside 
Docker?


I'm not sure what else I can try. Where's that `luatex` call supposed 
to be found?


Does it work without --luatex, i.e. does it work for LMTX but not MkIV?

mtxrun --generate --luatex works for me (on OSX), but context --make 
--luatex doesn’t since forever.

Do you have a bin then? And ran mtxrun --generate --luatex ?

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-24 Thread Hans Hagen via ntg-context

On 6/24/2024 7:29 AM, Bryan Kaplan via ntg-context wrote:

On 2024-06-23 at 23:20:19-06:00, Henning Hraban Ramm set forth:

Does it work without --luatex, i.e. does it work for LMTX but not MkIV?

mtxrun --generate --luatex works for me (on OSX), but context --make
--luatex doesn’t since forever.

Hraban


Yes, that command which is run by install.sh — 
`/opt/context/tex/texmf-linuxmusl-64/bin/context --luatex --generate` — 
does indeed succeed when the `--luatex` flag is removed. (I have to 
wonder why install.sh attempts to run an unsupported command.)


because luatex can be in the installation for platforms where i can fetch it

But still, after running `context --generate`, I still get “startup 
error : no format file given, quitting” when running `context 
/tmp/test.tex`. And manually specifying that format file from the 
installed luametatex-cache still produces “startup error : missing 
find_format_file callback”.
i have no clue ... maybe another alpine or musl user knows, i can only 
test it on WSL now


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: OT? LLaMa!

2024-06-23 Thread Hans Hagen

On 6/23/2024 9:44 PM, Henning Hraban Ramm wrote:

You didn’t want “AI” in ConTeXt?

So Søren Fuglede Jørgensen put it into a font, to auto-complete sentences.

https://fuglede.github.io/llama.ttf/ 


Now run…
I'd better not even look at it. Anyway, as AI is not really AI but just 
very advanced pattern matching (ML) an dwith the backslash that 
Microsoft and Adobe now get I expect people to loose interest soon, 
after all the attention span get esmaller by the year.


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: weekend update

2024-06-23 Thread Hans Hagen via ntg-context

On 6/23/2024 3:40 PM, Alan Braslau wrote:

On 23/06/24 23/06/24, 15:28, Hans Hagen via ntg-context wrote:
I don't know beamer other than seeing presentations at meetings but I 
assume that it has some accumulator.

Ah, "the cognitive style of power point" ...
Often combined with a depressing page count for the audience (maybe 
impressive for the presenter) and an overall lack of stimulus for users 
to come up with something unique.


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: weekend update

2024-06-23 Thread Hans Hagen via ntg-context

On 6/23/2024 2:35 PM, Gerion Entrup wrote:

Am Freitag, 21. Juni 2024, 19:00:03 MESZ schrieb Hans Hagen via ntg-context:

-- support for stacking at the tex end (maybe for presentations)

\starttext

\definestacking[one]
\definestacking[two]

\startbuffer
This is a test \stacking [one] {and a proof} of \stacking [two]
{concept} indeed
\stacking [one] {\blackrule [width=4cm]} is it and the question is how
\stacking
[two] {\scale [s=2] {fancy}} we can go

\startstacking[one]
\startformula
  \sqrt{1+x}
\stopformula
\stopstacking

and how useful \stacking[two]{\inframed{it}} is.
\stopbuffer

\startstackingsteps[one,two,{one,two}]
  \startTEXpage[offset=1ts]
  \getbuffer
  \stopTEXpage
\stopstackingsteps

\startTEXpage[offset=1ts] \setupstacking[criterium={one}] \getbuffer
\stopTEXpage
\startTEXpage[offset=1ts] \setupstacking[criterium={two}] \getbuffer
\stopTEXpage
\startTEXpage[offset=1ts] \setupstacking[criterium={one,two}] \getbuffer
\stopTEXpage

\stoptext


Very nice, thank you!

I see some similarities to the "visible on" technique [1], I posted in a 
previous thread.


You mean the horrible transparency hack there?


What comes there really handy are range specifiers, what seems not possible 
with this interface.
For example: "visible on=<2->" renders the content on every page except the 
first one
or "visible on=<1-5,13-15>" on the first page up to the fifth page and from 
page 13 to 15.

The mechanism stems from the Beamer overlay specifications, see section 9.3 of 
the manual [2]
and can be much more complicated with modes (section 9.6.2).


I don't know beamer other than seeing presentations at meetings but I 
assume that it has some accumulator. We do have steppers in mkii / mkiv 
already in the presentation styles. The conceptual cleanest of them 
depends on the viewer and free ones never catched up so that one is 
acrobat specific. The stacker discussed now is just similar to the 
metapost one but then at the tex end. (A quick hack with room for more a 
bit more effiency if ther ei sneed for it.)



To add this to the new interface, if you want that, the stack layers above need 
some kind of order,
which is implicit for numbers:
```
\definestacking{one}
\definestacking{two}
\definestacking{three}
\definestackingorder{one,two, three}
...
\setupstacking[criterium={one-three}]
```
The order could also be implicitly defined after the order of the 
\definestacking calls.

Or would it be possible to have numbers always automatically (additionally) 
available as stacking layer?
So that this "just" works:
```
\startbuffer
This is a test \stacking [1] {and a proof} of \stacking [2] {concept} indeed.
\stopbuffer
...
\setupstacking[criterium={1-}]
```

I also wondered, if it is possible to define a lot of layers semiautomatically 
in Lua
(in some graphics I needed around 20 layers). It seems that numbers in layer 
names currently are not allowed.
Is code like this possible somehow?

```
\startluacode
for i = 1, 20 do
 context.definestacking(string.format("l\letterpercent.d", i))
end
\stopluacode
```


The next version already will have this:

%D For Aditya Mahajan: ranges and such.
%D
%D \starttyping
%D \starttext
%D \startstackingsteps[1,{1:2,201},{1:3,301},{1,2,4},{1-5},{1-6},{1-7}]
%D \startTEXpage
%D \startstacking[1]   \framed{ONE}\stopstacking
%D \startstacking[2]   \framed{TWO}\stopstacking
%D \startstacking[201] \framed{MORE}   \stopstacking
%D \startstacking[3]   \framed{THREE}  \stopstacking
%D \startstacking[301] \framed{INDEED} \stopstacking
%D \startstacking[4]   \framed{FOUR}   \stopstacking
%D \startstacking[5]   \framed{\im {\sqrt {
%D  \stacking[6] { 1 + x ^ {
%D  \stacking[7] { 2 } } } } }}
%D \stopstacking
%D \stopTEXpage
%D \stopstackingsteps
%D \stoptext
%D \stoptyping

The range interface is not different from the one we use in other places 
so it was a braindead patch. Numeric stacking id's don't need to be 
allocated. The example shows that it is rather general applicable 
although there are some border cases (that if needed we can intercept 
but I assume sane usage).


No upload yet unless there is a hurry.

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archiv

[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-23 Thread Hans Hagen via ntg-context

On 6/22/2024 6:14 PM, Bryan Kaplan via ntg-context wrote:

On 2024-06-22 at 04:51:48-06:00, Bruce Horrocks set forth:
Not sure if this helps but a while back I was able to produce a Docker 
build of Context based on Alpine.


The instructions and Docker file are here:
<https://www.mail-archive.com/ntg-context@ntg.nl/msg98307.html 
<https://www.mail-archive.com/ntg-context@ntg.nl/msg98307.html>>


Thank you, Bruce. I appreciate your help, but I'm not sure it applies — 
please correct me if I'm mistaken. I'm running Alpine on bare metal, and 
the musl `luametatex` binary seems operable. The problem seems, as far 
as I can tell, that the installation failed to establish whatever 
settings provide defaults, which is why (for example) it has no format 
file by default. I could certainly be wrong, as this is very new to me.
i just tested again an install (using the latest musl installer) on an 
alpine WSL instance and it works ok; i can also process a tex file (when 
i set the path right as reported by the installer)


\starttext test \stoptext :

mkiv lua stats  > used platform: linuxmusl-64, type: unix, binary 
subtree: texmf-linuxmusl-64
mkiv lua stats  > used engine: luametatex version: 2.11.04, 
functionality level: 2024014, format id: 703, compiler: gcc
mkiv lua stats  > tex properties: 807106 hash slots used of 2097152, 
52050 control sequences, approximate memory usage: 49 MB
mkiv lua stats  > lua properties: engine: lua 5.5, used memory: 57 MB, 
ctx: 54 MB, max: 54 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.488 seconds, 1 processed pages, 1 shipped 
pages, 2.050 pages/second



Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-21 Thread Hans Hagen via ntg-context

On 6/21/2024 8:19 PM, Bryan Kaplan wrote:

On 2024-06-21 at 01:15:35-06:00, Hans Hagen via ntg-context set forth:

permissions?


For Attempt #1, the “not found” mtxrun has 0755 permissions. I think the 
error is some odd side-effect of trying to run a glibc binary on a musl 
system.


But I realized that I was confused by the installation instructions in 
Attempt #1. The instructions should say, “2. `wget [URL]`” to indicate 
to the installing user that “[URL]” must be manually specified. Instead 
the instructions currently provide a URL which happens to be wrong for 
my system, thus leading to the above problem. I should have read more 
closely, to see that it says the URL is supposed to be replaced.


However, correcting for that oversight leads me to Attempt #2, which 
still fails as described in my first email.


Has anyone successfully installed ConTeXt on Alpine?

can you try again, use a new installer zip

(i need to remember to generate musl bins myself pending build bot fix)

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-21 Thread Hans Hagen via ntg-context

On 6/21/2024 8:19 PM, Bryan Kaplan wrote:

On 2024-06-21 at 01:15:35-06:00, Hans Hagen via ntg-context set forth:

permissions?


For Attempt #1, the “not found” mtxrun has 0755 permissions. I think the 
error is some odd side-effect of trying to run a glibc binary on a musl 
system.


But I realized that I was confused by the installation instructions in 
Attempt #1. The instructions should say, “2. `wget [URL]`” to indicate 
to the installing user that “[URL]” must be manually specified. Instead 
the instructions currently provide a URL which happens to be wrong for 
my system, thus leading to the above problem. I should have read more 
closely, to see that it says the URL is supposed to be replaced.


However, correcting for that oversight leads me to Attempt #2, which 
still fails as described in my first email.


Has anyone successfully installed ConTeXt on Alpine?

i installed an alpine on WSL to see what happens

- it looks like some 32/64 bit mixup ... this is a side effect of the 
fact that it take a bit of effort to see if we need musl


- the buildbot doesn't generate the binaries (i can't login to the 
machine to check if the client is running at all)


i'll see what i can do (will give some upload noise on the list)

btw, i can compile luametatex on WSL alpine so i can use that binary

you can do that as exercise:

- apk add build-base
- apk add cmake
- go to tex/texmf-context/source/luametatex
- chmod 755 build.sh
- ./build.sh
- copy bin from build/native

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] weekend update

2024-06-21 Thread Hans Hagen via ntg-context

Hi,

I uploaded a new version:

-- fix for hraban's svg image (one character patch)

-- more verbose link comments for pablo (for experimenting)

-- support for stacking at the tex end (maybe for presentations)

\starttext

\definestacking[one]
\definestacking[two]

\startbuffer
This is a test \stacking [one] {and a proof} of \stacking [two] 
{concept} indeed
\stacking [one] {\blackrule [width=4cm]} is it and the question is how 
\stacking

[two] {\scale [s=2] {fancy}} we can go

\startstacking[one]
\startformula
\sqrt{1+x}
\stopformula
\stopstacking

and how useful \stacking[two]{\inframed{it}} is.
\stopbuffer

\startstackingsteps[one,two,{one,two}]
\startTEXpage[offset=1ts]
\getbuffer
\stopTEXpage
\stopstackingsteps

\startTEXpage[offset=1ts] \setupstacking[criterium={one}] \getbuffer 
\stopTEXpage
\startTEXpage[offset=1ts] \setupstacking[criterium={two}] \getbuffer 
\stopTEXpage
\startTEXpage[offset=1ts] \setupstacking[criterium={one,two}] \getbuffer 
\stopTEXpage


\stoptext

-- support for more private pdf

\enabledirectives[backend.pdf.nounicode=noai]
\enabledirectives[backend.pdf.nounicode=nopilot]
\enabledirectives[backend.pdf.nounicode=justread]
\enabledirectives[backend.pdf.nounicode=✅]
\enabledirectives[backend.pdf.nounicode=✅❌]
\enabledirectives[backend.pdf.nounicode=❌]

\startTEXpage[offset=1ts]
\input tufte
\stopTEXpage

The last option can be handy when you don't want to make harvesting your 
documents too easy for these ai bots (as in cloud based pdf stuff). It's 
the first outcome of the multi-year, multi-stage, very scientific 
'inacessible pdf' project that Mikael S. and I recently started.


Hans


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: (off-topic) hovering over links in Acrobat Reader

2024-06-21 Thread Hans Hagen

On 6/20/2024 5:33 PM, Pablo Rodriguez via ntg-context wrote:

On 6/19/24 21:55, Henning Hraban Ramm wrote:

Am 19.06.24 um 19:16 schrieb Pablo Rodriguez via ntg-context:

Would you be so kind to test the attached document (and the one you may
generate from the sample source) hovering over the link frames in
Acrobat (ideally DC updated to latest)?

At least, I would like to be sure what is going on here.

Hovering over links is basic precaution before clicking them.

To explain that to others, I’d rather know how Acrobat (Reader) behaves
in these cases.


Build 24.2.20857.0 on MacOS 10.15.7:
1: no hover
2: https://contextgarden.net
3: https://contextgarden.net


Many thanks for your help, Hraban.

Thanks to your confirmation, I investigated the issue further (since
there had to be something different with my documents).

\setuptagging[state=start] is the culprit. "link" is the word displayed
when links are hovered over.
It's not that hard to get something less generic displayed but the 
question is what and in what detail. A lot of this stuff is not 
consistent over viewers and it being part of the user interface might 
also change over time (some viewers also interpret the page stream for 
urls).


Anyway, a next upload will have this:

% \disabledirectives[backends.references.descriptions]   % just link
% \enabledirectives [backends.references.descriptions]   % some 
detail (some todo) (default)
% \enabledirectives [backends.references.descriptions=reference] % a bit 
less


so that you can experiment a bit with it. We might at some point provide 
optional descriptions per link but the quesiton is how to cleanly 
interface this (easier if you use \define... instead of your own macros 
for urls).


Hans



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \brokenpenalties query

2024-06-21 Thread Hans Hagen

On 6/21/2024 5:23 PM, Alan Bowen wrote:


 > and \clubpenalities is greatly appreciated and will solve a problem that

there is some in lowlevel-lines.tex

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Transparency in external PDFs does not work

2024-06-21 Thread Hans Hagen via ntg-context

On 6/21/2024 2:41 PM, Gerion Entrup wrote:

Am Mittwoch, 19. Juni 2024, 09:50:33 MESZ schrieb Hans Hagen:

On 6/18/2024 9:54 AM, Gerion Entrup wrote:

Am Montag, 17. Juni 2024, 23:50:16 MESZ schrieb Hans Hagen:

On 6/17/2024 5:07 PM, Gerion Entrup wrote:

Hi,

I'm using LaTeX-Beamer and TikZ for figure typesetting.

If you use that kind of simple graphics, you can avoid this transparency
hacking by using metafun:

\setupbodyfont[dejavu]

\starttext

\startuseMPgraphic{test}
  pickup pencircle scaled 2mm ;
  draw fullcircle scaled 3cm withcolor darkred  withstacking 1 ;
  draw fullcircle scaled 2cm withcolor darkblue withstacking 2 ;
  draw textext("one")   withcolor darkgreen withstacking 11 ;
  draw textext("two")   withcolor darkgreen withstacking 12 ;
  draw textext("three") withcolor darkgreen withstacking 13 ;
\stopuseMPgraphic

\startTEXpage[offset=.25ts]
  \useMPgraphic{test}{stacking={1,11}}
\stopTEXpage

\startTEXpage[offset=.25ts]
  \useMPgraphic{test}{stacking={2,12}}
\stopTEXpage

\startTEXpage[offset=.25ts]
  \useMPgraphic{test}{stacking={1,2,13}}
\stopTEXpage

\stoptext

It's an already old feature but probably not that well known. If needed
I can make something similar at the tex end.

Hans


Thank you for the example, but learning metafun is another chapter and the
graphics are much more complicated than the minimal example given.

I saw that you pushed an updated version that fixes the bug [1]. Thank you!

Gerion

[1] 
https://github.com/contextgarden/context/commit/0bcdd3ce47a406ed7852724504e3efe28bc2d9e1#diff-603950e83d66ef32e79066259f4f456250f9f3ae795ade93db2df48d0da1034d
The next upload will have an example of something similar at the \TEX\ 
end (i made it a few days ago but no upload yet). An exmaple can (then) 
be found in:


  stacking-001.tex

in the test suite.

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Upgrading from 2021.03.05.20230120 -> 2023.05.05.20230730 breaks BibTeX footnotes

2024-06-21 Thread Hans Hagen

On 6/21/2024 2:13 AM, Kip Warner wrote:

On Tue, 2024-06-18 at 18:28 -0700, Kip Warner wrote:

On Tue, 2024-06-18 at 18:48 +0200, Hans Hagen wrote:

then use \alwayscite


Hey Hans. I note that command is not documented (yet) so thank you
for providing that.


Thank you Hans for documenting:

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

You have to thank someone else for that effort.

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Trouble installing on Alpine Linux

2024-06-21 Thread Hans Hagen via ntg-context

On 6/21/2024 4:39 AM, Bryan Kaplan via ntg-context wrote:

Hi all,

I'm a *TeX novice trying and failing to install ConTeXt on Alpine Linux.

*Attempt #1*: Following https://wiki.contextgarden.net/Installation 
<https://wiki.contextgarden.net/Installation>


  * Error:
  o install.sh: line 109: /opt/context/bin/mtxrun: not found
  * That file does exist, but attempting to execute it fails with that
error.
  * Full (2>&1) output: https://paste.rs/R3PK9 <https://paste.rs/R3PK9>


*Attempt #2*: Following http://www.pragma-ade.nl/install.htm 
<http://www.pragma-ade.nl/install.htm>


  * Explicitly grabbed “64 bit Linux Musl”.
  * Errors:
  o invalid database
'http://lmtx.pragma-ade.com/install-lmtx//tex/texmf-linuxmusl.tma'
  o sh: /opt/context/tex/texmf-linuxmusl/bin/mtxrun: not found
  * That file actually does /not/ exist.
/opt/context/tex/texmf-linuxmusl is empty.
  * Full (2>&1) output: https://paste.rs/LjvkB <https://paste.rs/LjvkB>

Any suggestions on how I might proceed?

permissions?

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \brokenpenalties query

2024-06-20 Thread Hans Hagen

On 6/20/2024 10:33 PM, Alan Bowen wrote:

Mikael and Hans—

Thank you so much for your help.Your advice regarding \brokenpenalities 
and \clubpenalities is greatly appreciated and will solve a problem that 
I was having from time to time in paginating my journal.

+ \widowpenalties

one works top down, the other bottom up and when they colide they add up

there are some more new ones, like \orphanpenalty (and \orphanpenalties) 
as well as \todlerpenalty as well as multriple parpasses


another new feature is vertical expansion

some is documented alreaydy and more details will follow (probably after 
the ctx meeting)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: upgrade problem, more info

2024-06-20 Thread Hans Hagen via ntg-context

On 6/20/2024 2:39 AM, jbf wrote:

I should give a little more info on the upgrade problem.

My system is Linux (Mint).

Context installed at /home/jbf/context/tex/texmf-linux-64/bin/context

Current version after upgrade : 2024.06.18 22:04

I tried reinstalling, but same result: error, no format found with name: 
cont-en, aborting


And the simpler fact is that everything worked as normal before I upgraded.

I tried deleting texmf-cache, running mtxrun -- generate and context 
--make but problem still persists.


Don't know if it is relevant but after running context --make I see an 
error line:


lua error   > lua error on line 18 in file typo-lin.mkxl:

But that would seem to be a different error to the 'no format found' 
error. Or is it?

That line loads typo-ling.lmt so does something go wrong there?

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \brokenpenalties query

2024-06-19 Thread Hans Hagen via ntg-context

On 6/19/2024 4:06 PM, Mikael Sundqvist wrote:

Hi,

On Wed, Jun 19, 2024 at 3:40 PM Alan Bowen <mailto:bowenala...@gmail.com>> wrote:


I have in the past relied on
     \setpenalties\brokenpenalties{1}{1}\
to set the penalty for a page break after a hyphen. But with the
latest LMTX, when I run the file, I get the error message
Error   count has to be 1 for \brokenpenalties

Any advice on how to fix the file would be most welcome.

Alan


Probably only Hans (or Wolfgang) can give a complete answer here. But

\startsetups [*default]
   \directsetup{*reset}
   \frozen\brokenpenalties 1 1\relax
\stopsetups

works here.

/Mikael

currently \brokenpenalties only takes one setting

\permanent\protected\def\setpenalties#1#2#3%
  {\ifdefined#1%
 \frozen#1\ifx#1\brokenpenalties
   \plusone#3\relax
 \else
   \numexpr#2+\plusone\relax\space\expandedrepeat\numexpr#2\relax
 { #3}\zerocount\relax
 \fi
   \fi}


PS

An interesting new feature is the possibility to set penalties depending 
on left and right page, by using options. For example


\startsetups [*default]
   \directsetup{*reset}
   \frozen\clubpenalties   3 options 4 1500 3000 250 500 0 0 \relax
\stopsetups

sets club club penalties 1500 for first line and 250 for second for 
going from left page to right page (and then 0 for the rest) and 3000 
for first line and 500 for second (and rest 0) for going from right page 
to left page.


I hope this helps a bit.

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


--

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Transparency in external PDFs does not work

2024-06-19 Thread Hans Hagen

On 6/18/2024 9:54 AM, Gerion Entrup wrote:

Am Montag, 17. Juni 2024, 23:50:16 MESZ schrieb Hans Hagen:

On 6/17/2024 5:07 PM, Gerion Entrup wrote:

Hi,

I'm using LaTeX-Beamer and TikZ for figure typesetting.
If you use that kind of simple graphics, you can avoid this transparency 
hacking by using metafun:


\setupbodyfont[dejavu]

\starttext

\startuseMPgraphic{test}
pickup pencircle scaled 2mm ;
draw fullcircle scaled 3cm withcolor darkred  withstacking 1 ;
draw fullcircle scaled 2cm withcolor darkblue withstacking 2 ;
draw textext("one")   withcolor darkgreen withstacking 11 ;
draw textext("two")   withcolor darkgreen withstacking 12 ;
draw textext("three") withcolor darkgreen withstacking 13 ;
\stopuseMPgraphic

\startTEXpage[offset=.25ts]
\useMPgraphic{test}{stacking={1,11}}
\stopTEXpage

\startTEXpage[offset=.25ts]
\useMPgraphic{test}{stacking={2,12}}
\stopTEXpage

\startTEXpage[offset=.25ts]
\useMPgraphic{test}{stacking={1,2,13}}
\stopTEXpage

\stoptext

It's an already old feature but probably not that well known. If needed 
I can make something similar at the tex end.


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: digital signing in ConTeXt

2024-06-19 Thread Hans Hagen via ntg-context

On 6/18/2024 7:42 PM, Pablo Rodriguez via ntg-context wrote:

On 6/18/24 19:28, Pablo Rodriguez via ntg-context wrote:

[...]
I have just discovered that verify didn’t work with the binary.

Figuring out now how to do the testing with the library.


For some strange reason, I cannot get --library verification.

I only get:

sign pdf| verifying with the binary is not yet implemented
sign pdf| signature in file 'a.pdf' doesn't match the content

I‘m afraid I don’t know what I’m missing.

probably a couple of libraries ...

local libfiles   = os.name == "windows"
   and { "libcrypto-3-x64", "libssl-3-x64" }
or { "libcrypto",   "libssl" }

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Upgrading from 2021.03.05.20230120 -> 2023.05.05.20230730 breaks BibTeX footnotes

2024-06-19 Thread Hans Hagen

On 6/19/2024 3:28 AM, Kip Warner wrote:


But on my machine which has ConTeXt 2023.05.05, I see the following:


so best update then ... a while ago we had some addition for references 
and that involved an extra argument someplace which is what you see ... 
seems to be solved in the meantime, if not i'll look at it


(i assume you use the installer)

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] new upload

2024-06-18 Thread Hans Hagen

Hi,

three fixes / improvements:

- math composities get more generous bounding boxes
- tikz inclusion (also new compact=tikz option that strips some nops)
- more fonts got the get-rid-of-bad-apply-characters tweak enabled

- for pablo to test signing

Hans

ps. i'm looking a bit into csl but nothing yet

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Upgrading from 2021.03.05.20230120 -> 2023.05.05.20230730 breaks BibTeX footnotes

2024-06-18 Thread Hans Hagen

On 6/18/2024 6:38 PM, Kip Warner wrote:

On Tue, 2024-06-18 at 18:16 +0200, Hans Hagen wrote:

you need to place a list in order to get some ref


Is there no way to use references without having to list the entire
bibliography?

then use \alwayscite


% hidden : mark for list, don't show in text
% list   : mark for list, show in text only when in list
% text   : not to list, show in text
% always : mark for list, show in text


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: digital signing in ConTeXt

2024-06-18 Thread Hans Hagen via ntg-context

On 6/18/2024 6:26 PM, Pablo Rodriguez via ntg-context wrote:

On 6/18/24 10:27, Hans Hagen via ntg-context wrote:

On 6/18/2024 8:44 AM, Pablo Rodriguez via ntg-context wrote:

[...]
Generating certificates with OpenSSL is basically free.


you cannot use a 'web certificate'


Self-signed certificates may be used to stamp PDF documents to set both
signing time and to detect modifications after signing.

In fact, I’m planning to digitally stamp documents at work to ensure
they aren’t modified after submission (by people or by any automated
program).


well, if you can figure it out ... i'll can only spend time on it in a 
real project (it's notp that interesting as hobby)



I think this may be avoided by adding a timestamp token (as unsigned
attribute) in the PKCS#7 (as mentioned in the PDF spec).


dunno, can test it


https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#nameddest=G11.2054251
refers to https://www.rfc-editor.org/rfc/pdfrfc/rfc3161.txt.pdf#page=20.

Not sure how to get that with OpenSSL (never tried). But I may ask how
to get that at their GitHub repository.


ok


Acrobat may be wrong in not detecting the signature (I’m investigating it).


i think it only looks for 'official' ones


I have created self-signed certificates with Acrobat Reader and signed
PDF documents with both ones (cert and Acrobat) and Acrobat displayed
these signatures.


ok


I have used the provided certificate to sign with pdfsig and Acrobat
displayed the signature.

I think Acrobat may be misbehaving here (requiring some optional content
as mandatory).


dunno, if you can create examples i suppose we can reverse engineer them 
because the standard is fuzzy



I’m afraid that the patch is needed since /ByteRange excludes a blank
space before the value of /Contents that is in the temporary file (tmpfile).


i need to test more


Perfectly fine for me. Of course, it should be tested more.


The blank space (marked above with the underscore) is included in the
hashed file (tmpfile), but it is not included in the /ByteRange.

This is the reason why we can only have digest mismatch.


yes but that what i noticed when testing: mupdf, qpdf, acrobat, etc ..
trial and error is not to add that one


Sorry, but I have to be missing your point completely.

/ByteRange considers this part of the document to be written as:

<< /ByteRange [ … 006421 010520 000384 ] /Contents<3…

But document is written, hashed and signed:

<< /ByteRange [ … 006421 010520 000384 ] /Contents <3…

Of course, the value of the contents hasn’t been hashed, but the blank
space between /Contents and is value has been hashed.


i know but when i tested with q and m that spaces was kind of fuzzy so i 
stuck with what seemed to work



As far as I know, this has to be a reason for digest mismatch (or a huge
hash collision).


could be (depends on checker) but it we change that we also need to 
change the verfy offset (so two patches)



As far as I can remember, this is mandatory for PDF-2.0 (and highly
recommended for previous versions [although not required]).


not sure what you mean, 2.0 demanding signing?


Not at all. Sorry for my poor wording. From the PDF-1.7 spec itself
(https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#search=ByteRange):

   This range should be the entire file, including the signature
   dictionary but excluding the signature value itself (the Contents
   entry). Other ranges may be used but since they do not check for all
   changes to the document, their use is not recommended. When a byte
   range digest is present, all values in the signature dictionary shall
   be direct objects.

Signatures in PDF-2.0 loose their possibility of other ranges than the
entire file. Their use is simply not allowed.


so more limited then to basically two ranges


Sorry for insisting, but please don’t require plaintext password in the
command line (again, OpenSSL prompts for it).

not if we use the library


Weird, on both Linux64 and Win64, the openssl runner requires the
openssl binary to be installed.


i meant the --library option


Many thanks for your help,

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: digital signing in ConTeXt

2024-06-18 Thread Hans Hagen via ntg-context

On 6/18/2024 8:44 AM, Pablo Rodriguez via ntg-context wrote:

On 6/18/24 00:52, Hans Hagen via ntg-context wrote:

On 6/17/2024 7:51 PM, Pablo Rodriguez via ntg-context wrote:

[...]>> 2. I cannot get any signature display in Acrobat. Does any PDF viewer (I
have tested this with pdfsig from poppler and MuPDF-GL) display the
digital signature at all?

this whole digitial signing is a bit of a scam imo ...


Digital signing may be a marketing gig also, but we may only consider
the pure feature as such.

I mean, I’m not interested here in the legally binding value of certain
digital certificates,  but just in having digital signatures right.


- one has to buy a specific kind of certificate


Generating certificates with OpenSSL is basically free.


you cannot use a 'web certificate'


- often one is supposed to use some token

- when the root cert expires one has to resign


I think this may be avoided by adding a timestamp token (as unsigned
attribute) in the PKCS#7 (as mentioned in the PDF spec).


dunno, can test it


- reader has root certs built in and checking is supposed to be online

- it doesn't come cheap and supporting / testing is not something one

can expect for free (so i can't really test it)

... so just some business model and not really something one can do out
of the box


This is all related to certificate (legal) validity. This is out of the
scope.


whatever ...


... apart from ...

- just sign with some certificate and don't expect viewers to do something


Acrobat may be wrong in not detecting the signature (I’m investigating it).


i think it only looks for 'official' onex


concerning the suggested patches: this <whatever> boundary is a
bit fuzzy and i found that different viewers / checkers expect either or
not +/- 1 but i didn't check recently if things have improved


There are two different issues here: digest mismatch and total document
signing.

I’m afraid that the patch is needed since /ByteRange excludes a blank
space before the value of /Contents that is in the temporary file (tmpfile).


i need to test more


I mean, here are the contens of the temporary file from the sample
(tweaked to fit a single line]):

<< /ByteRange [ … 006421 010520 000384 ] /Contents  /

Byte 6421 is the s (before the underscore):

<< /ByteRange [ … 006421 010520 000384 ] /Contents_ /

The blank space (marked above with the underscore) is included in the
hashed file (tmpfile), but it is not included in the /ByteRange.

This is the reason why we can only have digest mismatch.


yes but that what i noticed when testing: mupdf, qpdf, acrobat, etc .. 
trial and error is not to add that one



As for total document signing, it is better only to exclude from
/ByteRange the value for /Contents (from < to >).

As far as I can remember, this is mandatory for PDF-2.0 (and highly
recommended for previous versions [although not required]).


not sure what you mean, 2.0 demanding signing?


if we know the specs and  have way to test ... no big deal to fix a few
offsets


I’m happy to contribute as far as I can.

Sorry for insisting, but please don’t require plaintext password in the
command line (again, OpenSSL prompts for it).

not if we use the library

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Upgrading from 2021.03.05.20230120 -> 2023.05.05.20230730 breaks BibTeX footnotes

2024-06-17 Thread Hans Hagen via ntg-context

On 6/17/2024 7:57 PM, Kip Warner wrote:

Hello list,

I recently upgraded my distro release to Ubuntu Noble on one of my
machines. The ConTeXt packages that were previously for
2021.03.05.20230120 were upgraded to 2023.05.05.20230730.

Since the upgrade I've noticed my BibTeX footnotes that previously
looked like this:

    https://imgur.com/vg7Xjd3.png

Now look like this:

    https://imgur.com/I3hq6bM.png

I haven't changed anything in the source of my document. This is how I
typeset in my Environment.tex:

    % Select References.bib and name it the main database...
    \usebtxdataset[main][./References.bib]

    % Citation style...

    \usebtxdefinitions[apa]

    % Use our main dataset for citations...

    \setupbtx[dataset=main]

    \definebtxrendering[main][apa][dataset=main]

    % When listing all references use APS style...

    \definebtxrendering
    [list_all_references]
    [aps]
    [dataset=main,
    group=examples]

    \setupbtxrendering[main][

    pagestate=start,
    continue=yes,
    numbering=yes]

    % Macro to put the citations as footnotes...

    \unexpanded\def\footnotecite{\dodoubleempty\domycite}
    \def\domycite[#1][#2]%
    {\ifsecondargument
    \footnote{\cite[alternative=entry,#1][main::#2]}%
    \else
    \footnote{\cite[alternative=entry][main::#1]}%
    \fi}


complete example needed

- tex file
- bib file

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: digital signing in ConTeXt

2024-06-17 Thread Hans Hagen via ntg-context

On 6/17/2024 7:51 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

the latest version of LMTX can digitally sign PDF documents. It requires
OpenSSL installed (since it does the crypto part).

I have two issues that I would like to be tested by others.

A sample certificate may be found at
https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/ECSXLVMT3TMQBIHA2UZJPWJN7OVV5334/attachment/2/mycert.pfx
(I sent it myself).

Here is a sample document (actually provided by Hans):

   \setupinteraction[state=start]
   \definefield[signature][signed]
   \defineoverlay[signature][my signature]
   \starttext
 \startTEXpage[offset=1ts,frame=on,framecolor=darkblue]
   sign: \inframed[background=signature,framecolor=darkred]
   {\fieldbody[signature][width=3cm,option=hidden]}
 \stopTEXpage
   \stoptext

After compiling the sample, you need to run:

mtxrun --script pdf --sign --certificate=c.pfx --password=ABCabc doc.pdf


i use a pem


Password will be prompted again ("ABCabc"), since it is an encrypted
certificate (also for the public part).

Could anyone confirm the following issues?

1. The signature I get is wrong, unless I apply this patch
(https://mailman.ntg.nl/archives/list/dev-cont...@ntg.nl/message/T3OCKVZWTUTIXCSOKIFRVJ4X76MROZHE/attachment/3/byterange.diff
[sent by myself to the devel list]).

2. I cannot get any signature display in Acrobat. Does any PDF viewer (I
have tested this with pdfsig from poppler and MuPDF-GL) display the
digital signature at all?

this whole digitial signing is a bit of a scam imo ...

- one has to buy a specific kind of certificate
- often one is supposed to use some token
- when the root cert expires one has to resign
- reader has root certs built in and checking is supposed to be online
- it doesn't come cheap and supporting / testing is not something one 
can expect for free (so i can't really test it)


... so just some business model and not really something one can do out 
of the box


... apart from ...

- just sign with some certificate and don't expect viewers to do something
- offer a service to upload the document for checking when a user is in 
doubt
- that can be done without root cert and basically works as long as the 
service works


concerning the suggested patches: this <whatever> boundary is a 
bit fuzzy and i found that different viewers / checkers expect either or 
not +/- 1 but i didn't check recently if things have improved


if we know the specs and  have way to test ... no big deal to fix a few 
offsets


Hans



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: line numbering respecting original lines

2024-06-17 Thread Hans Hagen via ntg-context

On 6/17/2024 6:46 PM, Henning Hraban Ramm wrote:

Am 17.06.24 um 18:16 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 17.06.2024 um 14:03:
When discussing verses or other texts that have distinct line 
breaking, I need line numbering to adhere to that, even if some lines 
are too long and need breaking. Is that possible?


In my example below the 3rd line is too long and gets line numbers 3 
and 4.


Same problem with source code examples, i.e. \starttyping with 
numbering.
I thought numbering=file (or \setuplinenumbering[method=file]) would 
address that, but apparently not.



\start \setupparagraphnumbering[state=start]
\startlines
...
\stoplines
\stop


Thank you – that works for the minimal example, but the options for 
paragraph numbering are very limited, I can’t even use my own command.

And I can’t combine it with \starttyping.


\def\CodeNumber#1{\hfill\tt\bfx\color[orange]{#1}}

% ok
\setuplinenumbering[
   command=\CodeNumber,
   width=3em,]

% invalid
\setupparagraphnumbering[
   command=\CodeNumber,
   width=3em,]

\starttext

\setuplines[keeptogether=paragraph]

\setupparagraphnumbering[width=3em]

\setuplinenumbering[distance=1em,align=flushright]

\setupparagraphnumbering[state=start,color=red,style=bold]
\startlinenumbering
\startlines
\input tufte
\stoplines
\stoplinenumbering

\stoptext

the keeptogether option is also available for typing and it listens to 
widow and club penalties


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Transparency in external PDFs does not work

2024-06-17 Thread Hans Hagen

On 6/17/2024 5:07 PM, Gerion Entrup wrote:

Hi,

I'm using LaTeX-Beamer and TikZ for figure typesetting.
With this combination, it is easy to combine Beamer's animation system with 
TikZ transparency feature.
This way, the resulting PDFs contain the full graphic on every page, but parts 
of it are invisible for a specific page.
One of these files is attached as an example.

The problem is to embed these PDFs into a ConTeXt document.
For example, this MWE seems to not respect transparency (see mwe.pdf):
```
\starttext
\externalfigure[fig.pdf][page=1]
\stoptext
```

I use Okular/Poppler as PDF viewer.
Can I fix this somehow or is it a bug somewhere deeper?
next time check the file that you include ... it has no transparency (it 
has zero values)


the attached works ok

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
-

\starttext
\startTEXpage[offset=1pt]
\colored[a=1,t=.5,r=1]{\framed{test 1}}
\stopTEXpage
\startTEXpage[offset=1pt]
\colored[a=1,t=.5,b=1]{\framed{test 2}}
\stopTEXpage
\stoptext
\nopdfcompression

\starttext
% \externalfigure[fig.pdf][page=1]
\externalfigure[gif.pdf][page=1]
\externalfigure[gif.pdf][page=2]
\startoverlay
{\externalfigure[gif.pdf][page=1]}
{\externalfigure[gif.pdf][page=2]}
\stopoverlay
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Math manual

2024-06-16 Thread Hans Hagen

On 6/16/2024 12:39 PM, Fabrice Couvreur wrote:

Hi,
Thank you for this document which will help many people, including me. 
Quick question : this document seems to have been written in the Pagella 
font : is this correct ? Why this choice : Personal ? The most complete 
and nice font ?

Indeed.

Cambria is the reference of course but Pagella is free and we like it. 
We could have gone Lucida but it's not free either (but rather cheap and 
we fixed some in the process). Euler is also nice. We also had Bonum for 
a while (a bit bolder). Of course most fonts share alphabets. The Xits 
font is quite complete but kind of standard boring. We definitely will 
never for a can-of-worms sans for a document like this.


That said: all fonts needed tweaks, some more than others, because there 
is the inconsistent curious mix of font parameters, traditional and 
opentype properties etc to deal with, much of which we published about 
in e.g. TB in the process (as well as in documents in the 
distribuition). There ars also math companion fonts in the distribition 
that fix consistency issues in fonts (we consider most to be frozen).


Concerning complete: many unicode math characters are dubious and we 
wonder what they're used for, if at all while some other handy math 
symbols are missing.


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: x mark symbol and general symbol guide

2024-06-15 Thread Hans Hagen

On 6/16/2024 12:04 AM, Gerion Entrup wrote:


Hmm, you are right, like a little frayed. 02713 and 02714 are similar.
I guess, this should look like they were drawn with a brush.
none of the other glyphs has that (afaiks in fontforge) ... more looks 
like some conversion error, also because a brush doesn't look like that 
(control points wrong)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: x mark symbol and general symbol guide

2024-06-15 Thread Hans Hagen

On 6/15/2024 11:02 AM, Gerion Entrup wrote:

Am Freitag, 13. Oktober 2023, 14:33:24 MESZ schrieb Gerion Entrup:

Hi,

I recently tried to typeset a table with checkmarks and x marks.
\checkmark exists but is there a predefined x mark symbol (\xmark does
not work)?

In general: For LaTeX there exists the very helpful comprehensive LaTeX symbol 
list [1].
Is there a similar documentation for ConTeXt somewhere?

Best,
Gerion

[1] https://www.ctan.org/pkg/comprehensive



Just as an info. I'm using Noto symbols now:
```
\definefont[symbolFont][name:notosanssymbols2regular*default at 11pt]
\define{\yes}{{\symbolFont\utfchar{0x1f5f8}}}
\define{\no}{{\symbolFont\utfchar{0x1f5f4}}}

\starttext
\yes and \no.
\stoptext
fwiw: 1F5F8 looks pretty bad (in otf) (i checked as i though it was a 
bug in lmtx)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to improve appearance of bars in frac, sqrt, etc. on screens?

2024-06-15 Thread Hans Hagen via ntg-context

On 6/15/2024 10:59 AM, ralph.2...@email-postfach.info wrote:

Hi,

thank you all for your replies so far. I guess I’ll have to live with that for 
now (of course this isn’t really a problem, but a bit unpleasant to look at 
when you’re used to the straight lines in LaTeX). Just wanted to add that I can 
see this artifacts quite clearly on a 13 inch 1080p screen in the PDF viewer 
(depends on zoom level, on some zoom levels I see nothing) and not only when 
enlarging a screenshot. After all, it’s visible in my attached screenshots even 
if displayed in their original resolution. (Naming of my screenshots wasn’t 
very clear, zoomed.png is zoomed-in in the pdf viewer, not a zoomed-in 
screenshot.)
The "left radical + rule" isn't perfect either, because it depends on 
overlap. Depending on the font you can see issues at the connection 
(actually these might be obscured by aliasing at low res). You can try 
that outside lmtx with different fonts.


Also, because rules are often rendered differently from glyphs (and 
rules can use either a line or rectangle fill) it's always been an issue 
(which is also why engines have some heuristics for choosing one or the 
other method).


And, as mentioned, vertical extenders also use the same etechnology as 
we now use for radicals, it's just that there was never a concept like 
that in engines for radicals. Arrows sit in the same category and also 
use the same glyphs so there one can observe the same. Actually, even in 
traditional tex arrows are made from minusus and an arrowhead 
overlapping piecewise.


Maybe viewers will catch 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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to improve appearance of bars in frac, sqrt, etc. on screens?

2024-06-14 Thread Hans Hagen via ntg-context

On 6/14/2024 9:35 AM, Henning Hraban Ramm wrote:

Am 13.06.24 um 23:13 schrieb Hans Hagen via ntg-context:

On 6/13/2024 10:04 PM, Otared Kavian wrote:

Hi Ralph,

I don’t see any pixels in the PDF file when I typeset your code 
snipet (on MacOS 11.7.10). Here is what I get.
No problems on windows on chrome-os either. Mikael S and I checked it 
on his linux box and one can indeed see anti aliasing when taking a 
screen dump (depends on resolution).


So it's a linux rendering issue when taking dumps. 


Not only. It also happens with all(?) PDF viewers on MacOS – at least 
10.14 and 10.15, can anyone confirm with current versions?


So it’s dependend on the screen rendering, anti aliasing settings (that 
you usually can’t influence).


hm, so i have to stick to windows for viewing (and an ancient hardware 
laptop in order to avoid copilot and recall) but i'll check ubuntu anyway


It doesn’t affect printing – or does it for anyone? I can imagine 
printing from Firefox, i.e. pdf.js, is affected, since it prints only in 
screen resolution.
it's not related to math then, as there are also ligatures built this 
way, although often they often are less sensitive to thsi due to 
generous overlaps (unless they use a sequence of connecting strokes in 
the same direction)


also keep in mind that looking at a blown up character is not that 
realistic (for instance a traditional bitmap font might look great at 
600 or 1200 dpi at intended size so zooming in showing raggedness is not 
the normal way to see it)


btw, if one wants to observe inaccuracy, just zoom in in graphics made 
by drawing programs (even of famous companies)


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to improve appearance of bars in frac, sqrt, etc. on screens?

2024-06-13 Thread Hans Hagen via ntg-context

On 6/13/2024 10:04 PM, Otared Kavian wrote:

Hi Ralph,

I don’t see any pixels in the PDF file when I typeset your code snipet 
(on MacOS 11.7.10). Here is what I get.
No problems on windows on chrome-os either. Mikael S and I checked it on 
his linux box and one can indeed see anti aliasing when taking a screen 
dump (depends on resolution).


So it's a linux rendering issue when taking dumps. That said: we can't 
do anything about it. Using rules (traditional approach) is pretty bad 
in screen dumps and even regular rendering, depending on zoom; there one 
has interaction between the font rendering and other graphic elements 
(rules).


Btw, vertical extensibles are not different (take the bracket which has 
similar constructs). Interesting is that it is straight blob connections 
that can show these occasional gray pixels and it only seems to happen 
with a little overlap. Kind of a bug we think.


Hans

ps. One reason when I always use (x)ubuntu when i have to use a linux 
desktop is that it always was set up right wrt rendering fonts and anti 
aliasing. I might need to check that.


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: get measures as dimension in Lua

2024-06-13 Thread Hans Hagen via ntg-context

On 6/13/2024 7:24 PM, Henning Hraban Ramm wrote:

Am 10.06.24 um 10:58 schrieb Henning Hraban Ramm:


 local namespace = tokens.getters.macro("??measure")

 function tex.getmeasure(name,asdimen)
 local value = tex.getdimensionvalue(namespace..name)
 if asdimen then
 return value .. "sp"
 else
 return value
 end


So I needed just tex.getdimensionvalue(namespace..name)


just use tex.getmeasure in the upcoming


Not to be misunderstood, I couldn’t check yet, maybe I wasn’t clear:

I need to process the measure as a dimension, like \measured{Bleed}.

As far as I tried, neither tex.measured nor context.measured worked 
(but I wouldn’t swear on it, maybe I had a different error).


I understand now that a dimension in Lua is just a string.


no, it is a number (scaled points or sp) but it can have a string 
representation


I also messed a few thing up when I converted my macros from 
measure-macros to measures.


Now my image calculations work again. Phew!

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: dimen 100.0pt not 100.0pt?

2024-06-10 Thread Hans Hagen via ntg-context

On 6/10/2024 3:46 PM, Hans van der Meer via ntg-context wrote:
The I do not understand. I am testing if a dimension set can be checked 
against the expected value.
It looks like 100.0pt is not really 100.0pt. Why? And how can I do this 
test properly with true as result?


\scratchdimen=100pt\relax
\iftok{\the\scratchdimen}{100.0pt}true\else false\fi
Screenshot 2024-06-10 at 15.37.32.png

printing \the\scratchdimen results in 100.0pt

while \meaning\scratchdimen results in: constant dimension 100.0pt


It has to do with catcodes (of p and t) so you need this:

\iftok{\the\scratchdimen}{\detokenize{100.0pt}}true\else false\fi

But ... you should do it the way Wolfgang pointer out

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Scale content to height of the font, measure font height

2024-06-10 Thread Hans Hagen

On 6/10/2024 1:16 PM, Gerion Entrup wrote:

Hi,

I'd like to scale something (actually a symbol drawn in TikZ) to the exact
high of the char 'M'. I found the scale environment for it but struggle to
measure the correct font height. I found the "definemeasure/measure/measured"
commands but they define a dimension and are not for doing measurements on
rendered text. Is there a simple way to get the height a char as a dimension?

MWE:
```
\starttext
% Is it possible to replace 1cm with a common expression?
This is the letter M. \scale[height=1cm]{a} should have the exact same size as
M.

This should also be true {\tfc with a bigger M. \scale[height=1cm]{a}}.
\stoptext

\the\dimexpr\fontcharht\font`M+\fontchardp\font`M\relax

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: get measures as dimension in Lua

2024-06-10 Thread Hans Hagen via ntg-context

On 6/10/2024 7:08 AM, Max Chernoff wrote:

Hi Hraban,

On Sun, 2024-06-09 at 22:12 +0200, Henning Hraban Ramm wrote:

when I define a measure on the TeX side, I used to get at the value in
Lua with tex.getdim, like:

\definemeasure[Bleed][3mm]

tex.getdimen("Bleed")

But now I get "incorrect dimen name".
I need it as a dimension, since I do calculations with other dimensions
like "topspace".

How should I do this correctly?


There doesn't appear to be any official interfaces to get the value of a
measure from Lua, but the following should work okay:

 \definemeasure[mymeasure][10pt]

 \newdimen\mydimen \mydimen=10pt

 \definemeasure[measureexpr][1in + 27.73pt]

 \startluacode
 -- Returns the unexpanded value of some variable in a namespace.
 local function get_variable(namespace, variable)
 -- -- Doesn't work since "measure" is defined as a "system 
namespace".
 -- namespace = interfaces.getnamespace(namespace)
 namespace = tokens.getters.macro("??" .. namespace)
 return tokens.getters.macro(namespace .. variable)
 end

 -- Gets the value of a measure and converts it to an integer in sp 
units.
 local function get_measure(name)
 return tex.sp(get_variable("measure", name))
 end

 -- Gets the \dimexpr-evaluated value of a measure, in sp units.
 local function get_measure_expr(name)
 local namespace = tokens.getters.macro("??measure")
 -- Undocumented, but seems to work as expected.
 return tex.getdimensionvalue(namespace .. name)
 end

 -- Print the values of the lengths.
 print(("="):rep(80))
 print("mymeasure:"  , get_measure("mymeasure")   )
 print("mydimen:", tex.dimen["mydimen"]   )
 print("measureexpr:", get_measure_expr("measureexpr"))
 print(("="):rep(80))
 \stopluacode

 \startTEXpage
 \measure{mymeasure}
 \the\mydimen
 \measure{measureexpr}
 \stopTEXpage

Thanks,
-- Max


Indeed we can have:

local namespace = tokens.getters.macro("??measure")

function tex.getmeasure(name,asdimen)
local value = tex.getdimensionvalue(namespace..name)
if asdimen then
return value .. "sp"
else
return value
end

and when you want to avoid the namespace you can do:

function tex.getmeasure(name,asdimen)
local value = 
token.getexpansion("\\tointeger\\measured{"..name.."}")

if asdimen then
return value .. "sp"
else
return tonumber(value)
end
end

which is some 4 times slower. It'sindeed not documented (although there 
are some examples in accessors-001.tex) but it's in one of my todo's 
because I can use it in some places (there ar emopre such todo's) after 
which it will be discussed in one of the lowlelvel manuals


i'll add tex.getmeasure to the core (but a bit different)

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: ConTeXt source from XML

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 5:33 PM, Pablo Rodriguez via ntg-context wrote:

On 6/5/24 20:23, Christoph Edenhauser wrote:

Dear Pablo,

Thank you very much for your very clear, detailed and elaborate
explanations.  - Over the next few days I will meditate on the ConTeXt
way to handle XML and on my workflow and take a look at lpath (never
heard of it). And somehow I have the impression that the next few days
will last a few weeks.


Dear Christoph,

just in case it might help to your meditation.

First of all, lpaths are XPath implemented with Lua in ConTeXt.

XPath seems to have as it primary purpose to address the nodes of XML trees.

About your sources, the real issue here is to define whether you want
TEI or TeX to be the format containing them.

I mean, if you add explaining footnotes to your TeX file(s), XML won’t
be source anymore.

If you don’t want this to happen, you have to encode them in the TEI XML
sources.

One last suggestion about proofreading. This is something I learnt from
personal experience.

The first reading is much better to catch errors in the text than the
subsequent ones.

Having the text properly formatted and printed on paper helps a lot to
spot errors.

Reading source code is cheaper (no doubt), but the results will be
poorer too.

Just in case it might help,
fwiw, context supports 'synctex' to xml files / nodes so that might help 
a bit


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 4:34 PM, Wolfgang Schuster wrote:

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
    style={\italic},
    before={\setupindenting[next]},
    after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]


\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would 
like it to use like this:

```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
    style={\italic},
    before={\setupindenting[next]},
    after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]


\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) 
but it does not work.


\startsetups [userdata:extract]
     \startnarrower
     \setupindenting[next]
     \getuserdata
     \hairline
     \dontleavehmode\wordright{\itx\userdataparameter{author}}
     \stopnarrower
\stopsetups

\defineuserdataalternative
   [extract]
   [renderingsetup=userdata:extract]

\defineuserdata
   [extract]
   [style=italic,
    alternative=extract]

\starttext

\startextract[author=René Descartes]
     Cogito ergo sum.
\stopextract

\stoptext
ah, i start forgetting about these mechanisms ... i added this example 
to th etest suite


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Kerning in Noto Serif

2024-06-06 Thread Hans Hagen

On 6/6/2024 12:21 PM, Lutz Haseloff wrote:

Thanks Hraban,

my Noto Serif (just downloaded) is 2.013

--script font shows kern too:
kern cyrl dflt
    dflt dflt
    grek dflt
    latn dflt

(^^ but not all steps are shared!)

I updates that font (updating noto is a pain .. there was a zip once, 
now one has to download per font unless i miss something).


Indeed you don't get kerns out of the box. Try this:

\char42\char38

and you will see a kern. However, that's the 'shared portion' so in 
order to get the rest you need to do:


\definefontfeature[default][default][script=latn]

as it looks like dflt/dflt is no longer does that ... keep in mind thta 
fonts are not downward compatible so never update (or let your syetem do 
it) in the middle of a project


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 12:30 PM, Gerion Entrup wrote:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.


not all constructs hav ethese user variables (yet)

i'll add an option for arguments tostart/stop so that you can do

\starttext

\definedelimitedtext
  [dextract]
  [blockquote]
  [leftmargin=1.5pc,
   style=italic,
   before=\setupindenting[next],
   after=\setups{extract:whatever}]

\definestartstop
  [extract]
  [arguments=yes,
   before=\setups{extract:start},
   after=\setups{extract:stop}]

\startsetups extract:start
\startdextract
\stopsetups

\startsetups extract:stop
\startstopparameter{author}
\stopdextract
\blank[1ex,samepage]
\hrule
\blank[1ex,samepage]
\dontleavehmode
\wordright{\itx\startstopparameter{author}}
\stopsetups

\starttext

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\stoptext

but first i want Wolfgang to check the patch,

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: ConTeXt source from XML

2024-06-05 Thread Hans Hagen

On 6/5/2024 2:16 PM, Henning Hraban Ramm wrote:

Am 05.06.24 um 12:00 schrieb Christoph Edenhauser:
My Question is, is it possible to generate a second context file2.tex 
with the help of this first xml-mapping file1.tex, where all the 
xml-nodes from the xml file are mapped to contex commands


Hi, I don’t find it hard to understand, but I don’t think it’s possible 
within ConTeXt (while Hans keeps surprising me).

well, as one needs to do some work one can as well do this:

% oeps.tex

\startbuffer[test]


test


\stopbuffer

\startxmlsetups xml:mysetups
\xmlsetsetup{\xmldocument}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetups}

\startxmlsetups xml:something
\tex{StartSomething}\par
\xmlflush{#1}\par
\tex{StopSomething}\par
\stopxmlsetups

\startxmlsetups xml:what
\tex{StartWhat}\par
\xmlflush{#1}\par
\tex{StopWhat}\par
\stopxmlsetups

\setuppapersize[A1]
\setupbodyfont[dejavu,ss,1pt]
\setuplayout[tight]
\setupalign[verytolerant,flushleft,nothyphenated]

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

and then run

>context oeps
>mutool draw -F txt oeps.pdf

and get

\StartSomething
\StartWhat
test
\StopWhat
\StopSomething

so now you need to wikify it ...

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: ConTeXt source from XML

2024-06-04 Thread Hans Hagen

On 6/4/2024 9:21 PM, Christoph Edenhauser wrote:

Dear Pablo, dear list

That's great, thank you very much for your suggestion.
That seems to me to be a very elegant solution to the next two problems 
that were actually still ahead of me.


And now to my initial question, which I didn't specify precisely enough.

I have the following workflow in mind:
1. I have an XML file (TEI-XML),
2. then, following your brilliant suggestion, I will create an 
xml-analyze-template.tex file and customise it.

3. As you suggest, now one would actually use
     context --environment xml-analyze-template.tex file.xml
     to typeset in a pdf file.
But I would like to convert all the XML nodes into the ConTeXt 
typesetting language, and then edit/correct the text and maybe some 
structure in this *.tex file.


And here comes my question: Can I use context to convert my XML-file 
'file.xml' into a ConTeXt-file 'file.tex' instead of typesetting it as a 
'file.pdf'.


What do you want to tweak. HEre is the lowest level approach:



test 1


test 2

test 3


But quite some can be done when processing and there are mechanisms to 
inject e.g. page breaks using processing instruction. Probablyh not all 
is documented.


There is a xml-mkiv-tricks.tex file in the distribution (no pdf is seems 
so I need to add that one.)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Vanishing floats with location=split and \start ... \stopsplittext within

2024-06-04 Thread Hans Hagen via ntg-context

On 6/4/2024 3:57 PM, Давыдов, Кирилл Александрович wrote:

Greetings,

I have run into an issue whilst using \start ... \stopsplittext. I 
intended to use it for large code listings (using the t-vim module), 
however floats with location=split using that environment seem to vanish 
if there is nearly not enough text before the float to fill a page. Not 
only that, a second float like that seems to lead to fatal errors 
related to an unclosed group, however the document compiles regardless. 
The following MWE is an example of this. I am using ConTeXt version 
2024.05.27 18:16.


\definefloat[codelisting][codelistings]
\setupcaption[codelisting][location=top]
\setuplabeltext[english][codelisting=Listing ]

%\showboxes
\starttext

\input knuth
\input knuth
\input knuth
\input knuth
% Filler. Filler. Filler. Filler. % uncomment to push out a full page. 
the float will appear


\startplacecodelisting[
     title=My great C program on display!,
     location=split,
]
\startsplittext
\tt \input zapf
\stopsplittext
\stopplacecodelisting

\input ward

\startplacecodelisting[
     title=My second great C program on display!,
     location=split,
]
\startsplittext
\tt \input ward
\stopsplittext

\stoptext

On a related note, one can also observe that with specific amounts of 
text a float may end up being split in two on a single page, however I 
could not replicate it. Additionally, code listings done with t-vim's 
commands seem to lose line numbering within \start ... \stopsplittext in 
splittable floats, but I figure that's more on the module authors. In 
any case, is there more I can do other than not use floats for code 
listings?

best add a missing \stopplacecodelisting

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: setuphead in connection with the command argument

2024-06-03 Thread Hans Hagen via ntg-context

On 6/3/2024 1:36 PM, Gerion Entrup wrote:

Thank you. I think that I understand command vs alternative now.
With try and error, I experienced, that the font/style of the `style`
parameter interleave in a strange way. Therefore I see it as related.
What i mean is:
style: outer level, also sets interline spacing and adapts before after 
blanks


numberstyle and textstyle : specific to the element

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Issue with latest in math mode

2024-06-02 Thread Hans Hagen

On 6/2/2024 2:43 PM, Alex wrote:
Thank you so much Wolfgang, it solved it! I guess this is new as with 
LMTX from last week(s) it wasn’t required.


you were just lucky that you got decent math at all (actually it 
probbaly also needs a proper lfg file)


in the latest lmts the default feature also wipes math stuff from the 
font just to make sure that it doesn't interfere (e.g. the latest dejavu 
has some math in the regular text fonts that makes no sense and might 
even be wrong); in a few case (as with euler) we explicitly now have to 
do wipemath=no


Hans

Le 2 juin 2024 à 14:38 +0200, Wolfgang Schuster 
, a écrit :

Alex schrieb am 02.06.2024 um 14:08:

Hi everyone,

I’m facing an error with the latest LMTX with my custom font
definition: Math error: parameter 'subshiftdown' with id 49 in style 0
is not set

\usetypescriptfile[alegreya_libertinus]
\setupbodyfont[alegreya-light,ss,10pt]

\starttext

Hello

\startformula \Gamma_1 \stopformula

\stoptext


Add

    features=math\mathsizesuffix

to \definefontfamily when you set the math font. By default all font
(including monospace and math) get "features=default".

Wolfgang



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


--

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: lua error in `strc-lev.lua`

2024-05-29 Thread Hans Hagen

On 5/29/2024 11:05 AM, Sylvain Hubert wrote:
I replaced `strc-lev.lua` and rerun `context` but the error message 
stays the same. `context` command doesn't seem to recognize the change 
of `strc-lev.lua`. Should I run `mtxrun` or something before?

context --make

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: regular expression as lua pattern

2024-05-28 Thread Hans Hagen

On 5/28/2024 6:25 PM, Tomáš Hála wrote:

Hi Pablo,

unfortunately, that it is not possible:

http://lua-users.org/wiki/PatternsTutorial, section Limitations.


\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"), 
function(str,_,s)

context(s)
return #str
end) + lpeg.P(1))^1
lpeg.match(pat,"how about this being that")

local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }), 
function(str,_,s)

context(s)
return #str
end) + lpeg.P(1))^1
lpeg.match(pat,"how about this being that")
\stopluacode
\stopTEXpage
\stoptext



On Tue, May 28, 2024 at 06:12:51PM +0200, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local str = "this is that"
context(str:match("(this|these)"))
\stopluacode
\stopTEXpage
\stoptext

In short, I would like to know whether it is possible to have the
regular expression (this|these) as a Lua pattern.

I mean, I need complete strings and I haven’t found the way to do it.

Many thanks for your help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


--

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: bug tracker

2024-05-27 Thread Hans Hagen via ntg-context

On 5/27/2024 3:46 PM, Peter Münster wrote:


Is there a bug tracker for ConTeXt?
(It seems, that https://tracker.luatex.org/ is no more used...)
just mail to the list as bugs are normally either solved fast or becoem 
features


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Playing with math font setup

2024-05-21 Thread Hans Hagen
t

We use $X$, $Y$, $Z$ and $n$, $m$, etc. $\sin(x) \to \limsup x_n$ whatever.

We use $\bf X$, $\bf Y$, $\bf Z$ and $\bf n$, $\bf m$, etc. $\bf \sin(x) 
\gets \limsup x_n$ whatever.


\stoptext


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: LUA API for page numbers

2024-05-21 Thread Hans Hagen

On 5/21/2024 10:26 AM, Luc Chabassier wrote:

Hi everyone,

I have recently migrated my PhD dissertation from LaTeX to ConTeXt. In
LaTeX I was using kaobook, a template with lots of margin notes, but I
was frustrated with the automatic placement of the notes.

I implemented a system using overlays that automatically places the
notes using lua. To know where the ideal placement should be (if they do
not interact with each other), I use lua to insert a latelua whatsit
that uses lpdf.getpos() to get the coordinate on the rendered page.
However, I haven't found a way to get the page number using lua, and the
tex macro \pagenumber is unreliable near pagebreaks.

Furthermore, it would be helpful to know if there is a way to access the
position and sizes of figures at the end.
you have to provide some mwe so that we can see what is intended; in 
principle much info is available one way or the other


concerning notes in the margin ... did you try the built in magin text 
mechanisms?


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: defining hashtag simulator

2024-05-20 Thread Hans Hagen

On 5/20/2024 8:01 AM, seyal.zav...@gmail.com wrote:

Thanks.

What if we want the text to be copied when it is clicked?
I found these link on the stack site for this
https://tex.stackexchange.com/questions/174637/copy-to-clipboard-feature-in-pdf-output/545107#545107

also i defined this:
\def\Hashtag#1{
 \hbox{\tfa\ctxlua{
 str = "#1"
 replacespace = string.gsub(str," ","_")

 context.letterhash()
 context(replacespace)
 }
 }
}
\starttext
\Hashtag{hello}
\stoptext

i used hbox for making phrase unbreakable.

How can you put all the code in the one Lua function and not need to put hbox 
or goto function outside of Lua?

In the next upload you can do this:

\protected\def\Hashtag#1%
  {\begingroup
   \nohyphens
   \spacechar\underscoreasciicode
   \nospaces\plusthree
   \letterhash#1%
   \endgroup}

(was an easy extension given what we already have)

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: luatex doesn't see installed 3rd party module

2024-05-20 Thread Hans Hagen via ntg-context

On 5/20/2024 12:38 AM, and...@borisov.dev wrote:

Hello!

I’ve installed a 3rd party module by copying its TDS folder structure and 
invoking `context --generate` as described in 
https://wiki.contextgarden.net/Modules#ConTeXt_LMTX

When I compile my project with `context` (using LuaMetaTeX), it's found and 
works just fine; however, when I try to compile with LuaTeX by invoking 
`context --luatex`, it can’t find the module.

Do I need to do something special to make it visible for LuaTeX? I can’t find 
the answer in the wiki.

I use standalone ConTeXt distribution.

Any help would be appreciated 


Did you run

context --generate --luatex

after adding the file?

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: defining hashtag simulator

2024-05-20 Thread Hans Hagen via ntg-context

On 5/20/2024 8:01 AM, seyal.zav...@gmail.com wrote:

Thanks.

What if we want the text to be copied when it is clicked?
I found these link on the stack site for this
https://tex.stackexchange.com/questions/174637/copy-to-clipboard-feature-in-pdf-output/545107#545107

also i defined this:
\def\Hashtag#1{
 \hbox{\tfa\ctxlua{
 str = "#1"
 replacespace = string.gsub(str," ","_")

 context.letterhash()
 context(replacespace)
 }
 }
}
\starttext
\Hashtag{hello}
\stoptext

i used hbox for making phrase unbreakable.

How can you put all the code in the one Lua function and not need to put hbox 
or goto function outside of Lua?


\startluacode
interfaces.implement {
name  = "Hashtag",
public= true,
protected = true,
arguments = "string",
actions   = function(str)
context("{\\nohyphens\\letterhash %s}",string.gsub(str," ","_"))
 -- str = string.gsub(str," ","_")
 -- context.bgroup()
 -- context.nohyphens()
 -- context.letterhash()
 -- context(str)
 -- context.egroup()
end
}
\stopluacode


--

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: build_parshape and \getshapetext - need for a deeper understanding

2024-05-19 Thread Hans Hagen via ntg-context

On 5/19/2024 2:29 PM, garu...@azules.eu wrote:

I still get some difficulties with build_parshape, \getshapetex and sectionning.

I though I find a solution by removing \blank with
   \setuphead  [subsection]  [before=,  after=, style=, 
command=\MySubSectionCommand, alternative=text ]

But actually it's not enough : when I add text before the first section, new 
issues appear.

I tried to build a MVE by refactoring and tidying as much as I could.
It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining 
issue.

Your guidance are most welcome :-)


you have to fight several issues:

- parshapes being reset at the end paragraph (handled here by luametatex 
context)
- parshapes operate on lines, not dimension (i might add an aletnative 
one day)

- you use a bit old mechanism (checkout the luametafun-paragraphs chapter)

Now, is there a solution? It really depends on the circumstances, so 
here is one.


\setupbodyfont[11pt]

\definemeasure [mywidth]  [7cm]
\definemeasure [mywidtha] [5cm]
\definemeasure [myheight] 
[{\the\dimexpr\baselineskip*37+\lineskip\relax}]
\definemeasure [myheighta] 
[{\the\dimexpr\baselineskip*18+\lineskip*1\relax}]
\definemeasure [myheightb] 
[{\the\dimexpr\baselineskip*25-\lineskip*1\relax}]


\startuseMPgraphic{shape:1}
  path p ;
  numeric mywidth   ; mywidth   := \measure{mywidth};
  numeric mywidtha  ; mywidtha  := \measure{mywidtha};
  numeric myheight  ; myheight  := \measure{myheight};
  numeric myheighta ; myheighta := \measure{myheighta};
  numeric myheightb ; myheightb := \measure{myheightb};
  p := (0,0)-- (mywidth,0) --
   (mywidth,myheighta)  -- (mywidtha,myheighta) --
   (mywidtha,myheightb) -- (mywidth,myheightb) --
   (mywidth,myheight)   -- (0cm,myheight) -- cycle;

build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) 
;

  path SavedShape ; SavedShape := p ;
\stopuseMPgraphic

\startuseMPgraphic{shape:2}
  SavedShape := SavedShape shifted (0,-ypart urcorner OverlayBox) ;
  SavedShape := SavedShape shifted (0,positiony("test")) ;
  fill SavedShape withcolor red;
 setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\showframe

\defineoverlay[myoverlay][\useMPgraphic{shape:2}]

\setupbackgrounds[text][text][background=myoverlay]

\startsection[title={test}]

\startshapedparagraph[mp=shape:1]%
\setupalign[verytolerant,stretch]%
\hpos{test}{!}\samplefile{tufte}
\samplefile{tufte}
\stopshapedparagraph

\stopsection

The "test" position is hard coded but should be namespaced, the ! can be 
a \strut instead.


So, more thinking from the end of the text flow.

Hans



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: defining hashtag simulator

2024-05-19 Thread Hans Hagen

On 5/19/2024 5:40 AM, seyal.zav...@gmail.com wrote:

Hi all,

I want to define a command that simulate hashtag behavior in social networks,

In other words, this command should put the hashtag sign at the beginning of 
it, replace spaces with dashes and also it should be a clickable link and 
unbreakable world.
I mean like this, for example:
\myhashtag{hello world}
It should be displayed as #hello_world in the final PDF and when clicked it 
will search for #hello_world throughout the pdf
How is this possible?
One of the disppointments of pdf (some things indeed got worse over 
time) ...


"Table 215 — Named actions" lists several named actions (PDF 1.2) that 
interactive PDF processors

shall support; further names may be added in the future.
Table 215 — Named ac

Only a few were ever formal ok. Acrobat supports some more (at least 
did) but even on the


\goto{test}[action(search)]

one could not set a string. Adding a decent subset of commands is way 
easier than whatever came later to the standard. It's especially ironic 
in the perspective of accessibility.


However, if one could agree on a subset (as the standard is open) and 
open source viewers would support it ... but getting all on board is 
probably not possible).


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why is only the first frame protruding into the margin?

2024-05-17 Thread Hans Hagen via ntg-context

On 5/17/2024 8:22 PM, madiazm.eo...@gmail.com wrote:

thanks Pablo, but this is strange

If I reproduce your code in a new file I see the perfect alignment of the frames. But I 
had changed the code in my original file as suggested by Wolfgang and I additionally 
commented all lines in the "firstHeadings" definitions following your advice 
and after compiling... the same result.

The strange thing is that it is only the first section that protrudes, the 
other sections are right (as seen in the link). Therefore it must not be the 
code definition, since in that case all sections should protrude...

Over the weekend I will slowly move my code to a new file with your code adding 
a bit everytime to try to spot the moment when I get this strange behaviour and 
then I will write again.

ps. I included the link because there is no attach option here in the 
online-mailing-list. Sorry if it not ok.
thanks
if you do something \switchtobodyfont without ever having loaded it 
(before starttext) spaces can creep in depending on what files are 
loaded for that font


also, in order to avoid grouping issues / side effects you can do this 
before \starttext:


\usebodyfont[foo]

when you use multiple bodyfont sets

Hans



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: MyWay from dl.contextgarden.net

2024-05-17 Thread Hans Hagen

On 5/17/2024 10:49 PM, garu...@azules.eu wrote:

Several documents previously stored on dl.contextgarden.net are no longer 
accessible.

https://wiki.contextgarden.net/This_Way_-_My_Way#MyWay

Are they available on another server ? or is there a copy somewhere else ?
Thanks for your help


everything that makes sense (also historically) is in the distribution 
under doc


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] update

2024-05-17 Thread Hans Hagen

Hi,

This weekends update:

- we're currently checking the upcoming math manual and in the process 
we streamline some mechanisms


- as part of the BT presentation about par passes we introduced 
\toddlerpenalty but we leave it to the user to guess what that is (it 
fits into widow, club and orphan penalty collection)


- we could already produce pdf 2.0 but especially when one mises with 
older files, some care is needed; the inclusion 'compact' mechanism has 
been cleaned up a bit and the merge interface is converging (it has to 
do with efficient font sharing, cleanup and fixing of files outside our 
control); when one has issues with inclusion, try with compact= (set to 
nothing)


- although we're mostly done with tagging it will get some attention as 
we go; it's mostly about playing safe and getting valid pdf's


- for rhaban (posters) another fancy feature was added:

\startTEXpage[offset=1ts]
\samplefile{tufte}\removeunwantedspaces\space

\startshadow[contrastcolor=red,weight=100]\blue\samplefile{tufte}\removeunwantedspaces\stopshadow\space
\samplefile{tufte}\removeunwantedspaces\space

\startshadow[contrastcolor=red,weight=100,dx=0,dy=0]\blue\samplefile{tufte}\removeunwantedspaces\stopshadow\space
\samplefile{tufte}
\blank
\setupshadows[shadowed][unit=pt,dx=.5,dy=-.5,weight=200]
\shadowed{\bfd Tufte\setstrut\strut}
\stopTEXpage


Hans


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fwd: outlinetext broken?

2024-05-14 Thread Hans Hagen via ntg-context

On 5/13/2024 11:54 PM, Jairo A. del Rio wrote:



-- Forwarded message -
De: *Jairo A. del Rio* <mailto:jairoadelr...@gmail.com>>

Date: lun, 13 may 2024 a la(s) 9:53 p.m.
Subject: Re: outlinetext broken?
To: Hans Hagen mailto:j.ha...@xs4all.nl>>


Hi, Hans! Thank you for the update! I'm curious about the following 
issue: when I use Latin Modern (by default), a thick, filled line is 
drawn next to the radical. However, when I use another font such as TeX 
Gyre Schola, I get something similar to outlines-003.pdf, which is, in 
turn, similar to the result of applying PDF effects. So, shouldn't this 
result be the default? Thanks a lot again.
it depends on how a radical is composed; we try create an extensible 
using snippets which looks better in the case of fontd where rules (have 
to) have roun dcorners etc


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


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

2024-05-12 Thread Hans Hagen

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


Can you try the latest binary from

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

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen

On 5/12/2024 5:36 PM, Fabrice Couvreur wrote:

Sorry for the comment !
I use Evince

so how about okular or mupdf

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


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

2024-05-12 Thread Hans Hagen

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

Hi,

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

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

\starttext

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

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

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

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

\stoptext

Can it be something from with my font file ?

\starttext

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

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

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

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

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

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

\stoptext


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen

On 5/12/2024 3:57 PM, Fabrice Couvreur wrote:

Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it 
doesn't seem possible: I don't understand.

Thanks
Fabrice

  \startMPpage[offset=1DK]

           numeric u;
           u = 6cm;

           interim linejoin := mitered;
           interim ahangle := 30;

           path xx, yy;
           xx = ( (-0.3,0) -- 1.4 right) scaled u;
           yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;

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


           for i = 1 upto 4:

           vardef f(expr x) =x+exp(-i*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;

           endfor;

           vardef f(expr x) =x+exp(-6*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;

           vardef f(expr x) =x+exp(-15*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;


           vardef f(expr x) =x+exp(-60*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not 
drawn


best put a comment before the ->>>>>>>


           draw curve withcolor blue;


           drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
           drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;


           label.urt("A",(0,1u));

           draw xx;
           draw  yy;

           draw (1u,0) -- (1u,1.8u);


           label.llft("0",(0,0));

            vardef mark_y_axis(expr value, name) =
             save p; pair p; p = value * u * up;
             draw (left--right) scaled 1 shifted p;
             label.lft(name, p shifted 2 left);
           enddef;

           for a = 1 upto 1:
             mark_y_axis(a, "");
           endfor

            mark_y_axis(1, "$1$");


          vardef mark_x_axis(expr value, name) =
            save p; pair p; p = value * u * right;
            draw (up--down) scaled 1 shifted p;
            label.bot(name, p shifted 2 down);
          enddef;

          for a = 1 upto 1:
            mark_x_axis(a, "");
          endfor

          mark_x_axis(1, "$1$");


           path rectangle;
           rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) -- 
(1.3u,1.4u) -- (-0.3u,1.4u)--cycle;


           clip currentpicture to rectangle;
          \stopMPpage


your exp usage:

  exp(-60*-0.4)

if you see what huge numbers come out of that, like

-51.006602 11100558579.857309 l
-50.989594 11034154639.123087 l
-50.972586 10968147929.149401 l
-50.955579 10902536073.687559 l
-50.938571 10837316710.703716 l

you could imagine a viewer crapping out on that because no matter what 
one clips it still is 'kind of drawn', so what viewer do you use?


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: outlinetext broken?

2024-05-11 Thread Hans Hagen

On 5/11/2024 8:33 PM, Jairo A. del Rio wrote:
As for the current ConTeXt, the example above still produces the wrong 
output. Can anyone reproduce this case? Thank you in advance. 

It's a bit tricky but this is what i can get ... see attached.

(You have to wait till a next upload.)

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
-


outlines-003.pdf
Description: Adobe PDF document
\continuewhenlmtxmode

\starttext
\startMPpage[offset=10pt]
draw lmt_outline [
text = "\mathematics{\sqrt{2}-1}"
] ;

draw lmt_outline [
text = "\mathematics{\sqrt[rule=no]{2}-1}"
] shifted (0,-1cm) ;

draw lmt_outline [
text = "\mathematics{\sqrt[rule=yes]{2}-1}"
] shifted (0,-2cm) ;
\stopMPpage
\stoptext

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: rendering arabic diacritics

2024-05-09 Thread Hans Hagen

On 5/9/2024 2:17 PM, Hamid,Idris wrote:

Hi Seyal,

See below:

-- Original Message --
 From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "seyal.zav...@gmail.com <mailto:seyal.zav...@gmail.com>" 
mailto:seyal.zav...@gmail.com>>; "mailing list 
for ConTeXt users" mailto:ntg-context@ntg.nl>>

Date 5/9/2024 3:31:45 AM
Subject [NTG-context] Re: rendering arabic diacritics


** Caution: EXTERNAL Sender **
On 5/9/2024 10:03 AM, seyal.zav...@gmail.com 
<mailto:seyal.zav...@gmail.com> wrote:

Hi all,
when i want to use the linked font for arabic texts it doesn't render 
diacritics properly

i doesn't have problem with this font in inkscape or libreoffice
what featureset should i apply?
font link:
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1hCcv6wqWjd-5GEKnaowh8E8YVbTgGqQr%2Fview%3Fusp%3Dsharing=05%7C02%7CIdris.Hamid%40ColoState.EDU%7C8e2b7a1a4eaf46f6b10808dc700b7b2a%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638508441848485171%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=51bK7I53UxZOK0PcbrYlpX2s%2Bdy%2BK83SslQZ%2BvhnvwU%3D=0
 <https://drive.google.com/file/d/1hCcv6wqWjd-5GEKnaowh8E8YVbTgGqQr/view?usp=sharing>
this is my MWE:
\definefontfeature [arabis]
[mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]
\definefont [Ahang] [file:Ahang-Regular.otf*arabis at 18pt]
\setupalign[r2l]
\starttext
{\Ahang تَشْكِيل كَسْرَة}
\stoptext

\definefont [Ahang] [file:Ahang-Regular.otf*arabic at 18pt]
but there is an issue with widths, ill send you a patch to test


The provided "*arabic" featureset should suffice for this font. Also 
TEXpage is useful for this kind of MWE:


\definefont [Ahang] [file:Ahang-Regular.otf*arabic at 18pt]
\setupalign[r2l]
\startTEXpage[offset=1em]
{\Ahang تَشْكِيل  كَسْرَة}
\stopTEXpage

In prehistoric ConTeXt version

    2023.09.26 18:19

the diacritics look fine in both ConTeXt and unicode editor MS Notepad.

So if there is something wrong, it must be in a more recent version.

For comparison: Before applying Hans' patch, could you kindly send your 
pdf of the MWE that shows the error? Mine is attached.
Ahang-Regular has no width settings for the marks so we need to zero 
them. Tahrir_Regular has widths but these we explictly need to zero with 
a pseudo feature then. (What are the assumptions when we do arabic? That 
marks are to have zero width?)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: rendering arabic diacritics

2024-05-09 Thread Hans Hagen

On 5/9/2024 10:03 AM, seyal.zav...@gmail.com wrote:

Hi all,

when i want to use the linked font for arabic texts it doesn't render 
diacritics properly
i doesn't have problem with this font in inkscape or libreoffice
what featureset should i apply?

font link:
https://drive.google.com/file/d/1hCcv6wqWjd-5GEKnaowh8E8YVbTgGqQr/view?usp=sharing

this is my MWE:
\definefontfeature [arabis]
  [mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]
\definefont [Ahang] [file:Ahang-Regular.otf*arabis at 18pt]
\setupalign[r2l]
\starttext
{\Ahang تَشْكِيل  كَسْرَة}
\stoptext


\definefont [Ahang] [file:Ahang-Regular.otf*arabic at 18pt]

but there is an issue with widths, ill send you a patch to test

Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: start/stopregister

2024-04-26 Thread Hans Hagen

On 4/26/2024 9:54 AM, Thomas A. Schmitz wrote:

On 4/26/24 9:30 AM, Thomas A. Schmitz wrote:
And here I am again! Both in mkiv and in mkxl, start/stopregister does 
not work when there is already an index entry before. Example below!


All best

Thomas

\setuppapersize [A6]

\starttext
 A\index{A} B \page
 A\startregister [index] {A} B\startregister [index] [B] {B}
 \dorecurse {10} {\input tufte}
 A\stopregister [index] {A} B\stopregister [index] [B]

\page

\placeregister[index]

\stoptext


And I'm not even sure if this is allowed to say anymore, but: works in 
mkii...

That's because mkii is AI enhanced. Can you try this:

\setuppapersize [A6]

\starttext

A\index{A} B \page


\stopregister [index] [A]
B>
\stopregister [index] [B]

\page

\placeregister[index]

\stoptext

(Watch the [A] vs {A} usage where [A] is the label used for matching the 
potentially weiord nested start/stop ... maybe we need different aliases 
for these, like \fromregister and \toregister.)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: start/stopregister

2024-04-25 Thread Hans Hagen

On 4/25/2024 4:51 PM, Taco Hoekwater wrote:




On 25 Apr 2024, at 16:45, Thomas A. Schmitz  wrote:

On 4/25/24 16:13, Henning Hraban Ramm wrote:

I’m using it like
\startregister[index][bibliografie]{Bibliografie}
…
\stopregister[index][bibliografie]
i.e. very similar to your example, and can confirm it doesn’t result in a page 
range in the index. Also gives no error.


Since I've become an expert on tuc files since yesterday (ha!): if I compare the tuc from 
a mkiv and a mkxl run, I see that mkiv produces an entry ["lastrealpage"]=9 in 
the references table, mkxl doesn't. This appears to be the relevant bit, and it is 
connected with the replacement of realpageno by c_realpageno in line 638 of strc-reg.lmt

references.lastrealpage = texgetcount(c_realpageno)


Let's seen if we can make Thomas more of an expert as he's zooming in on 
the issue:


extendregister {
metadata   = { name =  name },
references = { abel =  label },
}

Let me know if you't see it.


Possibly related: I noticed last week that mkxl does not update the legacy 
counter \pageno any more for every page.

i'll check it

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Hans Hagen

On 4/25/2024 4:08 PM, Fabrice Couvreur wrote:

Hi Taco,
I knew I wouldn't be able to explain what was happening.
The code works perfectly and the figure is clearly visible in the 
component chapter-14 :


\startcomponent[chapter-14]
\startMPpage
...
\stopMPpage
\stopcomponent

But if I compile my project, it disappears !!

\startproduct[terminale-manual]
  \startbodymatter
       \component[chapter-1]
       \component[chapter-2]
       \component[chapter-3]
       \component[chapter-4]
       \component[chapter-5]
       \component[chapter-6]
       \component[chapter-7]
       \component[chapter-8]
       \component[chapter-9]
       \component[chapter-10]
       \component[chapter-11]
       \component[chapter-12]
       \component[chapter-13]
       \component[chapter-14]
     \stopbodymatter
\stopproduct

-- compile with specific preceding chapters commented
-- when the interfering one is found, make a copy and strip till the 
problem is gone


it might be that you redefine something metapost

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: utiliydata

2024-04-25 Thread Hans Hagen

On 4/25/2024 9:25 AM, Thomas A. Schmitz wrote:




Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
structures.refrences.collected, but what about the next level

utilitydata.structures.references.collected={
[""]={
  [“REF"]={

What does the empty key do? And how do I retrieve the value of

REF.references.realpage?

Thomas


Sigh, as always: just when I had hit “send,” I figured it out:

structures.references.collected[""][REF].references.realpage

But I’m not sure if there is an easier/better way. And I still would like to 
know what the empty string as key does.
it's the prefix (namespace) which here is empty (easier to use "" as key 
than have some exception)


Hans



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: utiliydata

2024-04-24 Thread Hans Hagen

On 4/24/2024 5:41 PM, Thomas A. Schmitz wrote:

Hi all,

I’m slightly embarrassed because this should be easy, but I can’t figure out 
how to do this: in the tuc/tua file, I have the complete references of my 
document. How can I access it from within my Lua code? For instance, something 
like

utilitydata.structures.references.collected.”MyReference”.references.realpage

How can this be accessed?
grep for "job." (i bet you can figure it out and compensate the 
embaressment that way)


Hans


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why don't footnotes appear in floats or figures?

2024-04-22 Thread Hans Hagen via ntg-context

On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
I'm three days out from sending my work to an editor, and found some 
serious problem: many footnotes just aren't rendering.


I have a history text that uses ConTeXt-SBL for the citations, as such, 
it has lots of footnotes. Sometimes the footnotes are just in the main 
text, but sometimes also in figure captions, inside floats, inside 
tables that are inside floats, inside tabulations inside floats, etc.


What I find alarming is it is frequently not rendering all of the 
footnote messages at the bottom of the page. The actual footnote number 
within the body is rendered, but no number is listed in at the bottom of 
the page. So I might see a list of footnotes, for instance, on page 1, I 
only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.



---
1 message
2 message
3 message
5 message
6 message

After a lot of trial-and-error and checking logs and checking my BibTeX 
files for errors, running everything through BibTex Tidy, etc., and 
failures to make a minimum working example, I found a single pattern:


If the footnote marker appears on the SAME page as the footnote text, it 
has no problem rendering the footnote. But, if ConTeXt decides to move a 
float a page or two later on--as it frequently seems to do---such that 
the footnote marker and footnote text at bottom of page should be on 
DIFFERENT pages, the footnote message at the bottom of the page won't 
render.


I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
have issues with footnotes; they appear to be similar to my issue--is 
that still a problem? Is there a fix or workaround? Old fixes I could 
finding in the mailing list don't seem to work with current versions of 
ConTeXt anymore.

you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)

- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
\startplacefigure[location=here,title={test \footnote{oeps 1}}]
\blackrule[width=1tw]
here
\footnote{hello 1} and
\footnote{hello 2} and
\footnote{hello 3} done
\stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).


I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem





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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to isolate serious errors from warnings?

2024-04-19 Thread Hans Hagen

On 4/18/2024 8:26 AM, Henning Hraban Ramm wrote:

Am 18.04.24 um 02:09 schrieb Joel via ntg-context:
I'm about to have a lengthy (2,000+ page) document published. Normally 
if it compiles and looks okay, I regard that as meaning no errors 
appeared, but I've noticed that sometimes ConTeXt will still compile, 
even if something isn't displayed on screen as it should:


(1) I tried placing a table inside a startitemize environment, as 
instead of it not compiling, it left a message in the document warning 
that wasn't supported.


(2) In another case, I had an image that ConTeXt couldn't find, as I 
mispelled the filenmame, and it fully compiled and made a PDF, without 
me noticing.


(3) Or maybe in some case, a font couldn't be found for a specific 
character, so a single character in the file isn't displaying.


Those are just some examples; I intended for something to be printed 
on the PDF, but it isn't showing there.


Since a document of this size will have a lot of messages, is there a 
way to adjust the settings, from "show everything" to "show some" to 
"show only serious errors"? Or maybe to use > to send the errors to 
another file for careful study? (using Linux if that matters)


You can enable trackers like

\enabletrackers[figures.*]

But that just gives more log messages for debugging.

You get the list of all trackers with:

context --global m-trackers.mkiv


For your use case, directives are more helpful, like

\enabledirectives[logs.errors=*] (i.e. break at every error)

AFAIK that just handles missing characters, references and modules ATM, 
but this information might be outdated.


You get all directives with

context --global m-directives.mkiv


often the log files has some summaries at the end



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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Wiki - test/proposal to further clarify documentation

2024-04-17 Thread Hans Hagen

On 4/17/2024 8:32 AM, Thomas A. Schmitz wrote:




On 16. Apr 2024, at 21:56, Peter Hopcroft via ntg-context  
wrote:




On 17/04/2024, at 7:11 AM, Henning Hraban Ramm  wrote:

In my poster (still WIP) I wrote:
…


Excellent


No, I must admit I don’t like the first two paragraphs. The question is “what 
is ConTeXt,” and the answer is “we’re not LaTeX.” And why “infamous”?
I agree. It sounds the same as "we're not msword" or "we're not google 
docs". (In the end the only thing that latex and context have in common 
is that they use the tex language / ecosystem.)


Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Back in the 90s

2024-04-13 Thread Hans Hagen

On 4/13/2024 2:12 PM, Riviera Taylor wrote:

Hello,

I was reading about the history of ConTeXt in the Not So Short 
Introduction To ConTeXt and I have a historical question. I noticed that 
the PDF specification was published in 1993 yet ConTeXt was invented in 
1991. The book suggests that PDF output was handled by the PdfTeX engine 
in MKII in 2005. What sort of output did the software produce before 
PdfTeX was introduced? Was this the same as the output produced by the 
software before the publication of the PDF specification?
2005 is when we started with luatex which is a follow up on pdftex, and 
pdftex is more a mid 90's thing; we immediately adopted pdftex (which 
made some believe that context depended on pdftex which is not true)


anyway, we started with dvi which needs a postprocessor to go to some 
printer format like specific hp or more general postscript but also can 
drive viewers


we went from epson dot matrix printer -> early 300 dpi laser -> 600 dpi 
laser printer -> high speed oce 512 dpi printer (metric) -> high speed 
oce 600 dpi printer (+ crappy canon color laser printer) -> fast 
page-wide hp color inkjet office printer


in mkii all is controlled by backend drivers, that use so called 
specials to support color, hyperlinks, images so a workflow can have


- dvipsone : high quality postscript
- dviwindo : viewer with typeone support and hyperlinks
- acrobat  : postscript to pdf

and as all these external backends have their demands we could handle 
all these things in an abstract way (that way one could also drive 
printer properties like duplex or paper bins etc from a tex job)


that meant that when pdf came around we could almost immediately support 
most of the interactive features in a dvi -> ps -> acrobat workflow


when pdftex came around the intermediate step of postscript could be 
avoided which btw was also possible with dvipdfm(x) so we also supported 
that


so to summarize, it went from

tex -> dvi -> printer format
tex -> dvi -> postscript -> more generic printer format
tex -> dvi -> pdf -> print from acrobat
tex -> pdf -> print from pdf viewer

in the meantime we are pdf (as from that one can produce other formats)

Hans

(btw, the fact that we could easily support pdf was also a reason why at 
that time some adobe folk in nl used documents produced by context to 
show somewhat extrems usage of interactive features, thanks to the fact 
that tex can adapt to such new situations, also via the dvi route in 
this case with pdfmarks; at that time pdf usage - and features - was a 
bit more dualistic: ps replacement format versus storage and preview 
format, but that's a different story; but it still shows in how the 
standard evolved)


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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Most recent context doesn't like synctex?

2024-04-13 Thread Hans Hagen

On 4/13/2024 12:39 AM, Jim wrote:

Hi,

I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
system.

Recently, the stand-alone ConTeXt distribution seems to not create a
synctex file any more.  Specifically,

 /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
--synctex=1 --nonstop file.tex

does not create a .synctex file (and deletes it, if it is there), whereas
the TeXlive version

 /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
--synctex=1 --nonstop nwg_newsletter_2024_04.tex

does create the .synctex file.


The ConTeXt distribution version *does* create the file if --nonstop is
*not* used.  Knowing that, I can work around this for now, although
emacs+auctex probably won't be happy without --nonstop.

I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
that.

Is this a bug introduced by some recent change?

it's more a feature

- Mikael S and i spend some time with editor/viewer combinations on 
linux in order to find ways around the different synctex libs that they use


- as a result we could make most work ok

- we assume that synctex is set up in the document with

\setupsynctex[state=start]
\setupsynctex[state=repeat] % less efficient but gets around issue

- when context is run 'headless' (on a server) it's often done in 
batchmode because one knows that the style works and in that case 
synctex makes no sense so we disable it; this avoids the need to patch 
the style


- the manual has been updates

- running context in nonstop mode makes little sense

(maybe, as power user, Mikael remembers more details)

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \luaescapestring in proper Lua

2024-04-11 Thread Hans Hagen via ntg-context

On 4/11/2024 5:07 PM, Pablo Rodriguez via ntg-context wrote:

On 4/10/24 21:48, Hans Hagen via ntg-context wrote:

On 4/10/2024 7:49 PM, Pablo Rodriguez via ntg-context wrote:

[...]
I wonder whether there is a proper way in the Lua code to avoid
[[\luaescapestring{}]] in \ctxlua.
[...]

  context(tokens.scanners.string())


Many thanks for your reply, Hans.


\protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}}


Sorry, but why \protected is required or recommended here?


depends if you want it to be expandable

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-11 Thread Hans Hagen via ntg-context

On 4/11/2024 5:25 PM, Pablo Rodriguez via ntg-context wrote:

On 4/10/24 22:28, Denis Maier wrote:

[...]
   context --luatex --generate


Thanks, Pablo.
I've tried it, but it doesn't seem to work...


I get the same result on Win64 when I move the luatex binary from the
tex/texmf-win64/bin/ directory.

This may sound stupid, but could you check whether the bin directory
contain the required binary?

Sorry, "luatex --version" and even "whereis luatex" should give the same
result (but on Windows, it seems to be https://ss64.com/nt/where.html).

I hope it may help,

it searches for mtxrun.lua and contextl.lua in the same path so you need:

luametatex.exe
mtxrun.exe (can be link to luametatex.exe)
context.exe (can be link to luametatex.exe)
context.lua
mtxrun.lua

all in the same (bib) path

... always has been so ...

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: \luaescapestring in proper Lua

2024-04-10 Thread Hans Hagen via ntg-context

On 4/10/2024 7:49 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \starttext
   \startluacode
   function document.print_the_thing(str)
 context(str)
   end
   \stopluacode

   \unexpanded\def\PrintTheThing#1{%
 \ctxlua{document.print_the_thing([[\luaescapestring{#1}]])}}

   \PrintTheThing{a \em b {c}}
   \stoptext

I wonder whether there is a proper way in the Lua code to avoid
[[\luaescapestring{}]] in \ctxlua.

BTW, [[\luaescapestring{}]] in \ctxlua works better for me, since in my
real world document, I’m using str:match() to check whether the string
ends with interrogation or exclamation marks ("%?!$").

\starttext
  \startluacode
  function document.print_the_thing()
context(tokens.scanners.string())
  end
  \stopluacode

  \protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}}

  \PrintTheThing{a \em b {\bf c} d}
\stoptext

bonus:

  test!\removepunctuation ?

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Figure reference failing

2024-04-10 Thread Hans Hagen

On 4/10/2024 1:30 PM, Taco Hoekwater wrote:




On 10 Apr 2024, at 13:04, Willi Egger  wrote:

Hello,

It seems, that the referencing mechanism is failing. I detected this with the 
January version and the current version: 2024.04.01 08:59.

Could some one confirm this?


It fails for me as well, when "mode=columns" is used.

compare with and without mode columns:

\starttext

\enablemode[columns]

As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} 
we can have

more than one cell in a row.

\startplacetable[mode=columns,reference=demo-1]
\externalfigure[cow][width=\textwidth]
\stopplacetable

\samplefile{tufte}

\stoptext

so basically we have an "at the spot" placement or a float

Hans

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

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


  1   2   3   4   5   6   7   8   9   10   >