[NTG-context] Re: images with alt text

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

On 9/21/2024 7:16 PM, Steffen Wolfrum wrote:

Hi,

as publishing houses (at least in Germany) are forced to provide «alt text» 
with their PDF-publications (from June 2025 on),
I need to know how «images with alternate text» 
(https://en.wikipedia.org/wiki/Alt_attribute) are typeset with ConTeXt LMTX.

In HTML it looks like this:



What is the equivalent in ConTeXt LMTX?


afaik there no such tag on an image in pdf so one has to wrap, i'll add

\startPDFalternativetext{when will the german government provide 
full acrobat for free (livelong) to developers}

\scale[s=3]{\rotate[rotation=30]{DE}}
\stopPDFalternativetext

to play with but integrating something more nice also will b emore 
confusing ... the problem is that anything can be an image (liek a mp 
picture)


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-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: 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: \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: 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: 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: 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: 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: 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 
). 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/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] 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: 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 


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


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



  * 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 


*Attempt #2*: Following 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 

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: 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 > 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: 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: 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  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: 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: 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: Combine \setupdelimitedtext with an author (define custom variable?)

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

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

Hi,

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

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

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

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

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


not all constructs hav ethese user variables (yet)

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

\starttext

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

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

\startsetups extract:start
\startdextract
\stopsetups

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

\starttext

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

\stoptext

but first i want Wolfgang to check the patch,

Hans

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

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

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


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

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

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

Greetings,

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


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

%\showboxes
\starttext

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


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

\input ward

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

\stoptext

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

best add a missing \stopplacecodelisting

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

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

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


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

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

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

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


numberstyle and textstyle : specific to the element

Hans


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

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

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


[NTG-context] Re: bug tracker

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

On 5/27/2024 3:46 PM, Peter Münster wrote:


Is there a bug tracker for ConTeXt?
(It seems, that https://tracker.luatex.org/ is no more used...)
just mail to the list as bugs are normally either solved fast or becoem 
features


Hans

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

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

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


[NTG-context] Re: luatex doesn't see installed 3rd party module

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

On 5/20/2024 12:38 AM, and...@borisov.dev wrote:

Hello!

I’ve installed a 3rd party module by copying its TDS folder structure and 
invoking `context --generate` as described in 
https://wiki.contextgarden.net/Modules#ConTeXt_LMTX

When I compile my project with `context` (using LuaMetaTeX), it's found and 
works just fine; however, when I try to compile with LuaTeX by invoking 
`context --luatex`, it can’t find the module.

Do I need to do something special to make it visible for LuaTeX? I can’t find 
the answer in the wiki.

I use standalone ConTeXt distribution.

Any help would be appreciated 🙏🏻


Did you run

context --generate --luatex

after adding the file?

Hans

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

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

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


[NTG-context] Re: defining hashtag simulator

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

On 5/20/2024 8:01 AM, seyal.zav...@gmail.com wrote:

Thanks.

What if we want the text to be copied when it is clicked?
I found these link on the stack site for this
https://tex.stackexchange.com/questions/174637/copy-to-clipboard-feature-in-pdf-output/545107#545107

also i defined this:
\def\Hashtag#1{
 \hbox{\tfa\ctxlua{
 str = "#1"
 replacespace = string.gsub(str," ","_")

 context.letterhash()
 context(replacespace)
 }
 }
}
\starttext
\Hashtag{hello}
\stoptext

i used hbox for making phrase unbreakable.

How can you put all the code in the one Lua function and not need to put hbox 
or goto function outside of Lua?


\startluacode
interfaces.implement {
name  = "Hashtag",
public= true,
protected = true,
arguments = "string",
actions   = function(str)
context("{\\nohyphens\\letterhash %s}",string.gsub(str," ","_"))
 -- str = string.gsub(str," ","_")
 -- context.bgroup()
 -- context.nohyphens()
 -- context.letterhash()
 -- context(str)
 -- context.egroup()
end
}
\stopluacode


--

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

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

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


[NTG-context] Re: build_parshape and \getshapetext - need for a deeper understanding

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

On 5/19/2024 2:29 PM, garu...@azules.eu wrote:

I still get some difficulties with build_parshape, \getshapetex and sectionning.

I though I find a solution by removing \blank with
   \setuphead  [subsection]  [before=,  after=, style=, 
command=\MySubSectionCommand, alternative=text ]

But actually it's not enough : when I add text before the first section, new 
issues appear.

I tried to build a MVE by refactoring and tidying as much as I could.
It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining 
issue.

Your guidance are most welcome :-)


you have to fight several issues:

- parshapes being reset at the end paragraph (handled here by luametatex 
context)
- parshapes operate on lines, not dimension (i might add an aletnative 
one day)

- you use a bit old mechanism (checkout the luametafun-paragraphs chapter)

Now, is there a solution? It really depends on the circumstances, so 
here is one.


\setupbodyfont[11pt]

\definemeasure [mywidth]  [7cm]
\definemeasure [mywidtha] [5cm]
\definemeasure [myheight] 
[{\the\dimexpr\baselineskip*37+\lineskip\relax}]
\definemeasure [myheighta] 
[{\the\dimexpr\baselineskip*18+\lineskip*1\relax}]
\definemeasure [myheightb] 
[{\the\dimexpr\baselineskip*25-\lineskip*1\relax}]


\startuseMPgraphic{shape:1}
  path p ;
  numeric mywidth   ; mywidth   := \measure{mywidth};
  numeric mywidtha  ; mywidtha  := \measure{mywidtha};
  numeric myheight  ; myheight  := \measure{myheight};
  numeric myheighta ; myheighta := \measure{myheighta};
  numeric myheightb ; myheightb := \measure{myheightb};
  p := (0,0)-- (mywidth,0) --
   (mywidth,myheighta)  -- (mywidtha,myheighta) --
   (mywidtha,myheightb) -- (mywidth,myheightb) --
   (mywidth,myheight)   -- (0cm,myheight) -- cycle;

