[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-19 Thread Hans Hagen

On 9/19/2024 1:03 PM, Gerion Entrup wrote:


What is the meaning of \hss here? It seems to work just fine without it.


a left over from trial and error

-
  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: Table and rotation: push together 45 degree rotated cells

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

On 9/19/2024 7:54 AM, Mikael Sundqvist wrote:

Hi,

On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  wrote:


Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 18.09.2024 um 14:44:

Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:

Hi,

I want to typeset a table where some of the column headings are really long, 
while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 degrees (I 
found some solutions for that) but 45 degree.

It then would be beneficial to push together the rotated cells, so the text of 
one cell actually starts above the previous cell.
Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European turtle 
dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
\bTD \digits{2} \eTD \eTR
\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is typeset right and 
above of "Water buffalo" so that the single columns have a width that is similar to the 
width of the single digit coming in the second row.


To visualize this, I patched the PDF of the above example to the desired 
result. See the attachment.


You can use Metapost.


Thanks for this solution. It, however, seems to fail with any other angle than 
315° (I tested 305, 325 and 314).


Try

   
xyscaled(\the\struttotal,abs(sind(\MPvar{rotation}))*\the\widthofstring{\MPvar{text}});

with sind instead of sin. And maybe with abs around it, but one can
think of improvements for smaller angles. It all depends on what one
wants.


here is an alternative

\bTABLE[frame=off]
  \bTR[align={middle,low}]
\bTH \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
Water buffalo}\hss} \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
Mexican redknee tarantula}\hss} \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
European turtle dove}\hss} \eTH

  \eTR
  \bTR[frame=on,align=middle]
\bTD Amount of legs \eTD
\bTD[width=3em] 4 \eTD
\bTD[width=3em] 8 \eTD
\bTD[width=3em] 2 \eTD
  \eTR
\eTABLE

and yes, i needed to trial and error 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: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Hans Hagen

On 9/18/2024 10:53 PM, Wolfgang Schuster wrote:

Gerion Entrup schrieb am 18.09.2024 um 14:44:

Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:

Hi,

I want to typeset a table where some of the column headings are 
really long, while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 
degrees (I found some solutions for that) but 45 degree.


It then would be beneficial to push together the rotated cells, so 
the text of one cell actually starts above the previous cell.

Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, 
low}]

\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD 
\tablerotate{European turtle dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD 
\digits{8} \eTD \bTD \digits{2} \eTD \eTR

\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is 
typeset right and above of "Water buffalo" so that the single columns 
have a width that is similar to the width of the single digit coming 
in the second row.


To visualize this, I patched the PDF of the above example to the 
desired result. See the attachment.


You can use Metapost.

\startuseMPgraphic{tableheader}{text,rotation}

   label.lft("\strut\bf\MPvar{text}",origin)
     rotated \MPvar{rotation}
     shifted (\the\strutht,0);

   setbounds currentpicture to unitsquare

xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}});

\stopuseMPgraphic

\starttext

\bTABLE[frame=off]
   \bTR[align={middle,low}]
     \bTH \eTH
     \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader} 
{text=Water buffalo,rotation=315} \eTH
     \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader} 
{text=Mexican redknee tarantula,rotation=315} \eTH
     \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader} 
{text=European turtle dove,rotation=315} \eTH

   \eTR
   \bTR[topframe=on,align=middle]
     \bTD Amount of legs \eTD
     \bTD 4 \eTD
     \bTD 8 \eTD
     \bTD 2 \eTD
   \eTR
\eTABLE

\stoptext


Neat. Added to the test suite.

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

2024-09-17 Thread Hans Hagen

Hi,