build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) 
;

  path SavedShape ; SavedShape := p ;
\stopuseMPgraphic

\startuseMPgraphic{shape:2}
  SavedShape := SavedShape shifted (0,-ypart urcorner OverlayBox) ;
  SavedShape := SavedShape shifted (0,positiony("test")) ;
  fill SavedShape withcolor red;
 setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\showframe

\defineoverlay[myoverlay][\useMPgraphic{shape:2}]

\setupbackgrounds[text][text][background=myoverlay]

\startsection[title={test}]

\startshapedparagraph[mp=shape:1]%
\setupalign[verytolerant,stretch]%
\hpos{test}{!}\samplefile{tufte}
\samplefile{tufte}
\stopshapedparagraph

\stopsection

The "test" position is hard coded but should be namespaced, the ! can be 
a \strut instead.


So, more thinking from the end of the text flow.

Hans



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

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

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


[NTG-context] Re: Why is only the first frame protruding into the margin?

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

On 5/17/2024 8:22 PM, madiazm.eo...@gmail.com wrote:

thanks Pablo, but this is strange

If I reproduce your code in a new file I see the perfect alignment of the frames. But I 
had changed the code in my original file as suggested by Wolfgang and I additionally 
commented all lines in the "firstHeadings" definitions following your advice 
and after compiling... the same result.

The strange thing is that it is only the first section that protrudes, the 
other sections are right (as seen in the link). Therefore it must not be the 
code definition, since in that case all sections should protrude...

Over the weekend I will slowly move my code to a new file with your code adding 
a bit everytime to try to spot the moment when I get this strange behaviour and 
then I will write again.

ps. I included the link because there is no attach option here in the 
online-mailing-list. Sorry if it not ok.
thanks
if you do something \switchtobodyfont without ever having loaded it 
(before starttext) spaces can creep in depending on what files are 
loaded for that font


also, in order to avoid grouping issues / side effects you can do this 
before \starttext:


\usebodyfont[foo]

when you use multiple bodyfont sets

Hans



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

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

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


[NTG-context] Re: Fwd: outlinetext broken?

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

On 5/13/2024 11:54 PM, Jairo A. del Rio wrote:



-- Forwarded message -
De: *Jairo A. del Rio* >

Date: lun, 13 may 2024 a la(s) 9:53 p.m.
Subject: Re: outlinetext broken?
To: Hans Hagen mailto:j.ha...@xs4all.nl>>


Hi, Hans! Thank you for the update! I'm curious about the following 
issue: when I use Latin Modern (by default), a thick, filled line is 
drawn next to the radical. However, when I use another font such as TeX 
Gyre Schola, I get something similar to outlines-003.pdf, which is, in 
turn, similar to the result of applying PDF effects. So, shouldn't this 
result be the default? Thanks a lot again.
it depends on how a radical is composed; we try create an extensible 
using snippets which looks better in the case of fontd where rules (have 
to) have roun dcorners etc


Hans

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

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

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


[NTG-context] Re: Why don't footnotes appear in floats or figures?

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

On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
I'm three days out from sending my work to an editor, and found some 
serious problem: many footnotes just aren't rendering.


I have a history text that uses ConTeXt-SBL for the citations, as such, 
it has lots of footnotes. Sometimes the footnotes are just in the main 
text, but sometimes also in figure captions, inside floats, inside 
tables that are inside floats, inside tabulations inside floats, etc.


What I find alarming is it is frequently not rendering all of the 
footnote messages at the bottom of the page. The actual footnote number 
within the body is rendered, but no number is listed in at the bottom of 
the page. So I might see a list of footnotes, for instance, on page 1, I 
only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.



---
1 message
2 message
3 message
5 message
6 message

After a lot of trial-and-error and checking logs and checking my BibTeX 
files for errors, running everything through BibTex Tidy, etc., and 
failures to make a minimum working example, I found a single pattern:


If the footnote marker appears on the SAME page as the footnote text, it 
has no problem rendering the footnote. But, if ConTeXt decides to move a 
float a page or two later on--as it frequently seems to do---such that 
the footnote marker and footnote text at bottom of page should be on 
DIFFERENT pages, the footnote message at the bottom of the page won't 
render.


I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
have issues with footnotes; they appear to be similar to my issue--is 
that still a problem? Is there a fix or workaround? Old fixes I could 
finding in the mailing list don't seem to work with current versions of 
ConTeXt anymore.

you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)

- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
\startplacefigure[location=here,title={test \footnote{oeps 1}}]
\blackrule[width=1tw]
here
\footnote{hello 1} and
\footnote{hello 2} and
\footnote{hello 3} done
\stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).


I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem





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

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

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


[NTG-context] Re: \luaescapestring in proper Lua

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

On 4/11/2024 5:07 PM, Pablo Rodriguez via ntg-context wrote:

On 4/10/24 21:48, Hans Hagen via ntg-context wrote:

On 4/10/2024 7:49 PM, Pablo Rodriguez via ntg-context wrote:

[...]
I wonder whether there is a proper way in the Lua code to avoid
[[\luaescapestring{}]] in \ctxlua.
[...]

  context(tokens.scanners.string())


Many thanks for your reply, Hans.


\protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}}


Sorry, but why \protected is required or recommended here?


depends if you want it to be expandable

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

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

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


[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

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

On 4/11/2024 5:25 PM, Pablo Rodriguez via ntg-context wrote:

On 4/10/24 22:28, Denis Maier wrote:

[...]
   context --luatex --generate


Thanks, Pablo.
I've tried it, but it doesn't seem to work...


I get the same result on Win64 when I move the luatex binary from the
tex/texmf-win64/bin/ directory.

This may sound stupid, but could you check whether the bin directory
contain the required binary?

Sorry, "luatex --version" and even "whereis luatex" should give the same
result (but on Windows, it seems to be https://ss64.com/nt/where.html).

I hope it may help,

it searches for mtxrun.lua and contextl.lua in the same path so you need:

luametatex.exe
mtxrun.exe (can be link to luametatex.exe)
context.exe (can be link to luametatex.exe)
context.lua
mtxrun.lua

all in the same (bib) path

... always has been so ...

Hans

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

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

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


[NTG-context] Re: \luaescapestring in proper Lua

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

On 4/10/2024 7:49 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \starttext
   \startluacode
   function document.print_the_thing(str)
 context(str)
   end
   \stopluacode

   \unexpanded\def\PrintTheThing#1{%
 \ctxlua{document.print_the_thing([[\luaescapestring{#1}]])}}

   \PrintTheThing{a \em b {c}}
   \stoptext

I wonder whether there is a proper way in the Lua code to avoid
[[\luaescapestring{}]] in \ctxlua.

BTW, [[\luaescapestring{}]] in \ctxlua works better for me, since in my
real world document, I’m using str:match() to check whether the string
ends with interrogation or exclamation marks ("%?!$").

\starttext
  \startluacode
  function document.print_the_thing()
context(tokens.scanners.string())
  end
  \stopluacode

  \protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}}

  \PrintTheThing{a \em b {\bf c} d}
\stoptext

bonus:

  test!\removepunctuation ?

Hans

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

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

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


[NTG-context] Re: PDF/UA-2, WTPDF

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

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

Am 07.04.24 um 08:06 schrieb Hans Hagen:

On 4/6/2024 5:34 PM, Henning Hraban Ramm wrote:


1. PDF/UA-2
https://pdfa.org/iso-14289-2-pdfua-2/


looks likes one has to pay for it


That’s not how you promote open standards.

should have been an ecma standard instead

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: what about "textdisplay"?

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

On 4/2/2024 7:44 AM, Henning Hraban Ramm wrote:

Am 01.04.24 um 18:54 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 01.04.2024 um 18:29:

Am 01.04.24 um 18:21 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 01.04.2024 um 17:19:
A while ago, I was pointed (by Wolfgang or Hans, I guess) to 
\start/stoptextdisplay to enhance whitespace handling around images.


My guess is Mikael because I saw the command the first time in the 
source of a presentation from him.


Oh, that’s probably where I saw it, too.


Here is a short example which two other solution to get a similar 
effect as \starttextdisplay.


\usemodule[visual]

\setupfloat[figure][location=left]

\starttext

\fakewords{10}{20}
\startlinecorrection
\fakeimage{4cm}{3cm}{6cm}{4cm}
\stoplinecorrection
\fakewords{10}{20}

\blank[2*line]

\fakewords{10}{20}
\startplacefigure[location={force,none}]
\fakeimage{4cm}{3cm}{6cm}{4cm}
\stopplacefigure
\fakewords{10}{20}

\blank[2*line]

\fakewords{10}{20}
\starttextdisplay
\fakeimage{4cm}{3cm}{6cm}{4cm}
\stoptextdisplay
\fakewords{10}{20}

\stoptext


Thank you!
And when would you suggest what?

A float I’d use only if I need caption/numbering or the floating feature.

When I tried line correction, it never helped; probably I used it wrong 
(e.g. around section titles).


linecorrection is older, textdisplay newer and both are mainly meant to 
position boxed content (like images) in a way so that spacing looks 
acceptable ... they are vboxes with spacing around them so not meant for 
e.g. section heads or whatever text; it's for images, framed stuff, 
maybe bTABLE 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: OT: San Seriffe

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

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version

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 include an an svg file?

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

On 3/13/2024 9:16 AM, Henning Hraban Ramm wrote:

Am 12.03.24 um 23:59 schrieb seyal zavira:
You are correct. when i convert this svg to pdf via inkscape it works 
like a charm.


But what is standard way of including an svg file with context if we 
want to inkscape render the images?


\externalfigure[smile]

without any other settings, but inkscape must be callable on the command 
line (which doesn’t work for me on MacOS any more, must investigate…).

\startMPcode
draw lmt_svg [ filename = "smile.svg"]
\stopMPcode

Now gives the attached but it took me a while to figure out what works. 
An inkscape export adds for instance something (globally applied) that 
is not in the svg file (which actually derived from tiger.svg as 
mentioned in the file).


To be honest this is a horrible file and a good example of making things 
more complex than needed (probably common in wysiwyg applications), 
although we already had the machinery in the mp/pdf converter.


The biggest issue here is that one has to put some constrants in place 
order to make it work in e.g. sumatra (mypdf) and acrobat (which here 
actually does weird erratic things when I play with another test).


As with much complex svg, browsers also differ in interpretation o fsome 
features so it's hard to figure out what to do when there are 
conflicting demands. (Pointing to something that works tomorrow doesn't 
mean it worked when we tried to implement something yesterday.)


For Hraben - who mentioned it - i also added support for group opacity 
and transformed shades.


In the process I tried a few inkscape options (pdf export) but some 
produce faulty files (with missing stuff) so i guess we have a complex 
situation in general. That said, as long as one sticks to reliable and 
clean code (plain svg) it should mostly work out.


Text is another matter because svg dropped glyph support so now 
everything has to go through font features which in turn means that if 
one uses svg as output format one has to specify every character with 
possible abuse of a substitution feature that accesses it. So that is no 
longer a real interesting option, unless of course one exports all text 
as curves, just to be sure.


(I will extend general text suport but it will always be suboptimal but 
then, svg is not a long term archival format anyway.)


No upload yet as i also want to do some cleanup,

ps. For metapost lovers, here is some of the trickery used:

\startMPpage[offset=1ts]

draw image (
fill (unitsquare xscaled 10cm yscaled 4cm)
withcolor svgcolor(0.5,0,0)
;

registerluminositygroup ("test") (
fill (unitsquare scaled 2cm) shifted (1cm,1cm)
withshademethod "circular"
withshadecolors (.6,.1)
) ;

applyluminositygroup ("test") (
fill (unitsquare scaled 2cm) shifted (1cm,1cm)
withshademethod "circular"
) ;

draw luminositygroup (
fill (unitsquare scaled 2cm) shifted (4cm,1cm)
withshademethod "circular"
withshadecolors (.6,.1)
) (
fill (unitsquare scaled 2cm) shifted (4cm,1cm)
withshademethod "circular"
) ;

draw luminosityshade (
(unitsquare scaled 2cm) shifted (7cm,1cm)
) (
withshademethod "circular"
withshadecolors (.6,.1)
) (
withshademethod "circular"
) ;
) ;

\stopMPpage

Not that intuitive and a bit ugly deep down but it works (there was no 
need to extend mp btw as we already have graphic grouping in the engine).


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
-


smile-test.pdf
Description: Adobe PDF document


luminosity.pdf
Description: Adobe PDF document
___
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: \intertext and highlighting with \alignhere/\breakhere

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

On 3/13/2024 12:26 PM, Mikael Sundqvist wrote:

Hi,

On Wed, Mar 13, 2024 at 11:37 AM Max Chernoff  wrote:


Hi Hans,

On Tue, 2024-03-12 at 15:21 +0100, Hans Hagen wrote:

the next upload will support the attached ... so no ugly hacky code needed


"\texthere[inbetween]" looks perfect, thanks!

The "\definebar[...][inlined]" doesn't look quite right though -- the
issue that I'm having is that I can't figure out how to highlight across
both sides of an \alignhere without any questionable hacks. Unless the
new "inlined" does work across an \alignhere and I'm just not seeing it
in the example.

Thanks again,
-- Max


I can confirm that it works over \alignhere. Hans is doing some black
magic, but I guess he did not want to show off by including the whole
line.

Indeed, no need to show of the obvious

\definebar
  [mybar]
  [backgroundbar]
  [height=\strutht,depth=\strutdp,offset=.250ex,color=red]

\definebar
  [yourbar]
  [backgroundbar]
  [height=\strutht,depth=\strutdp,offset=.125ex,color=blue]

\definebar
  [ourbar]
  [backgroundbar]
  [height=\strutht,depth=\strutdp,offset=.125ex,color=green]

\starttext

\startTEXpage[width=4cm]
\startformula
a \alignhere= b + c \breakhere
\mybar {d + \yourbar{e \alignhere=} f \breakhere
g \alignhere \ourbar{=} h} + i
\stopformula
\stopTEXpage

\stoptext

Especially when it would not pass the rigourous accessibility check (esp 
wrt color) of your university,


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
-


inter-001.pdf
Description: Adobe PDF document
___
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: \em issue in MkXL (2024.03.05 11:26)

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

On 3/10/2024 9:32 AM, Pablo Rodriguez via ntg-context wrote:

On 3/9/24 16:04, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 19:39:

[...]
\enableexperiments[fonts.compact]

Which seeems weird to me. Or at least, I thought I read that Hans
enabled it by default in LMTX.


AFAIR Hans uses the setting in his own documents.


I have been using it for a while.

I hope the issue with \glyphslant might be fixed to enable it again.


Then my question is whether this was caused by simply enabling compact
fonts or by doing it twice.


The results happen when you use compact mode and is a result of
\glyphslant which keeps the value of the italic style even when you
switch back to the upright style.


Many thanks for your explaination,

using the low level commands

\glyphscale
\glyphxscale
\glyphyscale
\glyphslant
\glyphweight

directly can have side efects when at an outer level these are also set, 
so you need to accumulate, like


\starttext

test {\glyphscale 2000 test \glyphscale \numericscaled1.2\glyphscale 
test} test


test {\glyphslant  500 test \glyphslant \numericscaled2.0\glyphslant 
test} test


test {\glyphweight 100 test \glyphweight\numericscaled2.0\glyphweight 
test} test


\stoptext

which you will now wikify ...

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 do this?

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

On 3/8/2024 6:36 PM, Henning Hraban Ramm wrote:

Am 08.03.24 um 17:56 schrieb Otared Kavian:

Hi Ursula,

The reason for which you did not get the expected result is that you 
have « } » missing in your file, that is the closing brace after your 
italic command

« {\it » at the end of your document.
Moreover you did not have a \stoptext in your file, and a math command 
« \m » was not written correctly. Talking of math, I personnaly prefer 
to enclose in-line math between dollar signs $, that is writing « 
$\exists x \in H$ » instead of  « \m{\exists x \in H} ».


Well, better stay with the modern ConTeXt approach of \m{}.
for regular inline math we just use \im{...} (which has an \dm{...} 
companion with displaystyle


Hans

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

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

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


[NTG-context] Re: issue mixing font features (LMTX & MkIV)

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

On 3/3/2024 11:54 AM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \definefontfeature[wider][extend=2]

   \definefontfamily[mainface][rm][TeX Gyre Pagella]
 [features={default, quality, wider},
  it={style: regular, features:{default, slanted, quality}},
  bf={style: regular, features:{default, boldened-30}},
  bi={style: regular, features:{default, boldened-30, slanted}}]

   \setupbodyfont
 [mainface, 30pt]

   \starttext
   \startTEXpage[offset=1ex]
   a
   {\it a}\\
   {\bf a}
   {\bi a}
   \stopTEXpage
   \stoptext

With current latest (2024.02.27 09:21), LuaTeX gets boldened and slanted
for regular (but the other fonts cannot inherit the wider feature and
wider will not mix with boldened-30 [even when specified]).

For some reason, LMTX from current latest cannot get slanted and
boldened-30 (but it mixes the inherited wider feature in all fonts).

This began to behave differently in latest from 2024.01.08 11:23 (which
is my next version after the one from 2023.09.26 18:19).

Could anyone confirm the issue?
accumulating these effects is dependent on how the features that you use 
are defined


in luametatex we have a bit more advanced mechanism (also relates to 
compact mode) because th eengine is a bit more clever


just make sure that you don't add up features where one calcels the 
other, so use for instance:


\definefontfeature[wide] [extend=2]
\definefontfeature[wideslant][extend=2,slant=.2]
\definefontfeature[widebold] [extend=2,weight=.1]
\definefontfeature[wideboldslant][extend=2,weight=.1,slant=.2]

\definefontfamily[mainface][rm][TeX Gyre Pagella]
  [tf={style:regular,features:{default,quality,wide}},
   it={style:regular,features:{default,quality,wideslant}},
   bf={style:regular,features:{default,quality,widebold}},
   bi={style:regular,features:{default,quality,wideboldslant}}]

\setupbodyfont
  [mainface,30pt]

\starttext
\startTEXpage[offset=1ex]
a
{\it a}
{\bf a}
{\bi a}
\stopTEXpage
\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: issues scaling glyphs of Twemoji Mozilla

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

On 3/2/2024 1:46 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \definefontfamily[mainface][rm][TeX Gyre Termes]
   \definefontfamily[mainface][cg][Twemoji Mozilla][features={color}]
   \setupbodyfont[mainface]
   \starttext
   \scale[width=30em]{a}
   \scale[width=30em]{\cg 🇬🇧}
   \stoptext

Using current latest from both MkIV and LMTX, I cannot scale the emoji flag.

Latest font release can be directly download from
https://github.com/mozilla/twemoji-colr/releases/latest/download/Twemoji.Mozilla.ttf.

Am I missing something to scale the glyph properly?
You're missing the fact that the font has an issue. I can add a 
workaround, assuming that (as often) issues become features.


Hans

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

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

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


[NTG-context] Re: MetaPost lines in tables?

2024-02-22 Thread Hans Hagen via ntg-context

On 2/21/2024 7:47 PM, Henning Hraban Ramm wrote:

Am 21.02.24 um 19:43 schrieb Wolfgang Schuster:
… but it would be visible on a colored background. I’m sure you can 
show me a better way…


\startuseMPgraphic{dottedborder}
   draw bottomboundary OverlayBox withpen pencircle scaled 2 dashed 
withdots withcolor "red";

   setbounds currentpicture to OverlayBox;
\stopuseMPgraphic


Thank you!

(I’m sure I already used that somewhere… Must document…)
ok, new feature dedicated to Hraban ... who then of courese has to 
document it.


\starttext

\starttabulate
\FL[1,2] % linefactor (old) dashfactor (new)
\NC test \NC test and test and test and done \NC \NR
\ML[1,1]
\NC test \NC test and test and test and done \NC \NR
\NC test \NC test and test and test and done \NC \NR
\NC test \NC test and test and test and done \NC \NR
\LL[1,10]
\stoptabulate

\framed
  [align=middle,topframe=dash,frame=off]
  {\samplefile{tufte}}

\framed
  [align=middle,
   frame=dash,
   dashstep=.01hs,
   rulethickness=1pt]
  {\samplefile{tufte}}

\framed
  [align=middle,
   frame=dash,
   dashstep=10pt,
   rulethickness=2pt,
   background=color,
   backgroundcolor=gray]
  {\samplefile{tufte}}

\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] manuals

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

There's also:

https://github.com/contextgarden/not-so-short-introduction-to-context

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: \type ignores space between command and bracket

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

On 2/2/2024 11:16 AM, wolfgangbackes--- via ntg-context wrote:

I have stumbeld across the same bug. Seems to be very elementary, but is still 
present after many years. Sigh.

don't confuse bugs and features ...

\starttext

here a \type{\test  is}  done
here a \type{\test [is]} done
here a \type{\test {is}} done

here a \type[compact=yes]{\test  is}  done
here a \type[compact=yes]{\test [is]} done
here a \type[compact=yes]{\test {is}} done

here a \type[compact=all]{\test  is}  done
here a \type[compact=all]{\test [is]} done
here a \type[compact=all]{\test {is}} done

\stoptext

it helps to read a bit about how tex handles spaces esp after control 
sequences and when passing stuff in arguments ... then sit down and 
ponder possible solutions for a while ...


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: hyphenation question

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

On 2/2/2024 1:03 PM, Hans van der Meer via ntg-context wrote:
In the 18th century documents I am transcribing often words are 
abbreviated as for example /voorschreeve/ becoming /voors:/ In the 
transcription it is usual to write this as /voors[chreeve]/ indicating 
to the reader how the abbreviation was interpreted.


The problem then arises with hyphenation, because /voors[chreeve]/  in 
the example will not be hyphenated as if the []'s were absent. Which is 
what I would like to happen.


Question: is it possible to realize this and how?

Like this?

\starttext

\startexceptions
voor-s[chree-ve]
\stopexceptions

\hsize1mm
voors[chreeve]

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

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

On 1/20/2024 10:32 AM, Ursula Hermann wrote:

32 bits Windows download does not work, because 404 report.


i uploaded a win32 installer (for now we only keep 32 bit win but once 
all users are on 64 bit ...)


the current upload is as usual work in progress

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 version 20240118 ("Registerhaltigkeit")

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

On 1/22/2024 10:47 AM, Thomas Meyer wrote:

Hi Hans,

maybe you understand the question mark now, you are part of it. 
Unfortunately, I haven't received a reply to my last e-mail from January 
18.


No I don't. Are you sayign that you want an instant reply every time? I 
assume you realize that we're talking about volunteers here and that 
answering is askign users and developers to allocate free time to answer 
them and as we all have jobs it's not like we can always answer 
immediately.


Maybe only those whose questions are more serious, more interesting or 
whatever will get an answer.


Depends. I guess that when folk on this list assume a question to be 
answered they move on to a next one. Also, the only way to get an answer 
fast is to provide a good small example that exposes the issue.


I do not understand what you mean with "as follow up on the keyword 
thread we decided to treat bad values to equivalent to 'no'"! Which 
values are bad in this context?


Did you read Wolfgangs answers? We support "yes" but not "yes " etc etc. 
We just added a bit more rigorous test.



With the new ConTeXt version, "grid" no longer works for me! Too bad.


Let's see what Wolfgang says as he tested your mwe.


Should my attempt to use ConTeXt end here?

hm

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: cont-new.mkiv and \everymathematics

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

On 1/20/2024 7:49 PM, Rogers, Michael K wrote:

Hi all,

In writing class notes, I frequently make one-letter macros for formatted 
symbols, such \v and \w for vectors. Generally speaking, one-letter names for 
function/macros/variables is frowned upon in programming, but I find this 
localized use very convenient.

In cont-new.mkiv, one finds definitions of \t and \w (via \let) appended to 
\everymathematics, which overwrites my definition of \w every time TeX enters 
math mode. I can fix this by appending my definition to \everymathematics. The 
inefficiency seems minor, and I can live with it. I have a question and a 
couple of points:

1. Is there a better way than adding the definition to \everymathematics?

2. I don’t think these definitions should be in ConTeXt. Let users add them if 
they wish. Or add a ‘useshortcuts’ option to \setupmathematics.

3. \t and \w are undocumented, \mathword is undocumented, and it took me a 
while to track down the bug it created for me. In particular, they overwrote my 
definition only in math mode, and “\show\w” did not work in math mode. 
Frustrating.  I could add a wikipage, I suppose, but I’m not proud of the 
extent of my knowledge: “\mathword{word} typesets “word” in math mode in a 
normal text font, somewhat like \text{word}, and \w is an abbreviation of it 
that is added to \everymathematics on startup.”
adding to \everymathematics can work fine as long as you're the last one 
adding


when you overload built in commands,

\enabledirectives[overloadmode=error] % or warning

can give you some protection

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-01-20 Thread Hans Hagen via ntg-context

On 1/19/2024 6:34 PM, Pablo Rodriguez via ntg-context wrote:

On 1/18/24 20:43, Denis Maier via ntg-context wrote:

*Von:*Alain Delmotte 
*Gesendet:* Donnerstag, 18. Januar 2024 20:04
*An:* ntg-context@ntg.nl
*Betreff:* [NTG-context] Re: upload
[...]
When I go to https://www.pragma-ade.nl, I get an 404 Not Found
message, so I can't download the new upload !!
Works here.


Hi Denis,

I get a 404 error for both https://www.pragma-ade.nl/install.htm and
https://www.pragma-ade.com/install.htm.

I can update my existing installed version, but I wouldn’t be able to
install a brand new distribution.

Do you reach any of the urls included in my first paragraph?

Many thanks for your help,

can you try again

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

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

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


[NTG-context] Re: Why LuaMetaTex is so slow?

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

On 1/19/2024 12:34 AM, Aditya Mahajan wrote:

On Thu, 18 Jan 2024, Hans Hagen wrote:


Of course we'll never be as fast as (pure) plain tex (no layers added) or
latex (which often is advocated as faster than context).


I was curious, so did a quick experiment: typeset \input knuth 500 times. Here 
are the results:

pdflatex: 547 pages/sec
lualatex: 308 pages/sec


opentype or type 1 ?


MKIV: 130 pages/sec
LMTX: 147 pages/sec


that is weird as lmtx is always faster here (we loose some 15% on the 
backend compared to luatex, maybe even more, but we gain back quite a 
bit elsewhere for various reasons)



Interestingly, pdflatex, lualatex, and MkIV all generated pdf with 1112 pages, 
while LMTX generated a pdf with 1250 pages. Both MkIV and LMTX take the same 
time to run (8.5 sec) but LMTX generates more pages so it is faster.


puzzling


Of course, this is a meaningless experiment from a practical point of view as a 
1000 page document will be more complex than just text.

% engine=pdftex  1.2
% engine=luatmetatex 1.6
% engine=luatex  1.8
% engine=xetex   2.4

\starttext

\dorecurse{500} {
\input knuth \par
}

\stoptext

125 pages, so how does your test file look

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 version 20240118

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

On 1/18/2024 12:59 PM, Thomas Meyer wrote:

What is going on?

Yesterday I got a perfect on-grid-written document!
But today, with the newest context-version (20240118) all changed for 
the worse.


as follow up on the keyword thread we decided to treat bad values to 
equivalent to 'no'



I may not get a reply to this e-mail either!

?

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: [ \copypages ]

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

On 1/17/2024 10:20 PM, vm via ntg-context wrote:


Is there a (hidden) option that allows for changing the font color of 
external included pdfs

yes but experimental and not yet documented

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: font error in float placement?

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

Hi,


to index a nil value (field 'embed')

fixed in next upload (this merge upgrade is a bit work in progress)

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: Chemnitz, Leipzig, Call for Poster

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

On 1/10/2024 8:00 AM, juh via ntg-context wrote:

Dear Hraban,

Am Sun, Jan 07, 2024 at 09:59:14AM +0100 schrieb Henning Hraban Ramm:

I’d like to have a poster that shows off ConTeXt/MetaFun features.
Do you have suggestions or (even better) would you like to create it?
It would be nice to have for further events (last year I presented ConTeXt
at FrOSCon and CCCamp and lacked a poster).


I just submitted a talk about how we use Markdown, Pandoc and ConTeXt at
Hostsharing eG, so maybe we'll meet in Chemnitz.

A poster would be nice. ConTeXt/MetaFun are overwhelmingly flexible and 
powerful. It is hard to come up with a good idea. Who is targeted?

ConTeXt is interesting for people that want to

integrate a typesetting system in a publishing environment, because
ConTeXt does not stand in your way as LaTeX often do and has many
programming features (lua, xml ...) or

typeset very customized layouts.

These two target groups are very different. Integratable building blocks
for a complex publishing system or programmable layout machine – sorry, I am 
just
brainstorming, but I like the idea of a poster.
maybe what you could do is collect statements like these (users saying 
how they use / percieve it) and put that on a poster


Hans


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

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

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


[NTG-context] update

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

Hi,

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


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


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

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


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


Hans

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

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


[NTG-context] Re: Metapost docs

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

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


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

Hans


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

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

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


[NTG-context] Re: Solaris 11 SPARC Support [SEC=OFFICIAL]

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

On 1/5/2024 12:54 AM, Michael Wigston via ntg-context wrote:

Hi,

Would you consider supporting Solaris 11 on SPARC?

Alternatively if you could provide documentation how to build Context on 
"SunOS sun4v" hardware would also be beneficial.


I have compiled luametatex, but getting below error when trying to 
create cache and not sure if this is a compatibility issue.


bin/custom# ./mtxrun --generate

startup error : no format file given, quitting

You can create a tex tree with:

  http://lmtx.pragma-ade.nl/install-lmtx/installation.pdf
  http://lmtx.pragma-ade.nl/install-lmtx/texmf.zip
  http://lmtx.pragma-ade.nl/install-lmtx/texmf-context.zip

and then populate

  /tex/texmf-solaris/bin

and proceed as described in the manual. Or you can install on another 
machine and replace the bins there by yours.


Basically 'support' means a tree where the binary resorts,

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

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

On 1/1/2024 3:33 PM, vm via ntg-context wrote:



On 01/01/2024 13:28, Hans Hagen wrote:
Of course it screams metapost but tex and lua are also involved. See 
it as compensation for the lack of an end-of-year update. The last 
page of the result has a bit of explanation.


Beautiful indeed !
(And thank you for all the good work)
Is the puzzle generator somewhere hidden to be found within the context 
module tree?
It's not that much code but I need to add a keyword interface. It's also 
something we might play with a little at this years meeting so ...


(I added a gray scale option for tyhose without color printer.)

Here's a big one (the xmas card):

http://www.pragma-ade.nl/ctx-group-2023.pdf

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: MetaFun path joiners && and &&&& do not like single point paths

2023-12-31 Thread Hans Hagen via ntg-context

On 12/31/2023 8:06 AM, Mikael Sundqvist wrote:

\startMPpage
path p[], q ;
p1 = fullcircle scaled 3cm ;
p2 = fullcircle scaled 2cm shifted (3cm,0) ;
p3 = (3cm,2cm) ;
p4 = fullcircle ;
q = p[1] for i = 2 upto 3:
if (length(p[i]) == 0): &&& else: && fi p[i]
endfor
&& cycle ;
eofill q withcolor 0.9 ;
draw p1 withpen pencircle scaled 2pt withcolor .7 ;
draw p2 withpen pencircle scaled 2pt withcolor .7 ;
draw p3 withpen pencircle scaled 2pt withcolor .7 ;
draw q withcolor red ;
draw fullcircle scaled 6cm shifted (1.25cm,0) ;
\stopMPpage

maybe this is a bit more beautiful then

 q = for i = 1 upto 3 :
if length(p[i]) == 0 : % todo: a fast nolength
(p[i] -- p[i] shifted 5(eps,eps))
else:
p[i]
fi &&
 endfor cycle ;

(i'm not sure if we should change the implementation, probably not 
unless we have & -- actually we could have proper keywords which 
makes it less clumsy. Or 'recycle' that does the ugly eps job when we 
have a zero length path but we can move that over the year boundary.)


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: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/18/2023 5:22 PM, Gavin wrote:

Hi Hans,


On Dec 18, 2023, at 3:12 AM, Hans Hagen via ntg-context  
wrote:

about names:

how about

t-luageo.lmt
t-luageo.mpxl

so that one knows what comes with the module (we do the same with s-* modules)


"t-luageo.lmt" is fine, but "t-luageo.mpxl" breaks the module. I think the line

\startMPdefinitions
loadmodule "luageo" ;
\stopMPdefinitions

finds “mp-luageo” but not “t-luageo”. Changing the line to "loadmodule 
“t-luageo” does not work either.


so how about  mp-t-luageo


and you can add the example to the end of the module


Done.


On Dec 18, 2023, at 3:08 AM, Hans Hagen via ntg-context  
wrote:


Also, we do have a strange artifact, at least when I run this code. There is a 
line running across Brazil:


i'm not sure where that comes from (you can try &&&)



I will use &&& in my upcoming module, t-discoworld.



(Drawn with eofill, for maximum grooviness.)

Is there a place I can read about disconnected paths, &&&&, and &&&? These are 
totally unfamiliar to me.
at some point in the luametafun manual and they are probabaly mentioned 
in some docs that describe development


it's anyway something introduced last year, so kind of new

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: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:

Hello ConTeXters,

I wrote a little ConTeXt module for drawing globes. I would love some advice on 
how to improve it and share it. The code is quite short (about 250 lines). Most 
of the work is done by Lua, which reads the data files and calculates paths. 
These paths are passed to MetaFun, which draws the globe.

about names:

how about

t-luageo.lmt
t-luageo.mpxl

so that one knows what comes with the module (we do the same with s-* 
modules)


and you can add the example to the end of the module

\continueifinputfile{t-luageo.mkxl}

\starttext
exaple code
\stoptext

and then process the module to get the example

Hans

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

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

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


[NTG-context] Re: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/18/2023 4:49 AM, Gavin wrote:

Hi Hans,

Thanks for all the suggestions! I am going through them carefully.


- in mp you can do this

vardef theglobe(expr lat, lon) =
for i = 1 upto lua.mp.makeglobe(lat, lon):
(lua.mp.getglobepath(i)) 
endfor
cycle
enddef ;


Does "" allow a disconnected path? I haven’t seen "" or a disconnected 
path before.

Also, we do have a strange artifact, at least when I run this code. There is a 
line running across Brazil:




I only got the line for (23,0), not for other latitude and longitude. I’m not sure what caused that. The code 
for cutting and mending paths that cross the horizon is tricky. I’m not sure how it will interact with 
"" and “cycle" connecting everything.

i'm not sure where that comes from (you can try &&&)

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: Seeking advice for module that draws globes

2023-12-17 Thread Hans Hagen via ntg-context

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:

Hello ConTeXters,

I wrote a little ConTeXt module for drawing globes. I would love some advice on 
how to improve it and share it. The code is quite short (about 250 lines). Most 
of the work is done by Lua, which reads the data files and calculates paths. 
These paths are passed to MetaFun, which draws the globe.


Just some quiks remarks ...

- you use the right strategy (tex/lua/mp)

- in mp you can do this

vardef theglobe(expr lat, lon) =
for i = 1 upto lua.mp.makeglobe(lat, lon):
(lua.mp.getglobepath(i)) 
endfor
cycle
enddef ;

and then:

\startMPpage
GlobeDiameter = 10cm ;
fill fullcircle
scaled GlobeDiameter
withcolor .9white ;
path p ; p := theglobe(23, 0)
scaled .5GlobeDiameter
;
draw p
withpen pencircle scaled .2mm
withcolor blue
withtransparency (1,.5) ;
fill p
withcolor red
withtransparency (1,.5) ;
draw fullcircle
scaled GlobeDiameter
withcolor black ;
\stopMPpage

i use transparency to demo that a single path has advantages; you'll 
also notice that the runtime is actually at the mp end.


- in your lua code do this

local cosd = math.cosd
local sind = math.sind
local sqrt = math.sqrt

- also, use "MP.makeglobe" in the mp code and at the lua end function 
MP.makeglobe"" as that is the user namespace.


I'll mail you the lua file with some suggestions. When all is stable I 
can spend a few hours on optimizing if needed.



I am a novice at both Lua and MetaPost. I’m also new to Git and have never 
shared anything of substance with the ConTeXt community. (This barely counts as 
substantive, but I figure it’s best to start small.) I’m sure many of you could 
find opportunities for improvement with even a quick glance at the code. I 
welcome anything, from advice on performance to suggestions about the license. 
My most pressing questions are these:



1. How do I avoid redrawing diagrams with every typeset? The globe above takes 
about 0.7s, which is not bad, but it adds up in a book with many diagrams.


see previous mail


2. How do I organize this according to TDS for sharing? I know what TDS is and 
why it’s important, but that’s about it!

3. Should I be creating a namespace for this module, or launching a separate 
MetaFun instance? I have a general sense of what “namespace” and “instance” 
mean is this context, but I don’t know the consequences or the how-to.

I’d like to share this module, even though the potential demand is tiny, at 
best. I’m going through the Module Writing Guidelines 
(https://wiki.contextgarden.net/Modules#Module_writing_guidelines), but there 
is a lot that I don’t understand in those instructions. Questions 2 and 3 above 
relate to the instructions that are most mysterious to me. I think I can figure 
most of the others out.

I have been using ConTeXt for several years to write a high school physics 
textbook (along with the problem sets, tests, equations sheets, etc.). I wrote 
this module because I needed globes in some diagrams. I found an old MetaPost 
tool, mp-geo, that seemed to have the right ingredients, but I couldn’t get it 
to work, so I wrote my own tool using the data files from mp-geo. Hans and 
others on the list gave me valuable advice for these globes a couple years ago 
(and gave other valuable advice on all sorts of things before and since).

Many diagrams in my physics book use TikZ and pgfplots. I'd like to convert 
everything to MetaFun. I think the best way will be writing a few more modules 
for things like graphs (including polar and 3D plots), simple circuits, simple 
Feynman diagrams, etc. I’m hoping that these would be useful to the ConTeXt 
community. The luageo module has the basic design I’d like to use for the 
others: Lua for data handling and calculations, producing paths that are drawn 
by MetaFun. With some mentoring from the generous ConTeXt community, I’m hoping 
we can provide MetaFun alternatives to some of the TikZ libraries.


next year Mikael S and I are going to look into 3D (and projections) as 
we can only work on math when we have a parallel metafun pet project.



I have an alpha version of luagraph by Alan Braslau, which was helpful in 
designing luageo. Working on luagraph is my next project.

Gavin



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

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


--

-
  Hans Hagen |

[NTG-context] Re: Seeking advice for module that draws globes

2023-12-17 Thread Hans Hagen via ntg-context

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:


1. How do I avoid redrawing diagrams with every typeset? The globe above takes 
about 0.7s, which is not bad, but it adds up in a book with many diagrams.


\startbuffer[demo]
\usemodule [luageo]
\startMPpage
GlobeDiameter = 10cm ;
fill fullcircle scaled GlobeDiameter withcolor .9white ;  % Fill a 
circle with the water color.
drawglobe(23, 0) scaled GlobeDiameter withcolor .75white ;% Draw 
the land.
draw fullcircle scaled GlobeDiameter withcolor black ;% Add a 
border, if you want.

\stopMPpage
\stopbuffer

\typesetbuffer[demo]


2. How do I organize this according to TDS for sharing? I know what TDS is and 
why it’s important, but that’s about it!


Hraban will guide you here.


3. Should I be creating a namespace for this module, or launching a separate 
MetaFun instance? I have a general sense of what “namespace” and “instance” 
mean is this context, but I don’t know the consequences or the how-to.

If the code is robust there is no need for an instance.

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: error with definestartstop and startmode

2023-12-16 Thread Hans Hagen via ntg-context

On 12/16/2023 9:17 AM, Peter Münster wrote:

Hi,

I get an "runaway error" with the following example:

--8<---cut here---start->8---
\definestartstop[H][color=blue, before={\startmode[h]}, after={\stopmode}]
\starttext
test
\startH
   TEST
\stopH
\stoptext
--8<---cut here---end--->8---

How could I create such start-stop pair please?

doesn't work because \stopmode is a delimiter when shipped

\usemodule[abbreviations-logos]

\defineblock [H] [before=\startcolor[blue],after=\stopcolor]
\keepblocks[H]

\starttext
test

\beginH
   TEST
\endH

test
\stoptext


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   >