I uploaded a new version. Apart from some things discussed here already 
the main update is in par passes (a bit more control, feedback, tracing 
etc) which will be explained over time (we're writing a wrapup).


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: Validation of pdf/A-2a

2024-09-14 Thread Hans Hagen

On 9/14/2024 10:14 AM, Thomas Meyer wrote:

I can only emphasise that I am just a user who keeps turning to lists 
for support.


Which is what the list is for, so okay,

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: Validation of pdf/A-2a

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

On 9/13/2024 9:51 AM, Thomas Meyer wrote:
Oh, I'm afraid that my “I hope for the future.” has now led to a 
misunderstanding.


I would like to archive my documents as pdf/A-2a. As a reference to the 
German Bundesarchiv, which recommends pdf/A-2a in the first instance - 
and pdf/A-2u in the second.


I simply noticed that, as described in my initial email, the pdf/A-1a 
and pdf/A-2a variants do not pass the validation test with verapdf.


Since there seems to be no way around this, I will probably have to fall 
back on the second recommendation.


You cna try this:

\setupinteraction
  [title=TITLE,
   subtitle=SUBTITLE,
   author=AUTHOR,
   keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

\setupbackend
  [format={pdf/a-2a},
   profile={default_cmyk.icc,default_rgb.icc,default_gray.icc}]

\setuptagging
  [state=start]

\enabledirectives
  [backend.usetags=mkiv]

\starttext

\chapter[chap:testing]{Testing}

\input knuth

\input tufte

\stoptext

This validates in the verapdf that i have installed (1.25.271).

So, you choose some standard (which we try to accomodate as good as 
possible but who knows ... this one is a bloated one due to the icc 
profiles). As you want tags we enable that (no need for it as long as 
one is not finished with the document unless one wants to trace). We 
also load the the old school mkiv mapping.


You can define your own mappings if needed. After looking into the 
latest greatest volatile specifications Mikael and I decided that we 
don't want to be waste too much time on it (at least not now as we hav 
emore interestign thinsg to work on) and settled for what validates and 
let users themselves decide. We mostly aim(ed) at making the university 
enforced tools happy.


Structure in pdf is (to put it mildly) a mess, insufficient and never 
will be (conceptually) okay, which is probably why it keeps being 
adapted to what some applications can support or not. We don't want to 
cripple what structure in ConTeXt we have. For the long time 
accessibility tagging (there are other kinds of tagging being in use) 
has been around for a quite vwhile now it has been the domain of acrobat 
professional toolkit so in a broader context it is kind of useless anyeay.


(One can wonder what organizations demanding it really have in mind, 
given that older stuff doesn't validate and probably no one ever checked 
how useful it is. But that's often the case with standrads like this: 
some checkbox ticks so we're okay.)


So, the best we can do is to provide some flexibility, as usual in tex 
tools,


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: Validation of pdf/A-2a

2024-09-12 Thread Hans Hagen

On 9/12/2024 7:01 PM, Thomas Meyer wrote:

Hello Hans,

thank you for your answer for now.
\setupbackend[format=pdf/ua-2] should work but validation test via 
verapdf failed.

I hope for the future.


Because we don't want a bloated pdf by default, if you want tagging then 
you also need to set:


  \setuptagging[state=start]

and you can try with

  \setupbackend[format={pdf/ua-2}]

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: Validation of pdf/A-2a

2024-09-12 Thread Hans Hagen

On 9/12/2024 5:50 PM, Thomas Meyer wrote:

Thank you, Jakob, for your answer,

I didn't think that my example was too complex.
pdf/A-2a works with ConTeXt, it is recognized as pdf/A by FoxitReader. 
However, I would like the result to be valid, as with pdf/A-2u.


Does anyone else have any tips or ideas? Is it not that important?


i have no time for validation / tagging now but you can try

% \setupbackend[format=pdf/ua-2]
% \setuptagging[state=start]

we will pick up on tagging etc in a couplke of months ... the pdf 
standard is not as stable as one thinks nor are these validators so it's 
a waste of time to continously look at it (and no fun either) so that 
goes in batches


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 use Adobe Acrobat Reader (free) as the pdf viewer when compiling file in Windows Terminal (Windows)

2024-09-10 Thread Hans Hagen

On 9/10/2024 9:22 PM, Jim wrote:

On Tue, Sep 10, 2024 at 05:52 (-), Felix  wrote:


I want to use Adobe Acrobat Reader (free) and I always get this message when I 
have my Windows Terminal, vs code and acrobat setup



backend > quitting because file 'Chapter 4 Assignment.pdf' cannot be 
opened for writing



I run into no problems with using sumatra or okular, but Adobe Acrobat free 
seems to have this problem. Is there a way to fix this? The way I run context 
on windows is by making the doc in vscode (no extension, just plain vscode), 
compiling in Windows Terminal and using a pdf viewer to then view stuff.


As part of TeXlive there is a program called pdfopen (and a companion
program called pdfclose) which may (or may not) help you out if you wish to
continue using acroread.

I am the last maintainer (as far as I know!) of the Linux version of this
program for TeXlive.  I never use windows, but my understanding is there is
(or was) a version for windows.  You might want to look to see if you can
find this.
irr it originates in fptex for windows (by fabrice) so there should be 
some binary but the problem is that the api to acrobat changed over time 
so it had to be adapted occasionally


acrobat : pdfopen --rxi --file filename
fullacrobat : pdfopen --axi --file filename

pdfclose -- file filename

was the interface but as i never use acrobat in an edit-view flow it 
looks that i didn't bother to keep it on my machine


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: Is \not still supported?

2024-09-08 Thread Hans Hagen

On 9/8/2024 5:19 PM, Wolfgang Schuster wrote:

Hi,

is the \not command still supported in math mode or should users replace 
it with the combined form, e.g. \notin instead of \not\in.


 begin example
\starttext

\im{x \in M}

\im{x \notin M}

\im{x \not\in M}

\stoptext
 end example

indeed, because old school \not was a symbols that got overlayed.

we could of course make some clever not but i hav eto discuss that with 
MS .. if there are \not cases at all


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: Steps to become a ConTeXt developer

2024-09-08 Thread Hans Hagen

On 9/8/2024 12:12 PM, Wolfgang Schuster wrote:

Hans Hagen via ntg-context schrieb am 28.08.2024 um 20:18:

On 8/28/2024 5:06 PM, Henning Hraban Ramm wrote:

There’s also the scite module that uses SciTE’s lexers for syntax 
highlighting. The builtin highlighters are limited to TeX/ConTeXt, 
MetaPost, Lua and XML.
They are actually just lpeg lexers that we made for use in scite so no 
scite installation is needed.


Which highlighter should extended when support for additional languages 
is needed, the built-in one or the scite version?
probably easiest is the built in but if one wants to nest them then the 
scite ones are aeasier (in a way the scite ones are like the built in 
ones but they provide data structures that accomodate scite and as a 
side effect i then added nexting)


for most languages the simple ones are good enough (no need to have real 
parsers, just coloring keywords an dspecial symbols)


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 beginner, What should I enable within font features? And how do I see all the options possible?

2024-09-05 Thread Hans Hagen

On 9/6/2024 12:02 AM, Marcus Vinicius Mesquita wrote:

Hi, Felix


In linux, to find the GSUB/GPOS features of a opentype face you can
use the command

otfinfo -f fontname.ttf

otfinfo is part of the lcdf-typetools package

context always shipped with this:

mtxrun --script font --info --all --list --pattern=pagella*

which also can generate the font database.

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: \ldot and \ldotp not working

2024-09-05 Thread Hans Hagen via ntg-context

On 9/5/2024 4:12 AM, Aditya Mahajan wrote:


Thank you Wolfgang and Hans. My old documents compile now, so I can wait for a 
proper fix.

fixed in next upload

-
  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: \ldot and \ldotp not working

2024-09-04 Thread Hans Hagen

On 9/4/2024 8:53 PM, Wolfgang Schuster wrote:

Aditya Mahajan schrieb am 04.09.2024 um 05:58:

Hi,

With context 2024.08.16 the following gives an error:

\starttext
$A \ldot B$
\stoptext

tex error   > tex error on line 2 in file ./test.tex: Control 
sequence expected instead of undefined



 $A \ldot
  B$

Same error with `\ldotp`.

However

\starttext
\show\ldot
\show\ldotp
\stoptext

gives


\ldot=permanent \Umathchar"02"00"2E
\ldotp=permanent \Umathchar"06"00"2E


which appears correct.

So, not sure what is going on. Any ideas?



I have no idea what's the cause for the error but I can narrow it down.

When you replace \ldot with it's mathchar version you can reproduce the 
error when there is *no* space at the end, \ldots on the other hand has 
no problem without the space.


\starttext

No space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026\Umathchar"19"00"002026 $ % \ldots

Space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026 \Umathchar"19"00"002026 $ % \ldots

No space at the end of \tex{Umathchar}:
% $\Umathchar"02"00"2E\Umathchar"02"00"2E $ % \ldot

Space at the end of \tex{Umathchar}:
$\Umathchar"02"00"2E \Umathchar"02"00"2E $ % \ldot

\stoptext

Wolfgang

good analysis ... quick hack to get Aditya going ...

\appendtoks
\amcode\commaasciicode\zerocount
\amcode\periodasciicode   \zerocount
\amcode\semicolonasciicode\zerocount
\to \everymathematics

i need to ponder this (too late 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: pdf properties

2024-08-29 Thread Hans Hagen

On 8/29/2024 1:29 PM, Thomas Meyer wrote:

Thank you, Hans,

I see it in the Terminal but I not really know to work with it.
Sorry, I need more help.

well ...

>context oeps --ownerpassword=hans --userpassword=hans 
--permissions=access,print


i've added reporting of permissions to

>mtxrun --script pdf --info oeps.pdf --ownerpassword=hans 
--userpassword=hans


so one gets this:

mtx-pdf | filename  > oeps.pdf
mtx-pdf | pdf version   > 1.7
mtx-pdf | major version > 1
mtx-pdf | minor version > 7
mtx-pdf | number of pages   > 1
mtx-pdf | title > Häns Hägen
mtx-pdf | creator   > LuaMetaTeX 2.11.05 20240828 + 
ConTeXt LMTX 2024.08.26 18:05

mtx-pdf | producer  > LuaMetaTeX
mtx-pdf | author> 
mtx-pdf | creation date > D:20240829164734+02'00
mtx-pdf | modification date > D:20240829164734+02'00
mtx-pdf | page mode > UseNone
mtx-pdf | encrypted > yes
mtx-pdf | permissions   > access print
mtx-pdf | cropbox   > pages: 1-1, width: 17.791482016, 
height: 22.680846484


(in next upload, i had to take care of decrypting strings)

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: pdf properties

2024-08-29 Thread Hans Hagen

On 8/29/2024 9:43 AM, Thomas Meyer wrote:

Hi,

how can I set the pdf document properties with ConTeXt. For example, so 
that a document can be printed but not copied, etc.

context --help --expert

mtx-context | --ownerpasswordencrypt the (pdf) file using 
this master password
mtx-context | --userpassword use an additional password for 
opening the document
mtx-context | --permissions  list of: print, modify, 
extract, add, fillin, assemble, quality

mtx-context |


-
  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: Steps to become a ConTeXt developer

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

On 8/28/2024 5:06 PM, Henning Hraban Ramm wrote:

Also, Hans announced to include some "2.5D" functions (perspective 
projections) into MetaFun soon. That might obsolete some uses of 
Asymptote. But a proper 3D model for MetaPost seems to be missing (not 
my expertise).


Indeed, Mikael and I have plans to look into it ... a pet project for 
metapost lovers.


There’s also the scite module that uses SciTE’s lexers for syntax 
highlighting. The builtin highlighters are limited to TeX/ConTeXt, 
MetaPost, Lua and XML.
They are actually just lpeg lexers that we made for use in scite so no 
scite installation is needed.


Hans

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

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

maillist : ntg-context@ntg.nl / 
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: Steps to become a ConTeXt developer

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

On 8/28/2024 12:01 PM, Shiv Shankar Dayal wrote:

You have been following this mailing list for a very very long time
already, so you should be to some extent familiar with ConTeXt and
what you would like to achieve. Be more specific.

Mojca


I have two specific interests. I want to make asymptote work with ConTeXt
but I can live with including generated images and use PDFs.


There is zero change that that will be integrated as it introduces a 
(long term) dependency. It's pretty much geared at latex anyway and we 
would need some backend that fits in. We already have metapost (and will 
extend that over time).


It is however possible to load libraries at runtime as we can do with 
some optional libraries (these linbraries themselves are not included 
either but loaded on demand). One can add extra ones locally in which 
case we don't have to worry about the style of their interface. Of 
course that also means maintaining them as one needs to keep an eye on 
(changing) api's.


Keep in mind that if you do that you need to maintain it for decades to 
come. We also have a foreign interface (no ffi but kind of) but afaik no 
one ever showed interest in that.


With respect to external pdf files ... there are several ways to 
optimize that and only process files when they change as we do with 
other inclusions.



The second interest is in Aditya Mahajan's syntax highlighting module.
It is very nice but it invokes VI making the entire thing slow. I understand
the advantage of using VI is that we do not have to implement anything
when a new language comes. VI will have syntax highlighting and it will
be automatically done for us.


Again, when one caches these snippets there is little overhead involved. 
One could look into some socket communication but language servers tend 
to be huge and evolving. But of course one can play with that in a local 
variant, after all the engine code is included in the context distribution.


Syntax highlighting is kind of personal anyway, we have soem 
'reference'highlighting (which reflects how contetx is codes) but that 
is also personal. No solution suits all.


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: Steps to become a ConTeXt developer

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

On 8/28/2024 10:57 AM, Shiv Shankar Dayal wrote:

On Wed, Aug 28, 2024 at 8:17 AM Jethro Djan  wrote:


Hi,

Not sure what you mean by a core ConTeXt developer. I think, as with anything, 
you get better at it by using it extensively. I would focus on a use case of 
interest and take advantage of ConTeXt’s unmatched extensibility to automate 
much of it as possible. Then you ask for help when you get stuck.

If you want to contribute to ConTeXt, maybe start by having a look at the 
source and try to understand what’s going on (should be accessible to you since 
you are a C developer). If you identify a bug, or want to propose a feature, I 
am sure the community will support you however it can.

Jethro


I want to contribute to ConTeXt. I think that the steps for me should be:

Just curious: is there something that you miss.


1. Learn TeX
2. Learn LuaMetaTeX


Makes sense.


and then I can approach the C code. It won't make any sense if I just
start reading the LuaMetaTeX code.
Development of LuaMetaTeX (the engine) is mostly finished. We now 
entered the stage where we conduct experiment with the more difficult 
aspects (often unsolvable due to constraints). For that one needs to be 
quite a bit experienced in tex and the way context approaches things.


As an example, project like updating math took many man-years and 
intense testing, discussion and experimenting (so also quite some long 
term commitment). In a similar fashion (and related) we now are playing 
with the par and pagebuilder where user input and testing is required. 
Things like that get discussed at meetings and personal cummunication.


The source code is under rather stict dev regime. We don't want to break 
compatibility, all has to fit into the user interface, performance might 
not be impacted significantly. We don't have an official dev team but 
everone knows what the de-facto team is (last week those that had time 
and were within reasonable traveling distance met at the context 
meeting) and it's also a kind of friends and fun thing where everyone 
brings in competence and inspiration. At such meetings we also set the 
objectives for the next year.


That said, the usual way to come up with something that a user needs is 
to use a mix of lua, tex and metapost and wrap that in a module. That 
way the core is not crippled. Also, no all has to go into the engine but 
is done in Lua.


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: Is there a way to apply withpattern to text, like fillcolor in lmt_outline[].

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

On 8/28/2024 10:05 AM, ai2472206...@yeah.net wrote:

hi ,
Is there a way to apply withpattern to text, like fillcolor in lmt_outline[].

what I envisaged:
https://imgse.com/i/pAAkfjf

I've found someone who has asked a similar question,
just a combination of the two functions : lmt_outline[] and  lmt_shade[] in 
that question.

question from
https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/thread/D5GBGF3RXN75UGZVHX6LDY7LXGGZKMHR/#7JS33W44JDJM355TDDPY5L4R7FJQ6QLZ

However, this example didn't work successfully on the Mac,
it just showed a background color block.

\starttext

\startMPpage
 path tt ; tt := lmt_outline [
 kind = "outline",
 text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
 ] xsized 12cm ;

  %  fill tt
  % withshademethod "linear"
  % withshadedirection down
  % withshadecolors (red, blue) ;

 draw tt
withpattern image (fill fullcircle scaled 5mm withcolor 
"darkgreen" ;)

withpatternscale (1/200,1/40) ;

\stopMPpage

\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: BUG REPORT: Italic Correction in ConTeXt LMTX

2024-08-27 Thread Hans Hagen

On 8/27/2024 5:20 PM, Vladimir Grbić wrote:

Thank you all, I am looking forward to it being fixed.
keep in mind that there is no italic correction in open type fonts so we 
use (in lmtx) different trickery which is why we also have left 
correction; there is also some enabled 'autromatic' correction wrt 
punctuation after italic math


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: About the font used in the document mathincontext-paper.pdf

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

On 8/27/2024 3:37 PM, Marcus Vinicius Mesquita wrote:

pdffonts mathincontext-paper.pdf lists quite a bunch of fonts named
ContextRuntimeFont1 … ContextRuntimeFont17. I'm curious to know what they are.
as the names indicates ... they are runtime generated ... they can coem 
from verious assemblies, like extensible delimiters, tweaked glyphs, 
generated from metapost glyphs, glyphs made from various pieces, etc. 
but are in the end just characters (in type 3 format)


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: BUG REPORT: Italic Correction in ConTeXt LMTX

2024-08-27 Thread Hans Hagen

On 8/26/2024 8:32 PM, cont...@vladimirgrbic.com wrote:

Hello,

I started using ConTeXt LMTX 2 days ago and after some initial testing I 
noticed an unexpected behavior regarding italic correction.

In short, I cannot seem to produce italic correction like I could in plain TeX 
or even LaTeX.

There are three ways:

the{\sl air\/}port

the{\em air}port

the{\sl\shapecorrection[right]air}port

% shape correction can be left right both

the first one doesn't work but is fixed in next upload (sometime this week)

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: understanding units / dimensions

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

On 8/25/2024 2:15 PM, Wolfgang Schuster wrote:


How differs "1" from "2"?
* em fs


\startbuffer[dimensions]
\starttabulate
\NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
\NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
\stoptabulate
\stopbuffer

\starttext

\getbuffer[dimensions]

\setupbodyfont[14.4pt]

\getbuffer[dimensions]

\stoptext
Often they are the same (basically font units) but there can be some 
rounding going on; also bodyfont sizes are clipped


\starttext
\the\numexpr(\dimexpr1fs\relax/65536)*100\relax\par
\the\numexpr(\dimexpr1em\relax/65536)*100\relax

\the\dimexpr1fs\relax\par
\the\dimexpr1em\relax
\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: Installation problem

2024-08-25 Thread Hans Hagen

On 8/25/2024 2:45 PM, Thomas Meyer wrote:

Thank you.
Now it works again.
I tried to update but it doesn't had work. So I tried to download and 
the website was not reachable.

i'm replacing the machine with another so there can be drops

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: Does ConTeXt still support ePub output?

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

On 8/24/2024 6:25 PM, Henning Hraban Ramm wrote:

Unfortunately, the ePub at least doesn’t work with Calibre. I need to 
check what’s actually the problem.
Indeed we need to check the current state ... at that time there weer 
variations of the 'standards' and various devices expected different 
(maybe also deliberately, some lock in).


Mikael and I are currently updating the export (web first) so when we 
reach updating that bit it would be helpful to know what to do better.


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: Problem with Cambria

2024-08-16 Thread Hans Hagen

On 8/16/2024 3:10 PM, Lutz Haseloff wrote:

I have cambria.ttc in my OSFONTDIR.
If I Move it to texmf-fonts,
\doiffileelse and \doifelsefile recognize cambria.ttc.
that's the best approach ... the problem is that there are several 
cambrias and the names are a bit fuzzy so bets play safe with files


Hans

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

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

maillist : ntg-context@ntg.nl / 
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: Complete novice, why does it seem that LuaLaTeX (Compiled via LaTeX Workshop with MikTeX and added packages on Windows) will generate a more compact result than ConTeXt?

2024-08-13 Thread Hans Hagen

On 8/13/2024 8:30 PM, Wolfgang Schuster wrote:

Hans Hagen via ntg-context schrieb am 13.08.2024 um 17:40:

On 8/13/2024 4:49 PM, fm117...@students.panola.edu wrote:
Hello, ConTeXt mailing list! I have a question regarding a difference 
in the code that I have which uses the same paper size and margin 
settings, and also the same indentation rules and font size and font. 
It seems that ConTeXt (which I compiled via Windows Terminal, this 
*is* the proper way to compile ConTeXt docs, right?) seems to make 
text that is less... compact, and I am not sure if this is due to me 
not adding features that I **should** have turned on in ConTeXt when 
using Times New Roman that is installed by default on Windows. I also 
was not able to get a "proper (?)" single quote like when Word or 
LaTeX compiles "Don't", that ' is a straight quote in the compiled text.


I also heard that ConTeXT would be much better for typography since 
it does have a more advanced typographical engine as the base (and 
this is a big reason as to why I want to switch to ConTeXt, pretty 
much everything is built in, I just can't understand documentation 
that well), and this may be because my code is very basic and I do 
not know how do properly do ConTeXt. Is it possible that ConTeXt also 
has a more "correct" way of formatting? Anyways, thank you for 
reading and taking the time to read this post.


LuaLaTeX code: https://pastebin.com/p5aWxAyK

ConTeXt code: https://pastebin.com/DsMnxMvY

Can you explain what you mean with less compact?


The default baseline distance of LaTeX is AFAIK 1.2 times the font size, 
adding


     \setupinterlinespace [line=1.2\bodyfontsize]

to the document setup should produce similar results with ConTeXt.
that interlinespace is kind of bad as it can lead to inconsistent line 
spacing


[dp \the\strutdp] \dorecurse{"}{%
\ifdim\fontchardp\font#1>\strutdp
   \char#1 \space
\fi
}

[ht \the\strutht] \dorecurse{"}{%
\ifdim\fontcharht\font#1>\strutht
   \char#1 \space
\fi
}

So, if oen really wants to go that cramped, maybe try

\setupinterlinespace [line=1.2\bodyfontsize,height=.75,depth=.25]

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: Complete novice, why does it seem that LuaLaTeX (Compiled via LaTeX Workshop with MikTeX and added packages on Windows) will generate a more compact result than ConTeXt?

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

On 8/13/2024 4:49 PM, fm117...@students.panola.edu wrote:

Hello, ConTeXt mailing list! I have a question regarding a difference in the code that I have which 
uses the same paper size and margin settings, and also the same indentation rules and font size and 
font. It seems that ConTeXt (which I compiled via Windows Terminal, this *is* the proper way to 
compile ConTeXt docs, right?) seems to make text that is less... compact, and I am not sure if this 
is due to me not adding features that I **should** have turned on in ConTeXt when using Times New 
Roman that is installed by default on Windows. I also was not able to get a "proper (?)" 
single quote like when Word or LaTeX compiles "Don't", that ' is a straight quote in the 
compiled text.

I also heard that ConTeXT would be much better for typography since it does have a more 
advanced typographical engine as the base (and this is a big reason as to why I want to 
switch to ConTeXt, pretty much everything is built in, I just can't understand 
documentation that well), and this may be because my code is very basic and I do not know 
how do properly do ConTeXt. Is it possible that ConTeXt also has a more 
"correct" way of formatting? Anyways, thank you for reading and taking the time 
to read this post.

LuaLaTeX code: https://pastebin.com/p5aWxAyK

ConTeXt code: https://pastebin.com/DsMnxMvY
Can you explain what you mean with less compact? Can we assume that you 
are running the LMTX version? (luametatex engine)


\showframe

\setuppapersize
  [letter]
  [letter]

\setuplayout[
backspace=0.5in,
topspace=0.5in,
header=0in, % No headers
footer=0in, % Space for the footer
width=middle,
height=middle,
]

\setupbodyfont[termes,12pt]

\mainlanguage[en]

\setupindenting[yes,0.5in]

\startsetups document:start
\centerline{\documentvariable{title}}
\centerline{\documentvariable{author}}
\centerline{\documentvariable{date}}
\blank[line]
\stopsetups

\startdocument[title=Title,author=Author,date=Date]

...

\stopdocument


-----
      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: Nāgarī for Academics

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

On 8/11/2024 12:36 PM, Pablo Rodriguez via ntg-context wrote:

On 8/11/24 10:40, Jürgen Hanneder via ntg-context wrote:


Thanks again, in fact both are useful in different situations.
Jürgen


Just for the record, the following language short command and start stop
are defined for most languages (\it and \fi are already taken by TeX
[italics and conditional final command]):

   {\sa yoga}

   \startlanguage[sa]
   yoga
   \stoplanguage

Just in case it might help,

so, best use the more verbose tags

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: Breakable tcolorbox in ConTeXt

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

On 8/11/2024 11:24 AM, Florent Michel wrote:

Hi,

I am trying to reproduce the behaviour of the tcolorbox LaTeX package, 
more specifically breakable boxes (as illustrated here: 
https://tex.stackexchange.com/a/676607/123770 
<https://tex.stackexchange.com/a/676607/123770>). It works nicely out of 
the box (pun intended) using `\definetextbackground` and drawing the 
frame with MetaPost, using counters to keep track of whether the current 
text is at the top, middle, or bottom of the box. However, I'm having 
issues when one box ends and another starts on the same page (see more 
details below). From what I understand, the issue is that counters seem 
to be updated on a page-wide basis, so each MPgraphic ‘sees’ the values 
of counters at the end of the current page, which may not be right if 
another box modifies them. Would anyone know how to resolve this?


Based on two answer on TeX StackExchange 
(https://tex.stackexchange.com/a/486124/123770 
<https://tex.stackexchange.com/a/486124/123770> , 
https://tex.stackexchange.com/questions/377234/context-frame-problems/377261#377261 <https://tex.stackexchange.com/questions/377234/context-frame-problems/377261#377261>), the following code works well if there is no more than one box per page:


```


You're missing a feature:

this is the original trick:

if multilocs[i] == 1 :  % begin
elseif multilocs[i] == 2 :  % between
elseif multilocs[i] == 3 :  % end
fi ;

and in lmtx we have

if  multikind[i] = "single" :
elseif  multikind[i] = "first"  :
elseif  multikind[i] = "middle" :
elseif  multikind[i] = "last"   :

Also:

 path p;
  p := ( llcorner multipars[i]
 -- lrcorner multipars[i]
 -- urcorner multipars[i]
 -- ulcorner multipars[i]
 -- cycle )
 enlarged (EmWidth,EmWidth) ;
  fill p withcolor boxfillcolor ;

can be

fill multipars[i] enlarged (EmWidth,EmWidth) ...

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: Nāgarī for Academics

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

On 8/5/2024 11:31 AM, Jürgen Hanneder via ntg-context wrote:


I have a few questions concerning the commands for setting up Indic 
Fonts, specifically
for the use of Indologists and other academics dealing with Indian 
Languages.


I have been using the following command in older versions:

\definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one]
\setupbodyfont [nagari]
Example:   आनन्द

This seems to be out of date and for most academics (especially outside 
of India) it is preferable
to use Sanskrit in transcription (almost all databases use 
transcription) for input even if
printing in Nāgarī. For this we now seem to have the transliteration 
IAST to Devanagari (?)


What we need are thus three elements: switching the language to Sanskrit 
temporarily (the main
language will be english), setting the font for Sanskrit (let us say 
AsishilaSan),
and enabling input of sanskrit in transcription (input: ānanda -> output 
आनन्द).


Just a background note: Transcription and Nāgarī are not as equivalent 
as one would want. In
transcription some word divisions are indicated that are not indicated 
in a Nāgarī text, which
makes reading transcription easier — for those used to it. For most 
Indian scholars transcription
is understandably a nuissance, a bit like reading English in phonetic 
alphabets.


If someone could tell me how to get all these things into a few 
commands, I would be most

grateful. My own attempts, mostly trial and error, did not succeed.

You can take a look at

type-imp-indic.mkxl

which has some about transliterations (there is a subsystem for that)

Hans


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

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

maillist : ntg-context@ntg.nl / 
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: Alignments of margin notes

2024-08-01 Thread Hans Hagen

On 8/1/2024 2:50 PM, Taco Hoekwater wrote:

Hi,

Something seems wrong with the align processing inside \setupmargindata, 
because using a macro like

\def\Inmargin#1{\inmargin{\blank[-line]\startalignment[inner,nothyphenated]#1\stopalignment}}

works ok (the \blank[-line] is a side-effect of using the environment inside a 
margin text).

can you test with

\permanent\protected\tolerant\def\definealign[#1]#*[#2]%
  {\pushmacro\raggedcommand
   \pushmacro\updateraggedskips
   \edef\m_spac_align_named{#1}%
   \edef\m_spac_align_asked{#2}%
   \spac_align_add_to_cache
   \popmacro\updateraggedskips
   \popmacro\raggedcommand}

(in cont-new.mkxl after \unprotect)

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: upload

2024-08-01 Thread Hans Hagen

On 8/1/2024 9:21 AM, Henning Hraban Ramm wrote:

Am 31.07.24 um 19:55 schrieb Hans Hagen via ntg-context:

Hi,

end of the month update:

- we are still working on the math manual so updates there (we want 
the manual to stable for the upcoming meeting)


- we also work on the export (some changes and additions there but we 
will conver that plus some new tools later when we're done, read: are 
satisfied with what browsers can handle sort of well)


- wolfgang updated the setups (command definitions) so plenty of 
improvements and completion in there (he also did some quality assurance)


- all kind of small thingies (some to be introduced at the upcoming 
meeting were as usual we also discuss development and priorities)


- there are some new \setupalign options, like 'notwins', 'notoddlers' 
and 'noorphans' in case someone wants to be surprised


as usual when we run into unforseen issues we'll fix it,


I dared to update, since Hans’ & Mikael’s article for the journal 
required the latest version. (I wonder what \startimage is about…)


related to the export, we'll demo it at the meeting: formulas, metapost 
etc; here it is used to make an images file so that you don't need to 
update (i assumed that you'd turn the text into whatever the journal 
needs (if you render yourself best also check if the examples come out 
right)



Being careful, I did a parallel install, but all looks good so far.


no fundamental changes

My book went from 490 to 484 pages, must investigate, might just be 
better paragraph/page/table breaking or something like that. Or is 
automatical nonsense-removal now included?


run old and new and then

context --extra=compare old.pdf new.pdf

it might be some improvement in page crossing

My usual TTC problem (all Cambria is Bold Cambria) didn’t show after 
installation of the distribution, but resurfaced after installing all 
modules. ("mtxrun --script font --reload --force" helped as usual.)
there is an issue with cambria and name resolving, i'll send you an 
alternative typescript we've been testing


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: combining float counters

2024-07-31 Thread Hans Hagen

On 7/31/2024 8:43 PM, Henning Hraban Ramm wrote:
Hi, I defined new float types for special figure/caption placement, but 
would like to use the general figure counter. I didn’t find a setup for 
that. How can I do this?


pseudocode:


I assume you did:

\definefloat[myfigure][figure]

and then use \startmyfigure etc


\setupfloat[myfigure][
   counter=figure,
]

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


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

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


--

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

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

Hi,

end of the month update:

- we are still working on the math manual so updates there (we want the 
manual to stable for the upcoming meeting)


- we also work on the export (some changes and additions there but we 
will conver that plus some new tools later when we're done, read: are 
satisfied with what browsers can handle sort of well)


- wolfgang updated the setups (command definitions) so plenty of 
improvements and completion in there (he also did some quality assurance)


- all kind of small thingies (some to be introduced at the upcoming 
meeting were as usual we also discuss development and priorities)


- there are some new \setupalign options, like 'notwins', 'notoddlers' 
and 'noorphans' in case someone wants to be surprised


as usual when we run into unforseen issues we'll fix 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: How to hide any content?

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

On 7/30/2024 1:04 AM, Joel wrote:
By meaning it is a minimum working example, it demonstrates the problem, 
but not in all situations I use. Basically at the start of a chapter or 
section, I have tons of metadata. This is information in \index{} (and 
some custom index like \dateis that generates a time line), information 
placed in registers, some information loaded from an entire passage 
sometimes \include passage.tex (though not displayed, cuz it contains 
indexes, registers, etc.), and its always leaving this gap after the 
section title. I've used \starteffect[hidden] as one attempt to hide it, 
but it only makes it basically invisible, but still present. How to make 
it invisible and take up no space? Or can I hide all that information 
inside some part of the section title?

\startchapter[title=foo]

\index{xxx}

whatever

in this case there is no gap, and usign some 'effect' then actually  can 
be the reason for messing up spacing (as it goes into horizontal mode)


in the case of an index, just keep the command and don't place the 
register, no need to use effect as \index is not visible there anyway)


in the case of a footnote, just use the trick i mentioned and put the 
footnote in the title, not on a line of its own


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 can I force ConTeXt to display my footnote on the same page as my foot note marker?

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

On 7/27/2024 3:35 PM, ai2472206...@yeah.net wrote:

Hi,

I have a document that contains a lot of footnotes.
Therefore, I used to separate the footnote number from the footnote text,
which would make the source file look more readable.

Therefore, I used a similar approach to 'CASE 1', but not 'CASE 2' ,
placing footnotes related to the previous paragraphs every few paragraphs.
But when I was generating a PDF,
  I found that the footnote didn't always appear on the same page as its 
footnote number,
even though the footnote had very little text.

What can I do to get my idea to work?

Thanks for any suggestions.

  Muyik.


% The above text was translated through Bing
% because I am not a native English speaker.
% If there is anything unclear, whatever it is, tell me.

%%
\setuppapersize[A6]
\starttext

% case 1

\input knuthmath \note[1]

\input knuthmath \note[2]
\input knuthmath
\input knuthmath

\footnotetext[1]{\input knuthmath }
\footnotetext[2]{\input knuth }

% In this case, the text of footnotes 1 and 2 is placed on the same page,
% but they are separated from the footnote numbers on different pages

\page

% case 2

\input knuthmath \note[1]
\footnotetext[1]{\input knuthmath }

\input knuthmath \note[2]
\input knuthmath
\input knuthmath

\footnotetext[2]{\input knuth }

% Maybe this situation might get what I wanted, but after all,
% footnotes are not as important as the main text,
% and working on the footnotes while writing the main text may not be the right 
way for me

\stoptext
footnotes are implemented using inserts so the text, when entered is 
kept with the 'location' .. this permits the page builders to choose 
breakpoints that


decoupling the location and test itself should be done in a controlled 
way because otherwise a page break can already have been decided


\starttext

\startbuffer[note:1]
\input{knuthmath}
\stopbuffer
\startbuffer[note:2]
\input{knuth}
\stopbuffer

\input knuthmath \footnote{\inlinebuffer[note:1]}
\input knuthmath \footnote{\inlinebuffer[note:2]}
\input knuthmath
\input knuthmath

\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: How to hide any content?

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

On 7/29/2024 7:49 PM, Joel via ntg-context wrote:
Okay, it took me a while, but I finally found what I believe is a 
minimum working example:


\starttext

\chapter{test}\starteffect[hidden]\footnote{here is footnote 
text}\stopeffect

\input knuth

\input knuth

\stoptext

In this case, something that should not be displayed (the footnote 
mark), is not displayed, but it still creates an extra vertical space. 
If you highlight the text, you can see there is a blank text space 
created there.


Throwing % signs everywhere doesn't help at all:

\starttext%
%
\chapter{test}\starteffect[hidden]\footnote{here is footnote 
text}\stopeffect%

\input knuth %
%
\input knuth
%
\stoptext%
you anyway have to put such a note reference inside the title otherwise 
you create an insert node that for sure will mess up spacing


here's a trick .. i suppose that we can have a setting that supresses 
notes completely


\setupnotes
  [location=none]

\setupnotations
  [state=stop]

\starttext

\chapter{test\footnote{here is footnote text}}

\input knuth

\input knuth

\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: correcting Wikipedia

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

On 7/26/2024 3:27 PM, Pablo Rodriguez via ntg-context wrote:

On 7/25/24 21:56, Willi Egger wrote:

Hi Pablo,

thanks for making this correction, a pebble to improve Wikipedia…


Hi Willi,

I was more interested in not attributing ConTeXt to other person than
fixing Wikipedia as first intention.

That being said, it surprises me that so (relatively) many LaTeX users
know ConTeXt only by name.
That's all relative, isn't it? I know that msword exists and have seen 
it open but would be in trial and error mode as user. I simply never had 
a need for it. And I only used latex for one document decades ago, 
wrapped it into soem macros, and then moved on so basically I only know 
it by name.


That said, one can recognize anything tex by the backslash and curly 
braces (and editors etc highlighting helps). So I can recognize latex 
(with 99% accuracy when no commands similar to context are used) but 
then I'd need to buy and read a couple of few thousand page companions 
to get a moderate complex document done. I'm sure that doesn't surprise 
Willi.


Last context (and bacrhotex) meeting Harald played this 'can you 
recognize this language' game with the audience. One has to be real old 
(or curious and collecting languages) to be among the winners.


It's all about 'need to use something' and the definition of 'knowing'. 
I can recognize a tree but name a few.


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: request for talk/article on writing modules

2024-07-22 Thread Hans Hagen

On 7/22/2024 9:17 AM, Henning Hraban Ramm wrote:

Am 22.07.24 um 09:10 schrieb Taco Hoekwater:

Hi,


On 19 Jul 2024, at 17:06, Henning Hraban Ramm  wrote:

Hi wizards,
I’d really appreciate an introduction “how to write a ConTeXt module” 
at the meeting and in the next journal.


I’ll try to find some knowledgeable people for you.


Perhaps we can make it a workshop/discussion – take my new Chat module 
(because it’s not very involved module-wise) and discuss how to make it 
better (in the sense of a good ConTeXt citizen).

https://codeberg.org/fiee/context-chat

I can write a “lessons learned” article afterwards, if nobody else steps 
up.


you need to convince Wolfgang ...

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: 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 / 
htt

[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 

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


  1   2   3   4   5   6   7   8   9   10   >