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

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

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

Hi Ralph,

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


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


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


Hans

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


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

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

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


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

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

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

Am 10.06.24 um 10:58 schrieb Henning Hraban Ramm:


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

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


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


just use tex.getmeasure in the upcoming


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

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

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


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


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


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


Now my image calculations work again. Phew!

Hans

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

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

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


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

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

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


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

printing \the\scratchdimen results in 100.0pt

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


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

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

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

Hans

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

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

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


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

2024-06-10 Thread Hans Hagen

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

Hi,

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

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

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

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

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

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

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


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

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

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

Hi Hraban,

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

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

\definemeasure[Bleed][3mm]

tex.getdimen("Bleed")

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

How should I do this correctly?


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

 \definemeasure[mymeasure][10pt]

 \newdimen\mydimen \mydimen=10pt

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

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

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

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

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

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

Thanks,
-- Max


Indeed we can have:

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

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

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

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

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

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


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

Hans

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

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

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


[NTG-context] Re: ConTeXt source from XML

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

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

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

Dear Pablo,

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


Dear Christoph,

just in case it might help to your meditation.

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

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

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

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

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

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

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

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

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

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


Hans

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

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

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


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

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

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

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

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


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

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

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


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

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


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

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

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

\starttext

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

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


Hans

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

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

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


[NTG-context] Re: Kerning in Noto Serif

2024-06-06 Thread Hans Hagen

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

Thanks Hraban,

my Noto Serif (just downloaded) is 2.013

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

(^^ but not all steps are shared!)

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


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

\char42\char38

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


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

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


Hans

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

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

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


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

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

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

Hi,

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

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

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

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

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


not all constructs hav ethese user variables (yet)

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

\starttext

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

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

\startsetups extract:start
\startdextract
\stopsetups

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

\starttext

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

\stoptext

but first i want Wolfgang to check the patch,

Hans

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

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

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


[NTG-context] Re: ConTeXt source from XML

2024-06-05 Thread Hans Hagen

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

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


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

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

% oeps.tex

\startbuffer[test]


test


\stopbuffer

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

\xmlregistersetup{xml:mysetups}

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

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

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

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

and then run

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

and get

\StartSomething
\StartWhat
test
\StopWhat
\StopSomething

so now you need to wikify it ...

Hans


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

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

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


[NTG-context] Re: ConTeXt source from XML

2024-06-04 Thread Hans Hagen

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

Dear Pablo, dear list

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


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

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

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


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


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



test 1


test 2

test 3


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


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


Hans

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

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

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


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

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

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

Greetings,

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


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

%\showboxes
\starttext

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


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

\input ward

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

\stoptext

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

best add a missing \stopplacecodelisting

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

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

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


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

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

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

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


numberstyle and textstyle : specific to the element

Hans


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

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

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


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

2024-06-02 Thread Hans Hagen

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


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


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


Hans

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

Alex schrieb am 02.06.2024 um 14:08:

Hi everyone,

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

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

\starttext

Hello

\startformula \Gamma_1 \stopformula

\stoptext


Add

    features=math\mathsizesuffix

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

Wolfgang



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

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


--

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

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

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


[NTG-context] Re: lua error in `strc-lev.lua`

2024-05-29 Thread Hans Hagen

On 5/29/2024 11:05 AM, Sylvain Hubert wrote:
I replaced `strc-lev.lua` and rerun `context` but the error message 
stays the same. `context` command doesn't seem to recognize the change 
of `strc-lev.lua`. Should I run `mtxrun` or something before?

context --make

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

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

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


[NTG-context] Re: regular expression as lua pattern

2024-05-28 Thread Hans Hagen

On 5/28/2024 6:25 PM, Tomáš Hála wrote:

Hi Pablo,

unfortunately, that it is not possible:

http://lua-users.org/wiki/PatternsTutorial, section Limitations.


\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"), 
function(str,_,s)

context(s)
return #str
end) + lpeg.P(1))^1
lpeg.match(pat,"how about this being that")

local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }), 
function(str,_,s)

context(s)
return #str
end) + lpeg.P(1))^1
lpeg.match(pat,"how about this being that")
\stopluacode
\stopTEXpage
\stoptext



On Tue, May 28, 2024 at 06:12:51PM +0200, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local str = "this is that"
context(str:match("(this|these)"))
\stopluacode
\stopTEXpage
\stoptext

In short, I would like to know whether it is possible to have the
regular expression (this|these) as a Lua pattern.

I mean, I need complete strings and I haven’t found the way to do it.

Many thanks for your help,

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

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

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

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


--

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

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

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


[NTG-context] Re: bug tracker

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

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


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


Hans

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

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

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


[NTG-context] Re: Playing with math font setup

2024-05-21 Thread Hans Hagen
t

We use $X$, $Y$, $Z$ and $n$, $m$, etc. $\sin(x) \to \limsup x_n$ whatever.

We use $\bf X$, $\bf Y$, $\bf Z$ and $\bf n$, $\bf m$, etc. $\bf \sin(x) 
\gets \limsup x_n$ whatever.


\stoptext


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

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

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


[NTG-context] Re: LUA API for page numbers

2024-05-21 Thread Hans Hagen

On 5/21/2024 10:26 AM, Luc Chabassier wrote:

Hi everyone,

I have recently migrated my PhD dissertation from LaTeX to ConTeXt. In
LaTeX I was using kaobook, a template with lots of margin notes, but I
was frustrated with the automatic placement of the notes.

I implemented a system using overlays that automatically places the
notes using lua. To know where the ideal placement should be (if they do
not interact with each other), I use lua to insert a latelua whatsit
that uses lpdf.getpos() to get the coordinate on the rendered page.
However, I haven't found a way to get the page number using lua, and the
tex macro \pagenumber is unreliable near pagebreaks.

Furthermore, it would be helpful to know if there is a way to access the
position and sizes of figures at the end.
you have to provide some mwe so that we can see what is intended; in 
principle much info is available one way or the other


concerning notes in the margin ... did you try the built in magin text 
mechanisms?


Hans


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

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

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


[NTG-context] Re: defining hashtag simulator

2024-05-20 Thread Hans Hagen

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

Thanks.

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

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

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

i used hbox for making phrase unbreakable.

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

In the next upload you can do this:

\protected\def\Hashtag#1%
  {\begingroup
   \nohyphens
   \spacechar\underscoreasciicode
   \nospaces\plusthree
   \letterhash#1%
   \endgroup}

(was an easy extension given what we already have)

Hans

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

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

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


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

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

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

Hello!

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

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

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

I use standalone ConTeXt distribution.

Any help would be appreciated 


Did you run

context --generate --luatex

after adding the file?

Hans

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

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

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


[NTG-context] Re: defining hashtag simulator

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

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

Thanks.

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

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

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

i used hbox for making phrase unbreakable.

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


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


--

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

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

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


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

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

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

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

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

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

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

Your guidance are most welcome :-)


you have to fight several issues:

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

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

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


\setupbodyfont[11pt]

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


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

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

  path SavedShape ; SavedShape := p ;
\stopuseMPgraphic

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

\showframe

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

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

\startsection[title={test}]

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

\stopsection

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


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

Hans



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

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

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


[NTG-context] Re: defining hashtag simulator

2024-05-19 Thread Hans Hagen

On 5/19/2024 5:40 AM, seyal.zav...@gmail.com wrote:

Hi all,

I want to define a command that simulate hashtag behavior in social networks,

In other words, this command should put the hashtag sign at the beginning of 
it, replace spaces with dashes and also it should be a clickable link and 
unbreakable world.
I mean like this, for example:
\myhashtag{hello world}
It should be displayed as #hello_world in the final PDF and when clicked it 
will search for #hello_world throughout the pdf
How is this possible?
One of the disppointments of pdf (some things indeed got worse over 
time) ...


"Table 215 — Named actions" lists several named actions (PDF 1.2) that 
interactive PDF processors

shall support; further names may be added in the future.
Table 215 — Named ac

Only a few were ever formal ok. Acrobat supports some more (at least 
did) but even on the


\goto{test}[action(search)]

one could not set a string. Adding a decent subset of commands is way 
easier than whatever came later to the standard. It's especially ironic 
in the perspective of accessibility.


However, if one could agree on a subset (as the standard is open) and 
open source viewers would support it ... but getting all on board is 
probably not possible).


Hans

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

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

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


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

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

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

thanks Pablo, but this is strange

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

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

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

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


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


\usebodyfont[foo]

when you use multiple bodyfont sets

Hans



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

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

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


[NTG-context] Re: MyWay from dl.contextgarden.net

2024-05-17 Thread Hans Hagen

On 5/17/2024 10:49 PM, garu...@azules.eu wrote:

Several documents previously stored on dl.contextgarden.net are no longer 
accessible.

https://wiki.contextgarden.net/This_Way_-_My_Way#MyWay

Are they available on another server ? or is there a copy somewhere else ?
Thanks for your help


everything that makes sense (also historically) is in the distribution 
under doc


Hans


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

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

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


[NTG-context] update

2024-05-17 Thread Hans Hagen

Hi,

This weekends update:

- we're currently checking the upcoming math manual and in the process 
we streamline some mechanisms


- as part of the BT presentation about par passes we introduced 
\toddlerpenalty but we leave it to the user to guess what that is (it 
fits into widow, club and orphan penalty collection)


- we could already produce pdf 2.0 but especially when one mises with 
older files, some care is needed; the inclusion 'compact' mechanism has 
been cleaned up a bit and the merge interface is converging (it has to 
do with efficient font sharing, cleanup and fixing of files outside our 
control); when one has issues with inclusion, try with compact= (set to 
nothing)


- although we're mostly done with tagging it will get some attention as 
we go; it's mostly about playing safe and getting valid pdf's


- for rhaban (posters) another fancy feature was added:

\startTEXpage[offset=1ts]
\samplefile{tufte}\removeunwantedspaces\space

\startshadow[contrastcolor=red,weight=100]\blue\samplefile{tufte}\removeunwantedspaces\stopshadow\space
\samplefile{tufte}\removeunwantedspaces\space

\startshadow[contrastcolor=red,weight=100,dx=0,dy=0]\blue\samplefile{tufte}\removeunwantedspaces\stopshadow\space
\samplefile{tufte}
\blank
\setupshadows[shadowed][unit=pt,dx=.5,dy=-.5,weight=200]
\shadowed{\bfd Tufte\setstrut\strut}
\stopTEXpage


Hans


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

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


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

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

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



-- Forwarded message -
De: *Jairo A. del Rio* <mailto:jairoadelr...@gmail.com>>

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


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


Hans

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

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

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


[NTG-context] Re: Errors with 2024-05-11 LMTX

2024-05-12 Thread Hans Hagen

On 5/12/2024 6:50 PM, Rik Kabel wrote:
I have come across an error that halts processing with the latest 
release. The following demonstrates this:
That one was hard to find as it was not something new hut just showing 
up now.


Can you try the latest binary from

https://build.contextgarden.net/dl/luametatex/work/

Hans

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

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

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


[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen

On 5/12/2024 5:36 PM, Fabrice Couvreur wrote:

Sorry for the comment !
I use Evince

so how about okular or mupdf

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

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

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


[NTG-context] Re: no effect of \definefontfeature for adobevariablefontprototype

2024-05-12 Thread Hans Hagen

On 5/9/2024 10:38 PM, garu...@azules.eu wrote:

Hi,

trying to work with variable fonts, I am stuck at the very beginning.

I can't see any effect of weight parameter.
Using adobevariablefontprototypebold and adobevariablefontprototypelight is 
working.

\starttext

\definefontfeature[whatever][axis={weight:150}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:350}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:550}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\definefontfeature[whatever][axis={weight:750}]%
\definedfont[name:adobevariablefontprototype*whatever]foo@bar

\stoptext

Can it be something from with my font file ?

\starttext

\definefontfeature[whatever01][default][axis={weight=0250}]
\definefontfeature[whatever02][default][axis={weight=0500}]
\definefontfeature[whatever03][default][axis={weight=0750}]
\definefontfeature[whatever04][default][axis={weight=1000}]

\definefontfeature[whatever10][default][axis={=000}]
\definefontfeature[whatever20][default][axis={=050}]
\definefontfeature[whatever30][default][axis={=075}]
\definefontfeature[whatever40][default][axis={=100}]

\definefontfeature[whatever11][default][axis={weight=0250,=000}]
\definefontfeature[whatever22][default][axis={weight=0500,=050}]
\definefontfeature[whatever33][default][axis={weight=0750,=075}]
\definefontfeature[whatever44][default][axis={weight=1000,=100}]

\definedfont[name:adobevariablefontprototype*whatever01]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever02]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever03]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever04]foo@bar\blank

\definedfont[name:adobevariablefontprototype*whatever10]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever20]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever30]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever40]foo@bar\blank

\definedfont[name:adobevariablefontprototype*whatever11]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever22]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever33]foo@bar\par
\definedfont[name:adobevariablefontprototype*whatever44]foo@bar\par

\stoptext


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

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

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


[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen

On 5/12/2024 3:57 PM, Fabrice Couvreur wrote:

Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it 
doesn't seem possible: I don't understand.

Thanks
Fabrice

  \startMPpage[offset=1DK]

           numeric u;
           u = 6cm;

           interim linejoin := mitered;
           interim ahangle := 30;

           path xx, yy;
           xx = ( (-0.3,0) -- 1.4 right) scaled u;
           yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;

           def compute_curve(suffix f)(expr xmin, xmax, xinc) =
               ((xmin,f(xmin))
               for x=xmin+xinc step xinc until xmax:
                    .. (x,f(x))
               endfor)
           enddef;


           for i = 1 upto 4:

           vardef f(expr x) =x+exp(-i*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;

           endfor;

           vardef f(expr x) =x+exp(-6*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;

           vardef f(expr x) =x+exp(-15*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;


           vardef f(expr x) =x+exp(-60*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not 
drawn


best put a comment before the ->>>>>>>


           draw curve withcolor blue;


           drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
           drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;


           label.urt("A",(0,1u));

           draw xx;
           draw  yy;

           draw (1u,0) -- (1u,1.8u);


           label.llft("0",(0,0));

            vardef mark_y_axis(expr value, name) =
             save p; pair p; p = value * u * up;
             draw (left--right) scaled 1 shifted p;
             label.lft(name, p shifted 2 left);
           enddef;

           for a = 1 upto 1:
             mark_y_axis(a, "");
           endfor

            mark_y_axis(1, "$1$");


          vardef mark_x_axis(expr value, name) =
            save p; pair p; p = value * u * right;
            draw (up--down) scaled 1 shifted p;
            label.bot(name, p shifted 2 down);
          enddef;

          for a = 1 upto 1:
            mark_x_axis(a, "");
          endfor

          mark_x_axis(1, "$1$");


           path rectangle;
           rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) -- 
(1.3u,1.4u) -- (-0.3u,1.4u)--cycle;


           clip currentpicture to rectangle;
          \stopMPpage


your exp usage:

  exp(-60*-0.4)

if you see what huge numbers come out of that, like

-51.006602 11100558579.857309 l
-50.989594 11034154639.123087 l
-50.972586 10968147929.149401 l
-50.955579 10902536073.687559 l
-50.938571 10837316710.703716 l

you could imagine a viewer crapping out on that because no matter what 
one clips it still is 'kind of drawn', so what viewer do you use?


Hans

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

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

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


[NTG-context] Re: outlinetext broken?

2024-05-11 Thread Hans Hagen

On 5/11/2024 8:33 PM, Jairo A. del Rio wrote:
As for the current ConTeXt, the example above still produces the wrong 
output. Can anyone reproduce this case? Thank you in advance. 

It's a bit tricky but this is what i can get ... see attached.

(You have to wait till a next upload.)

Hans


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


outlines-003.pdf
Description: Adobe PDF document
\continuewhenlmtxmode

\starttext
\startMPpage[offset=10pt]
draw lmt_outline [
text = "\mathematics{\sqrt{2}-1}"
] ;

draw lmt_outline [
text = "\mathematics{\sqrt[rule=no]{2}-1}"
] shifted (0,-1cm) ;

draw lmt_outline [
text = "\mathematics{\sqrt[rule=yes]{2}-1}"
] shifted (0,-2cm) ;
\stopMPpage
\stoptext

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

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


[NTG-context] Re: rendering arabic diacritics

2024-05-09 Thread Hans Hagen

On 5/9/2024 2:17 PM, Hamid,Idris wrote:

Hi Seyal,

See below:

-- Original Message --
 From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "seyal.zav...@gmail.com <mailto:seyal.zav...@gmail.com>" 
mailto:seyal.zav...@gmail.com>>; "mailing list 
for ConTeXt users" mailto:ntg-context@ntg.nl>>

Date 5/9/2024 3:31:45 AM
Subject [NTG-context] Re: rendering arabic diacritics


** Caution: EXTERNAL Sender **
On 5/9/2024 10:03 AM, seyal.zav...@gmail.com 
<mailto:seyal.zav...@gmail.com> wrote:

Hi all,
when i want to use the linked font for arabic texts it doesn't render 
diacritics properly

i doesn't have problem with this font in inkscape or libreoffice
what featureset should i apply?
font link:
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1hCcv6wqWjd-5GEKnaowh8E8YVbTgGqQr%2Fview%3Fusp%3Dsharing=05%7C02%7CIdris.Hamid%40ColoState.EDU%7C8e2b7a1a4eaf46f6b10808dc700b7b2a%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638508441848485171%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=51bK7I53UxZOK0PcbrYlpX2s%2Bdy%2BK83SslQZ%2BvhnvwU%3D=0
 <https://drive.google.com/file/d/1hCcv6wqWjd-5GEKnaowh8E8YVbTgGqQr/view?usp=sharing>
this is my MWE:
\definefontfeature [arabis]
[mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]
\definefont [Ahang] [file:Ahang-Regular.otf*arabis at 18pt]
\setupalign[r2l]
\starttext
{\Ahang تَشْكِيل كَسْرَة}
\stoptext

\definefont [Ahang] [file:Ahang-Regular.otf*arabic at 18pt]
but there is an issue with widths, ill send you a patch to test


The provided "*arabic" featureset should suffice for this font. Also 
TEXpage is useful for this kind of MWE:


\definefont [Ahang] [file:Ahang-Regular.otf*arabic at 18pt]
\setupalign[r2l]
\startTEXpage[offset=1em]
{\Ahang تَشْكِيل  كَسْرَة}
\stopTEXpage

In prehistoric ConTeXt version

    2023.09.26 18:19

the diacritics look fine in both ConTeXt and unicode editor MS Notepad.

So if there is something wrong, it must be in a more recent version.

For comparison: Before applying Hans' patch, could you kindly send your 
pdf of the MWE that shows the error? Mine is attached.
Ahang-Regular has no width settings for the marks so we need to zero 
them. Tahrir_Regular has widths but these we explictly need to zero with 
a pseudo feature then. (What are the assumptions when we do arabic? That 
marks are to have zero width?)


Hans

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

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

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


[NTG-context] Re: rendering arabic diacritics

2024-05-09 Thread Hans Hagen

On 5/9/2024 10:03 AM, seyal.zav...@gmail.com wrote:

Hi all,

when i want to use the linked font for arabic texts it doesn't render 
diacritics properly
i doesn't have problem with this font in inkscape or libreoffice
what featureset should i apply?

font link:
https://drive.google.com/file/d/1hCcv6wqWjd-5GEKnaowh8E8YVbTgGqQr/view?usp=sharing

this is my MWE:
\definefontfeature [arabis]
  [mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]
\definefont [Ahang] [file:Ahang-Regular.otf*arabis at 18pt]
\setupalign[r2l]
\starttext
{\Ahang تَشْكِيل  كَسْرَة}
\stoptext


\definefont [Ahang] [file:Ahang-Regular.otf*arabic at 18pt]

but there is an issue with widths, ill send you a patch to test

Hans


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

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

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


[NTG-context] Re: start/stopregister

2024-04-26 Thread Hans Hagen

On 4/26/2024 9:54 AM, Thomas A. Schmitz wrote:

On 4/26/24 9:30 AM, Thomas A. Schmitz wrote:
And here I am again! Both in mkiv and in mkxl, start/stopregister does 
not work when there is already an index entry before. Example below!


All best

Thomas

\setuppapersize [A6]

\starttext
 A\index{A} B \page
 A\startregister [index] {A} B\startregister [index] [B] {B}
 \dorecurse {10} {\input tufte}
 A\stopregister [index] {A} B\stopregister [index] [B]

\page

\placeregister[index]

\stoptext


And I'm not even sure if this is allowed to say anymore, but: works in 
mkii...

That's because mkii is AI enhanced. Can you try this:

\setuppapersize [A6]

\starttext

A\index{A} B \page


\stopregister [index] [A]
B>
\stopregister [index] [B]

\page

\placeregister[index]

\stoptext

(Watch the [A] vs {A} usage where [A] is the label used for matching the 
potentially weiord nested start/stop ... maybe we need different aliases 
for these, like \fromregister and \toregister.)


Hans

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

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

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


[NTG-context] Re: start/stopregister

2024-04-25 Thread Hans Hagen

On 4/25/2024 4:51 PM, Taco Hoekwater wrote:




On 25 Apr 2024, at 16:45, Thomas A. Schmitz  wrote:

On 4/25/24 16:13, Henning Hraban Ramm wrote:

I’m using it like
\startregister[index][bibliografie]{Bibliografie}
…
\stopregister[index][bibliografie]
i.e. very similar to your example, and can confirm it doesn’t result in a page 
range in the index. Also gives no error.


Since I've become an expert on tuc files since yesterday (ha!): if I compare the tuc from 
a mkiv and a mkxl run, I see that mkiv produces an entry ["lastrealpage"]=9 in 
the references table, mkxl doesn't. This appears to be the relevant bit, and it is 
connected with the replacement of realpageno by c_realpageno in line 638 of strc-reg.lmt

references.lastrealpage = texgetcount(c_realpageno)


Let's seen if we can make Thomas more of an expert as he's zooming in on 
the issue:


extendregister {
metadata   = { name =  name },
references = { abel =  label },
}

Let me know if you't see it.


Possibly related: I noticed last week that mkxl does not update the legacy 
counter \pageno any more for every page.

i'll check it

Hans

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

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

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


[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Hans Hagen

On 4/25/2024 4:08 PM, Fabrice Couvreur wrote:

Hi Taco,
I knew I wouldn't be able to explain what was happening.
The code works perfectly and the figure is clearly visible in the 
component chapter-14 :


\startcomponent[chapter-14]
\startMPpage
...
\stopMPpage
\stopcomponent

But if I compile my project, it disappears !!

\startproduct[terminale-manual]
  \startbodymatter
       \component[chapter-1]
       \component[chapter-2]
       \component[chapter-3]
       \component[chapter-4]
       \component[chapter-5]
       \component[chapter-6]
       \component[chapter-7]
       \component[chapter-8]
       \component[chapter-9]
       \component[chapter-10]
       \component[chapter-11]
       \component[chapter-12]
       \component[chapter-13]
       \component[chapter-14]
     \stopbodymatter
\stopproduct

-- compile with specific preceding chapters commented
-- when the interfering one is found, make a copy and strip till the 
problem is gone


it might be that you redefine something metapost

Hans

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

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

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


[NTG-context] Re: utiliydata

2024-04-25 Thread Hans Hagen

On 4/25/2024 9:25 AM, Thomas A. Schmitz wrote:




Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
structures.refrences.collected, but what about the next level

utilitydata.structures.references.collected={
[""]={
  [“REF"]={

What does the empty key do? And how do I retrieve the value of

REF.references.realpage?

Thomas


Sigh, as always: just when I had hit “send,” I figured it out:

structures.references.collected[""][REF].references.realpage

But I’m not sure if there is an easier/better way. And I still would like to 
know what the empty string as key does.
it's the prefix (namespace) which here is empty (easier to use "" as key 
than have some exception)


Hans



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

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

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


[NTG-context] Re: utiliydata

2024-04-24 Thread Hans Hagen

On 4/24/2024 5:41 PM, Thomas A. Schmitz wrote:

Hi all,

I’m slightly embarrassed because this should be easy, but I can’t figure out 
how to do this: in the tuc/tua file, I have the complete references of my 
document. How can I access it from within my Lua code? For instance, something 
like

utilitydata.structures.references.collected.”MyReference”.references.realpage

How can this be accessed?
grep for "job." (i bet you can figure it out and compensate the 
embaressment that way)


Hans


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

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

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


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

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

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


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


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



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

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


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


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

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

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

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

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

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

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

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


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





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

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

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


[NTG-context] Re: How to isolate serious errors from warnings?

2024-04-19 Thread Hans Hagen

On 4/18/2024 8:26 AM, Henning Hraban Ramm wrote:

Am 18.04.24 um 02:09 schrieb Joel via ntg-context:
I'm about to have a lengthy (2,000+ page) document published. Normally 
if it compiles and looks okay, I regard that as meaning no errors 
appeared, but I've noticed that sometimes ConTeXt will still compile, 
even if something isn't displayed on screen as it should:


(1) I tried placing a table inside a startitemize environment, as 
instead of it not compiling, it left a message in the document warning 
that wasn't supported.


(2) In another case, I had an image that ConTeXt couldn't find, as I 
mispelled the filenmame, and it fully compiled and made a PDF, without 
me noticing.


(3) Or maybe in some case, a font couldn't be found for a specific 
character, so a single character in the file isn't displaying.


Those are just some examples; I intended for something to be printed 
on the PDF, but it isn't showing there.


Since a document of this size will have a lot of messages, is there a 
way to adjust the settings, from "show everything" to "show some" to 
"show only serious errors"? Or maybe to use > to send the errors to 
another file for careful study? (using Linux if that matters)


You can enable trackers like

\enabletrackers[figures.*]

But that just gives more log messages for debugging.

You get the list of all trackers with:

context --global m-trackers.mkiv


For your use case, directives are more helpful, like

\enabledirectives[logs.errors=*] (i.e. break at every error)

AFAIK that just handles missing characters, references and modules ATM, 
but this information might be outdated.


You get all directives with

context --global m-directives.mkiv


often the log files has some summaries at the end



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

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

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


[NTG-context] Re: Wiki - test/proposal to further clarify documentation

2024-04-17 Thread Hans Hagen

On 4/17/2024 8:32 AM, Thomas A. Schmitz wrote:




On 16. Apr 2024, at 21:56, Peter Hopcroft via ntg-context  
wrote:




On 17/04/2024, at 7:11 AM, Henning Hraban Ramm  wrote:

In my poster (still WIP) I wrote:
…


Excellent


No, I must admit I don’t like the first two paragraphs. The question is “what 
is ConTeXt,” and the answer is “we’re not LaTeX.” And why “infamous”?
I agree. It sounds the same as "we're not msword" or "we're not google 
docs". (In the end the only thing that latex and context have in common 
is that they use the tex language / ecosystem.)


Hans

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

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

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


[NTG-context] Re: Back in the 90s

2024-04-13 Thread Hans Hagen

On 4/13/2024 2:12 PM, Riviera Taylor wrote:

Hello,

I was reading about the history of ConTeXt in the Not So Short 
Introduction To ConTeXt and I have a historical question. I noticed that 
the PDF specification was published in 1993 yet ConTeXt was invented in 
1991. The book suggests that PDF output was handled by the PdfTeX engine 
in MKII in 2005. What sort of output did the software produce before 
PdfTeX was introduced? Was this the same as the output produced by the 
software before the publication of the PDF specification?
2005 is when we started with luatex which is a follow up on pdftex, and 
pdftex is more a mid 90's thing; we immediately adopted pdftex (which 
made some believe that context depended on pdftex which is not true)


anyway, we started with dvi which needs a postprocessor to go to some 
printer format like specific hp or more general postscript but also can 
drive viewers


we went from epson dot matrix printer -> early 300 dpi laser -> 600 dpi 
laser printer -> high speed oce 512 dpi printer (metric) -> high speed 
oce 600 dpi printer (+ crappy canon color laser printer) -> fast 
page-wide hp color inkjet office printer


in mkii all is controlled by backend drivers, that use so called 
specials to support color, hyperlinks, images so a workflow can have


- dvipsone : high quality postscript
- dviwindo : viewer with typeone support and hyperlinks
- acrobat  : postscript to pdf

and as all these external backends have their demands we could handle 
all these things in an abstract way (that way one could also drive 
printer properties like duplex or paper bins etc from a tex job)


that meant that when pdf came around we could almost immediately support 
most of the interactive features in a dvi -> ps -> acrobat workflow


when pdftex came around the intermediate step of postscript could be 
avoided which btw was also possible with dvipdfm(x) so we also supported 
that


so to summarize, it went from

tex -> dvi -> printer format
tex -> dvi -> postscript -> more generic printer format
tex -> dvi -> pdf -> print from acrobat
tex -> pdf -> print from pdf viewer

in the meantime we are pdf (as from that one can produce other formats)

Hans

(btw, the fact that we could easily support pdf was also a reason why at 
that time some adobe folk in nl used documents produced by context to 
show somewhat extrems usage of interactive features, thanks to the fact 
that tex can adapt to such new situations, also via the dvi route in 
this case with pdfmarks; at that time pdf usage - and features - was a 
bit more dualistic: ps replacement format versus storage and preview 
format, but that's a different story; but it still shows in how the 
standard evolved)


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

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

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


[NTG-context] Re: Most recent context doesn't like synctex?

2024-04-13 Thread Hans Hagen

On 4/13/2024 12:39 AM, Jim wrote:

Hi,

I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
system.

Recently, the stand-alone ConTeXt distribution seems to not create a
synctex file any more.  Specifically,

 /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
--synctex=1 --nonstop file.tex

does not create a .synctex file (and deletes it, if it is there), whereas
the TeXlive version

 /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
--synctex=1 --nonstop nwg_newsletter_2024_04.tex

does create the .synctex file.


The ConTeXt distribution version *does* create the file if --nonstop is
*not* used.  Knowing that, I can work around this for now, although
emacs+auctex probably won't be happy without --nonstop.

I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
that.

Is this a bug introduced by some recent change?

it's more a feature

- Mikael S and i spend some time with editor/viewer combinations on 
linux in order to find ways around the different synctex libs that they use


- as a result we could make most work ok

- we assume that synctex is set up in the document with

\setupsynctex[state=start]
\setupsynctex[state=repeat] % less efficient but gets around issue

- when context is run 'headless' (on a server) it's often done in 
batchmode because one knows that the style works and in that case 
synctex makes no sense so we disable it; this avoids the need to patch 
the style


- the manual has been updates

- running context in nonstop mode makes little sense

(maybe, as power user, Mikael remembers more details)

Hans

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

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

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


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

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

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

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

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

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

  context(tokens.scanners.string())


Many thanks for your reply, Hans.


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


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


depends if you want it to be expandable

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

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

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


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

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

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

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

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


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


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

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

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

I hope it may help,

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

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

all in the same (bib) path

... always has been so ...

Hans

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

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

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


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

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

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

Dear list,

I have the following sample:

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

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

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

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

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

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

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

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

bonus:

  test!\removepunctuation ?

Hans

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

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

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


[NTG-context] Re: Figure reference failing

2024-04-10 Thread Hans Hagen

On 4/10/2024 1:30 PM, Taco Hoekwater wrote:




On 10 Apr 2024, at 13:04, Willi Egger  wrote:

Hello,

It seems, that the referencing mechanism is failing. I detected this with the 
January version and the current version: 2024.04.01 08:59.

Could some one confirm this?


It fails for me as well, when "mode=columns" is used.

compare with and without mode columns:

\starttext

\enablemode[columns]

As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} 
we can have

more than one cell in a row.

\startplacetable[mode=columns,reference=demo-1]
\externalfigure[cow][width=\textwidth]
\stopplacetable

\samplefile{tufte}

\stoptext

so basically we have an "at the spot" placement or a float

Hans

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

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

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


[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-10 Thread Hans Hagen

On 4/10/2024 5:22 AM, seyal zavira wrote:
seams this code means to put a hidden text with same size behind 
metapost shape.
but it does not work properly for me (current version: 2024.04.01 08:59) 
and produce empty page but with searchable hidden text.


as mentioned kind = "outline" will be in the next upload so with the 
current one you need to use the also posted here for ... endfor variant



also when i edit the code and replace metapost part like this:

\startMPcode
      draw lmt_outline [
          kind = "outline",
          text = "\getbuffer[MyText]",
       ]
          withcolor red
       ;
\stopMPcode

it produces a selectable hidden text on top of body and red text that 
drawn by metapost below of that.


How can this problem be solved?

i attached the codes and pdf results.

On Mon, Apr 8, 2024 at 4:37 AM Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


On 4/8/2024 8:22 AM, seyal zavira wrote:
 > thank you Harban and Keith McKay.
 >
 >     \startMPpage
 >            picture tt ; tt := lmt_outline [
 >                kind = "path",
 >                text =
"\definedfont[name:texgyrepagellabold*default]foo
 >     f o o",
 >            ] ;
 >
 >            fill
 >               for i within tt : pathpart i && endfor cycle
 >               withshademethod "linear"
 >               withshadedirection down
 >               withshadecolors (red, blue) ;
 >     \stopMPpage
 >
 >     I'll add this:
 >
 >     \startMPpage
 >           draw lmt_outline [
 >               kind = "outline",
 >               text =
"\definedfont[name:texgyrepagellabold*default]foo f
 >     o o",
 >           ]
 >               withshademethod "linear"
 >               withshadedirection down
 >               withshadecolors (red, blue)
 >           ;
 >     \stopMPpage
 >
 >     so a single path option (no picture)
 >
 >     Hans
 >
 >
 > Thank you so much for the sample examples
 > it would be great to also make text select able in output pdf
 > the third example currently does not work. did you mean you will add
 > this feature for next updates?
we're talking outlines so that is paths which implies no search but you
can do this (Keith and/or Hraban will explain and/or wikify it)

\starttext

\startbuffer[MyText]
      \definedfont[name:texgyrepagellabold*default]foo f o o%
\stopbuffer

\startbuffer[MyText]
      \framed[align=normal,frame=off]{\input{tufte}}%
\stopbuffer

\setbox\scratchbox\hbox\bgroup
      \startMPcode
           draw lmt_outline [
               kind = "outline",
               text = "\getbuffer[MyText]",
           ]
               withshademethod "linear"
               withshadedirection down
               withshadecolors (red, blue)
           ;
      \stopMPcode
\egroup

\startoverlay


{\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
      {\box\scratchbox}
\stopoverlay

\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 

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-08 Thread Hans Hagen

On 4/8/2024 8:22 AM, seyal zavira wrote:

thank you Harban and Keith McKay.

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

       fill
          for i within tt : pathpart i && endfor cycle
          withshademethod "linear"
          withshadedirection down
          withshadecolors (red, blue) ;
\stopMPpage

I'll add this:

\startMPpage
      draw lmt_outline [
          kind = "outline",
          text = "\definedfont[name:texgyrepagellabold*default]foo f
o o",
      ]
          withshademethod "linear"
          withshadedirection down
          withshadecolors (red, blue)
      ;
\stopMPpage

so a single path option (no picture)

Hans


Thank you so much for the sample examples
it would be great to also make text select able in output pdf
the third example currently does not work. did you mean you will add 
this feature for next updates?
we're talking outlines so that is paths which implies no search but you 
can do this (Keith and/or Hraban will explain and/or wikify it)


\starttext

\startbuffer[MyText]
\definedfont[name:texgyrepagellabold*default]foo f o o%
\stopbuffer

\startbuffer[MyText]
\framed[align=normal,frame=off]{\input{tufte}}%
\stopbuffer

\setbox\scratchbox\hbox\bgroup
\startMPcode
 draw lmt_outline [
 kind = "outline",
 text = "\getbuffer[MyText]",
 ]
 withshademethod "linear"
 withshadedirection down
 withshadecolors (red, blue)
 ;
\stopMPcode
\egroup

\startoverlay

{\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
{\box\scratchbox}
\stopoverlay

\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: Very bizarre bug

2024-04-07 Thread Hans Hagen

On 4/7/2024 10:14 PM, Thomas A. Schmitz wrote:

On 4/7/24 19:44, Hans Hagen wrote:
ok, so this "on" ... where does it come from .. you can try to run 
with \tracingall and then quit the run after the first and search the 
log for !on to get a clue


Hans


Found it - and I'm embarrassed to say it was in my own environment file, 
not in the lmtx distribution. I have a Lua function that prints 
information about the computer model and the operating system into a 
layer. Unfortunately, there was an "elseif" in there somewhere which 
should catch exceptions (such as a raspberry pi), but instead of 
concatenating the relevant return values to display in the layer, I had 
a ' context (" on ")' in there (probably for debugging) which I forgot 
about.


Sorry for the noise - I was getting too sophisticated for my own good...

No problem, is it a rpi 5? If so, how does that one perform?

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: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Hans Hagen

On 4/7/2024 7:42 PM, Henning Hraban Ramm wrote:

Am 07.04.24 um 19:05 schrieb Hans Hagen:

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

 path bb ; bb := boundingbox tt ;
 path pp ; pp := bb enlarged 2cm ;

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

 draw tt withcolor green ;
\stopMPpage

no need to loop over tt


But the intention was to get a gradient _within_ the text.

Might there be a problem with the latest changes to gradients?

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

 fill
for i within tt : pathpart i && endfor cycle
withshademethod "linear"
withshadedirection down
withshadecolors (red, blue) ;
\stopMPpage

I'll add this:

\startMPpage
draw lmt_outline [
kind = "outline",
text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
]
withshademethod "linear"
withshadedirection down
withshadecolors (red, blue)
;
\stopMPpage

so a single path option (no 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: Very bizarre bug

2024-04-07 Thread Hans Hagen

On 4/7/2024 7:37 PM, Thomas A. Schmitz wrote:

On 4/7/24 19:21, Hans Hagen wrote:
can you make a format with line 25 of context.mkxl uncommented to see 
if you get a message (not production, just a test)


Hans


That should give a message "some spurious input in line..." in the 
output or the log, right? No, did not see such a message.
ok, so this "on" ... where does it come from .. you can try to run with 
\tracingall and then quit the run after the first and search the log for 
!on to get a clue


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: Very bizarre bug

2024-04-07 Thread Hans Hagen

On 4/7/2024 7:08 PM, Thomas A. Schmitz wrote:

Hi everybody,

this is bizarre, but hear me out: a file that I have has a mixture of 
xml, TeX and Lua. It compiles cleanly, no problem, on macos and linux. I 
also have a little raspberry pi on which I have installed lmtx. The file 
compiles, BUT: it has one additional page. The first page of the 
document is empty and has the word "on" in the upper left hand corner of 
the text area. I have checked several times, it always comes out like 
this. Everything else is exactly the same - context version, file and 
environment files (everything under git, so really identical). The "on" 
does not appear if I just make a "hello world" document on the raspi. So 
my question is: how can I begin to explore where this word creeps in? I 
suspect it's something in the linux-aarch64 tree or some test for this 
architecture that is the culprit, but what would be a good way to trace it?


can you make a format with line 25 of context.mkxl uncommented to see if 
you get a message (not production, just a test)


Hans


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

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

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


[NTG-context] Re: 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] Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Hans Hagen





 Forwarded Message 
Subject: Re: [NTG-context] Re: how to apply gradient color to a piece of 
text?

Date: Sun, 7 Apr 2024 19:05:13 +0200
From: Hans Hagen 
To: Keith McKay 

On 4/7/2024 6:56 PM, Keith McKay wrote:
Not for me either. I used it somewhere so I'll need to look back in my 
files.


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

path bb ; bb := boundingbox tt ;
path pp ; pp := bb enlarged 2cm ;

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

draw tt withcolor green ;
\stopMPpage

no need to loop over tt



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

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : 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

Hi,


-- Support for MathML*

ha, mml and support for it (comes and goes in browsers) has been if flux 
for ages (features get added but also removed) so what are we talking 
about here, maybe in a few decades when people stopped messing with it 
(and somethign new showed up it might work out


-- Support for modern Unicode*

i must have missed something (probably ancient unicode)

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

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


Oh, as usual with PDF association…

That’s not how you promote open standards.

(Didn’t check, jost forwarded the message.)


2. Well-Tagged PDF (WTPDF)
https://pdfa.org/wtpdf/

well, tagging ...


Of course.

But you asked for wanted accessibility features:


sure.

We have \pdfbackendactualtext{visible}{alternative}, can we get 
alternative text (ActualText) for images?
Not automatically, of course (if someone wants AI descriptions they can 
implement a module), just as a keyword in \externalfigure?


we can add a description option that then can eb used in the wrapper 
(not that it helps much to make an image accessible)


btw, someone showed me what this acrobat liquid mode does to a document 
... the fact that one has to apply 'ai' to a document is a bad omen and 
makes one wonder ... but anyway, big tech, big money, etc so ... (after 
visiting a typesetting museum today one again realizes that a few 
decades from now one will look back in a certain way, not all is progress)


one thing we need to keep in mind is that as soon as 'obsolete' and 'not 
to be used' enters descriptions (which kind of contradicts the 
flexibility of sofware) one can also wonder how older documents can ever 
match a standard; i often get the impression that instead of some 
thinking ahead we end up adapting to what can't be done or what went 
wrong (and calling something a standard can then be a way to obscure)


anyway, one way or the other we will cope (and it depends on user demand 
which in turn depends on organizational demand)


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

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


2. Well-Tagged PDF (WTPDF)
https://pdfa.org/wtpdf/

well, tagging ...

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: incosistent output of --- dash

2024-04-06 Thread Hans Hagen

On 4/6/2024 1:38 PM, Wolfgang Schuster wrote:

Henning Hraban Ramm schrieb am 06.04.2024 um 12:23:

Am 06.04.24 um 11:43 schrieb madiazm.eo...@gmail.com:

Hi everyone,
I'm a bit puzzled because I usually don't get an em-dash when I type 
tree hyphens. If I use the command \emdash, no problem but when I use 
the hyphens some days it works... and somedays I see three small 
hyphens.
I tried it on overleaf and of ContextOnWeb with the same 
inconsistency. If I create a new file it usually works right; but 
when I overwrite an existing file subtituting a hyphen for three 
where the dash should be I sometimes get it right and sometimes wrong.
It is not the pdf viewer since I get good or bad results in all, the 
overleaf pdf preview tool, the context on web preview tool and the 
mozilla integrated pdf viewer.


Am I missing something on the use of this ligature? (the question is 
just out of curiosity, since I plan to create a command that adds a 
hairspace after or before the dash, since I don't like it to stick to 
some letters like "o".


Generally, “we” try to reduce active characters as much as possible, 
that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
activate these ligatures as a font feature though (AFAIR 
"latexhyphens", can’t find it…).


The name of the option has changes a few times and the current setting 
is textcontrol=collapsehyphens.



Some editors and some fonts do automatical replacements.


In this case it could be the wrong symbol in the document, there are 
many dashes in unicode which look similar in the input and output files.


\starttext

\startbuffer
\starttabulate[|T]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\getbuffer

\setupbodyfont[pagella]

\getbuffer

\stoptext
detail: it is not a real fontfeature (as tlig in mkiv) but implemented 
differently with a bit more control, so we have


\nohyphencollapsing
\dohyphencollapsing

etc too as control options. These collapsed hyphens are also configured 
as valid hyphenation chars.


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

2024-04-01 Thread Hans Hagen

On 4/1/2024 11:34 AM, Otared Kavian wrote:

Hi Hans and Mikael,

Thanks for the new module math-goodriddance !
Indeed there are many mathematicians who are going to use the 
\goodriddancemath command, and no doubt they are going to thank you, 
even if they are very shy to come out.


Moreover this command can be used by people who want to transform the 
output PDF into an audio file, because for instance the following


\usemodule[math-goodriddance]
\goodriddancemath

\starttext

\startformula
\int_{0}^{\pi} \sin(x)\dd x = 2.
\stopformula

\stoptext

gives

integral from 0 to 휋 , of sin of 푥 d 푥 equals 2


you cna be more ambituous:

\im { C \of (\openinterval{a,b}) \neq C^^2 \of (\interval{a,b}) \neq 
C^^2 \of \interval{0,1} \neq C\of(\Omega) \neq 풞 \of (\Omega)}


or

\dm {u\of(b)-u\of(a)=\lim_{n\to+\infty} \parenthesis{f(x__1)\Delta 
x__1+f(x__2)\Delta x__2+\ldots+f(x__n)\Delta x__n}}


so we can really get rid of a lot of math

as one can see in the attached output which is very useful for the blind 
using an audio software.
yes, although unfortunately unicode never bothered to add some handy 
stuff for that (while if did for other comparable things) but we'can get 
around that


I now assume that you are willing to come up with the french 
translations (that then can be validated by Alan).  Do we actually have 
serious german context math users, as I wouldn't trust Hraban and Thomas 
on doing this?


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-04-01 Thread Hans Hagen

Hi,

There is a new lmtx upload.

-- The svg inclusion via metapost has been upgraded and cleanup a bit, 
using some more recent metapost features. There are some new (not yet 
all documented metapost) features.


-- In the process, support for LCH colors has been added, which is 
documented in the (eg luametafun manual).


-- The math manual is not yet there because we were distracted by 
improving support for envelopes (penbased outlines) in metafun. This is 
still work in progress, some is present and discussed in the manual, and 
we'll come back to that sometime next month. Given the next item, we 
also might need to change some in the manual (different focus).


-- Because we have users who have to conform to the European 
Accessibility Act we have been wondering how to deal with that and at 
Mikaels place there are two demands: distinctive colors and tagging and 
especially math (somehow validators love to check that). Colors never 
were an issue as they can be controlled, and tagging math neither, 
especially because nothing was/is done with it anyway, but ... we are 
happy that we found a reasonable (more modern and future proof) way out.


As explained / shown in the attached document we're basically forced to 
choose a different approach with math (a pity as we worked hard to get 
the rendering right but the attached file works fine in the viewers that 
we tested).


-- We like to hear from users what other demands wrt accessibility there 
are. We're not interested in the (commercial) big money aspects (of pdf 
and tagging) nor in the politics behind it (changes over time). What are 
the demands, so that we can see how to make it work or just work around 
it (as it's kind of boring to cook uyp complex features	, esp compared 
to playing with metapost).


-- Furthermore .. the usual bits and pieces as discussed on the list and 
otherwise.


-- If you have troubles (crash) you need to wipe the cache due to a 
change in lua bytecode storage (no easy way to catch it).


Hans & Mikael

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

math-riddance.pdf
Description: Adobe PDF document
% language=us

% todo: no comma

\usemodule[scite]
\usemodule[article-basic]
\usemodule[abbreviations-logos]
\usemodule[math-goodriddance]

\setuplayout[tight]

\starttext

\subject{Good riddance}

We're done with math. After years of active development, Mikael and Hans have
decided to quit working on math, and concentrate on \METAPOST\ and handing over
to the next generation instead. We lost our user to the way more popular
alternative (frozen in stone standards). Also, we had it with suboptimal math
fonts, Unicode math not getting improved, MathML constantly being changed,
browsers dealing with math differently every few years, math archives getting
polluted with tons of useless tagged math.

There are other motivations, like the European union imposing strict rules with
respect to accessibility in educational content management systems, and Dutch
schools trying to get rid of math in favor of simple calculus, if at all. This 
is
why the next iteration of the engine will no longer have a math engine:
MathLessTeX. Of course, in the beginning \MLTX\ will be compatible with \LMTX,
because we owe that to the users and we need to prototype the new engine anyway.

In order to get an idea of how we will get rid of the disturbing formulas, you
can load the module:

\starttyping
\usemodule[math-goodriddance]
\stoptyping

Until becoming the default setting, the command \typ {\goodriddancemath} will
bring you into \MLTX\ mode while \typ {\badriddancemath} will bring you back to
the obsolete \LMTX\ mode. Like:

\startbuffer
\usemodule[math-goodriddance] \goodriddancemath

Who wants to solve the equation \m {x + 1 = 4} or deal with the function \m {x 
\mapsto
\root [3] {x}}, when we have AI around the corner to help us out with simple 
and silly
things like the Pythagorean theorem: \m {a^2 + b^2 = c^2}, or even with more 
advanced
math like geometric series: \m {\sum_{k = 0}^{+\infty} x^k = 1/(1 - x)}?

We will not support complicated nonsense stuff like:

\startplaceformula
\startformula
F__{1}{2}(a,b;b;z) = (1 - z)^{-a}
\stopformula
\stopplaceformula

When developing this Hans' Swedish improved a lot. {\language[sv] Den lilla del 
av
befolkningen som handlar på IKEA och tittar på fåniga krimserier förstår kanske 
detta:
\im {\sqrt {x + 1} = \sin(4 + y)}!}
\stopbuffer

\typebuffer[option=TEX]

Which gives us the beautifully typeset:

\startcolor[darkblue] \getbuffer \stopcolor

We hope that the highly respected Swedish Academy will consider our prose in
their upcoming evaluations. Our first submission to the leading \TEX\ journal 
was
how

[NTG-context] Re: How to get an image to fill the maximum available space?

2024-03-30 Thread Hans Hagen

On 3/30/2024 12:07 PM, Bruce Horrocks wrote:




On 30 Mar 2024, at 09:38, Henning Hraban Ramm  wrote:

Am 30.03.24 um 03:15 schrieb Joel via ntg-context:

I have code like this:
 \placefigure[here, force]{my caption}{%
 \externalfigure[#1][frame=on, maxheight=1.2\textwidth, 
maxwidth=\textwidth]%
 }%
I need some images to appear in a book. I need them to keep their proper 
ratios, but scale up to the maximize the available space.
The image can't be more than \textwidth wide, and can't ever be more than 
1.2\textwidth high.
The problem I am getting with this code, and it does seem to be limiting the 
images to be not bigger than those two dimensions above, is some of the images, 
for reasons I can't understand, are appearing really tiny and aren't scaling up 
to fill as much space as is possible. I can't explain why this is 
happening--the images themselves are very very high resolution.
Is there any way to modify the code to make sure the image stretches up to be 
the biggest it can, without exceeding the sizes I've listed?


Hi Joel,

AFAIK, if you don’t set at least either height or width, ConTeXt uses the 
image’s resolution setting to calculate its size, and that is often useless.

(Maybe there’s also something wrong with ConTeXt’s max width/height, I don’t 
know; I’m still planning to carefully check all options of image processing…)

You could try if "factor=fit" or "factor=max" yields the results you want.


As Hraban says, you only need to set one of height or width and Context works 
out the other.

For your case I think you just need width=\textwidth, so

   \externalfigure[#1][frame=on,width=\textwidth,maxheight=1.2\textwidth]%

where maxheight imposes the height size limit you mention.

If you still have problems with tiny images then I suspect that is a different 
issue - something to do with the image file and the metadata about the image 
size maybe? If you can share an affected image then perhaps start another 
question with an MWE and upload the image somewhere.

% \externalfigure
% [t:/sources/cow.pdf]
% [frame=on,factor=max]

\externalfigure
[t:/sources/mill.png]
[frame=on,factor=max,maxwidth=\textwidth,maxheight=.8\textheight]


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

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : 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 units es and dk

2024-03-24 Thread Hans Hagen

On 3/23/2024 8:31 PM, Hraban Ramm wrote:


Am 23.03.24 um 19:05 schrieb Hans Hagen:

On 3/23/2024 2:27 PM, Wolfgang Schuster wrote:

Regarding the dk unit: https://tug.org/TUGboat/tb42-3/tb132hagen-dk.pdf

The es, ts and eu are discussed here:

https://tug.org/TUGboat/tb44-2/tb137egger-edith.pdf


In German, I call these "Spaßeinheiten" (units of measurement = 
"Maßeinheiten"; Spaß = fun; "units of leisurement" might be a good 
translation).
Apart from being fun they are also useful, for instance the "ts" (and 
dk) make good framed offsets when making examples. Of the "serious" unit 
is only use pt, mm and cm (and bp in the backend).


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: Unknown units es and dk

2024-03-23 Thread Hans Hagen

On 3/23/2024 2:27 PM, Wolfgang Schuster wrote:

Jan Ulrich Hasecke via ntg-context schrieb am 23.03.2024 um 13:57:

I saw this in (the btw great) bachotex-stepbystep presentation

\definepapersize
[example]
[width=8.5es,
height=11es]


\setuptextbackground
[location=paragraph,
backgroundcolor=MyColors:4,
backgroundoffset=1dk,
frame=off]


The units "es" and "dk" are unknown to me.
What does they mean?


Regarding the dk unit: https://tug.org/TUGboat/tb42-3/tb132hagen-dk.pdf

The es, ts and eu are discussed here:

https://tug.org/TUGboat/tb44-2/tb137egger-edith.pdf

it also discusses how the team callibrated these units by sampling texies.

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, runner, and TikZ patches

2024-03-18 Thread Hans Hagen

On 3/18/2024 1:31 AM, Jim wrote:

On Sat, Mar 16, 2024 at 15:20 (+0100), Hans Hagen wrote:


On 3/16/2024 2:10 PM, Jim wrote:

On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:



On Thu, 14 Mar 2024, Jim wrote:



Max (et al),



were you hoping the ConTeXt distribution would ship its own
pgfutil-context.def, or were you hoping that someone could convince Henri
to put the RGB change in?



We can patch some of the definitions of pgfutil-context.def in m-tikz if
really needed, but it would be preferable to first check if tikz
maintainers are willing to merge them upstream.



Unfortunately, it seems that the maintainer feels that if we can't deal
with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
that's where it ended.  (I was arguing for plain TeX support at the time in
the linked^2 message, but I was able to add the definition for cmyk to my
own macro file, so I was able to process examples with cmyk colours.)

What does the maintainer mean by that ... context


The maintainer's comment was about plain TeX, not context.  Sorry if that
wasn't clear.


ah, good to know


In any case, I should have sent my request to Max alone, rather than the
ntg-context list, because if Max was going to push something there, I was
hoping that a second appeal for cmyk colour support in plain would be
nice.  (I'm not quite ready to give up all of my plain TeX files.)


if it's plain, indeed, too confusing otherwise (it's no problem asking 
plain questions here but in this tikz case kind of confusing)



can add profiles if configured to do so (best not to embed them) ... and
why should there be a profile anyway ... crappy arguments ..


I agree about the colour profile, but the last time I poked that bear, my
pleas fell on deaf ears.


not even plain needs color profiles and i hope tikz doesn't add them


[And in summary, to be clear: I'm good with the colour support in ConTeXt!]

ok

Hans


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

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : 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, runner, and TikZ patches

2024-03-16 Thread Hans Hagen

On 3/16/2024 2:21 PM, Jim wrote:


I hope that time doesn't come, because either someone (you? :-) would be


not me as i don't need tikz and so i wouldn't notice what functionality 
got adapted



left with an on-going job of patching the snapshot, or ConTeXt's version of
tikz would become increasingly different (and, presumably, increasingly
less capable than the "mainline" version).
i guess it depends on what gets added .. maybe a bit of diffing to see 
if changes affect something or not before upgrading


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, runner, and TikZ patches

2024-03-16 Thread Hans Hagen

On 3/16/2024 2:10 PM, Jim wrote:

On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:


On Thu, 14 Mar 2024, Jim wrote:



Max (et al),



were you hoping the ConTeXt distribution would ship its own
pgfutil-context.def, or were you hoping that someone could convince Henri
to put the RGB change in?



We can patch some of the definitions of pgfutil-context.def in m-tikz if
really needed, but it would be preferable to first check if tikz
maintainers are willing to merge them upstream.


Unfortunately, it seems that the maintainer feels that if we can't deal
with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
that's where it ended.  (I was arguing for plain TeX support at the time in
the linked^2 message, but I was able to add the definition for cmyk to my
own macro file, so I was able to process examples with cmyk colours.)
What does the maintainer mean by that ... context can add profiles if 
configured to do so (best not to embed them) ... and why should there be 
a profile anyway ... crappy arguments .. especially because when i run


\usemodule[tikz]

\startTEXpage

\definecolor [colorone] [r=0,g=0,b=0.5]
\definecolor [colortwo] [c=0,m=1]

\starttikzpicture
\fill [colorone] (0,0) circle(2) ; % rgb
\fill [colortwo] (0,0) circle(1) ; % cmyk
\stoptikzpicture
\setupcolors[cmyk=no]
\starttikzpicture
\fill [colorone] (0,0) circle(2) ; % rgb
\fill [colortwo] (0,0) circle(1) ; % rgb
\stoptikzpicture

\stopTEXpage

here i get a pdf file with rgb and cmyk. Maybe I have an old tikz and 
something changed (wouldn't be the first time). So let's forget about 
maintainers and ugly hacks, and identify what is the real problem.


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
-


oeps.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: 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: PDF, runner, and TikZ patches

2024-03-15 Thread Hans Hagen

On 3/15/2024 12:53 AM, Jim wrote:

Max (et al),

were you hoping the ConTeXt distribution would ship its own
pgfutil-context.def, or were you hoping that someone could convince Henri
to put the RGB change in?

And, if anyone has the will to push this (or add it in to a ConTeXt
distribution version), I'd still like the cmyk support, even if there is no
ability to specify colour profiles:

\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil
{
 \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
 \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
 \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
 \expandafter\edef\csname\string\color@#1\endcsname
 {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
}

I don't see that it would hurt anything, even if it doesn't give complete
cmyk support.

We provide

\pgf@context@registercolor
\pgf@context@registergray
\pgf@context@registerrgb
\pgf@context@registercmyk

in colo-ini that hook into the context color mechanism so be careful 
with patches. I'm not going to spend time on other solutions that can 
interfere with internals.


(I wonder when the moment comes that we have to take a snapshot of tikz 
and stay with that.)


Hans

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

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

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


[NTG-context] Re: PDF, runner, and TikZ patches

2024-03-15 Thread Hans Hagen

On 3/15/2024 12:18 AM, Max Chernoff wrote:

Hi all,

I've had a few patches applied to my installation for a little while
now, so I figured that I should send them in. There's a diff at the end
of the email, and the modified files are attached [but rejected by the
mailing list, so sent separately to Hans]

  * In the definition of "featurecreep()" in "lpdf-mis.lmt",
"structures.pages.tobesaved[i].status" should be "[...].state" to
match the definition of "pages.save" in "strc-pag.lua".


ok, changed, i assume you tested it


  * For the "resultof" runner in "util-sbx.lmt", the current io.popen
mode only works with Windows. See the definition of "l_checkmodep" in
"liolib.c".


i trust you on that (never run piped on linux, only on windows)


  * Some of the pgfplots 3D shaders appear to be broken,
see https://tex.stackexchange.com/a/708121 .

  * The TikZ "RGB" colour model does not currently work properly. This is

internally used by "\usepgfplotslibrary[colorbrewer]" among others.
See https://github.com/pgf-tikz/pgf/pull/1130 .


see mail by others

Thanks,

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: \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: how to include an an svg file?

2024-03-12 Thread Hans Hagen

On 3/12/2024 2:53 PM, seyal zavira wrote:

thanks for your reply

yes but i don't have problem with regular svgs but when svgs has 
gradient color it does not produce any color in output.


you can see my svg in attachment.
svg gets worse and worse (esp the inheritance model) ... anyway, i can 
sort of get the gradient but no stepwise gradient opacity (in pdf and 
i'm not going to emulate something) (it's not the most interesting stuff 
to work on unpaid)


but ... i don't know if fixing this breaks something else

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: \intertext and highlighting with \alignhere/\breakhere

2024-03-12 Thread Hans Hagen

On 3/12/2024 8:57 AM, Max Chernoff wrote:

Hi all,

Often I want to include a sentence/paragraph in the middle of a long
multipart formula. With the old \startalign/\stopalign formulas, I could
use \intertext{...} to do this, but this doesn't work with the new
\alignhere/\breakhere formulas. I've managed to find a "solution" for
this, although I'd prefer something a bit less hacky. Any ideas?

Also, is there a way to highlight an equation across an \alignhere? Once
again, I've found a "solution", but like before, it's pretty hacky.

Example files are attached.

the next upload will support the attached ... so no ugly hacky code 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
-


inter-001.pdf
Description: Adobe PDF document
\definebar[mybar][inlined][offset=.25ex,color=red]

\starttext

\startformula
a  \alignhere= b + c \breakhere
\mybar {d + e} \alignhere= f \breakhere
g  \alignhere= h + i
\stopformula

\page

\samplefile{knuth}
\startformula
\text{something} + \text{really} + \text{really} + \text{long} 
\alignhere= \sqrt{x} \numberhere
\texthere[inbetween]{\input{knuth}}
d \alignhere= e + f \numberhere \breakhere
g \alignhere= h + i \breakhere
j \alignhere= k + l
\stopformula
\samplefile{knuth}

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

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


[NTG-context] Re: \intertext and highlighting with \alignhere/\breakhere

2024-03-12 Thread Hans Hagen

On 3/12/2024 8:57 AM, Max Chernoff wrote:

Hi all,

Often I want to include a sentence/paragraph in the middle of a long
multipart formula. With the old \startalign/\stopalign formulas, I could
use \intertext{...} to do this, but this doesn't work with the new
\alignhere/\breakhere formulas. I've managed to find a "solution" for
this, although I'd prefer something a bit less hacky. Any ideas?

Also, is there a way to highlight an equation across an \alignhere? Once
again, I've found a "solution", but like before, it's pretty hacky.

Example files are attached.

maybe

\starttexdefinition protected newintertext #1
\leftparbox [global] {
\vadjust pre \bgroup
\forgetall
\vskip.5\strutdp % needs to be more clever in the end
\dontleavehmode\vtop\bgroup
#1
\egroup
\egroup
}
\breakhere
\stoptexdefinition

but i need to discuss it with Mikael as we might integrate something 
better and then it needs to be documented (in the upcoming manual) as well


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-03-11 Thread Hans Hagen

Hi,

Todays update has a fix for the compact mode slant interference (as 
explained by Wolfgang a few days ago). Hopefully that works out well.


We (MS and HH) also managed to make curve detection more accurate (the 
decision routine that is responsible for straight lines in the MP 
output) so that extreme paths with control points way beyond reasonable 
still produce the right output (before we could get a wrong bbox due to 
clipping the curve in the backend). One can actually also force "always 
curve" with "withcurvature 1" (more variants might follow) but that is 
more or us to have a test option. Curvature detection is mostly a pdf 
efficiency feature and normally users should rely on the default to work 
okay.


Other new mp features are relative and absolute points which makes it 
possible to define paths in a turtle graphics way (a bit like hlineto 
and vline in postscript), a native "--" operator (equivalent but 
somewehat more efficient on huge generated paths). The luametafun manual 
has a chapter on paths that describes some of this.


Yet another new feature is "firstcontrol" and "secondcontrol" that is an 
addendum to controls that makes both control points the same when only 
one is given.


Finally there is a fix in mp where some directions, think { dir 120 }, 
gave the wrong result due to sign swapping (so it was seen as { dir 200} 
or { dir -60 }) as side effect of negative zeros fed into tan2. This 
became obvious when MS reprocessed a graphic, as last year we switched 
from scsled (no bug) to double (long time bug exposed). (The bug is also 
present in LuaTeX double/binary mode but it will be fixed there too.)


The rest is not (yet) worth mentioning,

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: \em issue in MkXL (2024.03.05 11:26)

2024-03-10 Thread Hans Hagen

On 3/10/2024 11:48 AM, Wolfgang Schuster wrote:

Hans Hagen via ntg-context schrieb am 10.03.2024 um 10:46:

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


The problem is that compact mode uses them to apply the slanted feature 
without any manual use of the commands from a user.


\enableexperiments[fonts.compact]

\definefontfamily[mainface][rm][TeX Gyre Termes]
   [it={style:regular, features:{default,slanted}},
    sl={style:regular, features:{default,slanted}}]

\setupbodyfont[mainface]

\starttext

\startstyle[style=italic]normal {\em emphasized} normal\stopstyle

\stoptext

The only way to mask the effect is to create a new fontfeature with the 
minimum slant value and apply it to the upright style.


\definefontfeature [unslanted] [slant=0.001]

\definefontfamily[mainface][rm][TeX Gyre Termes]
   [features={default,unslanted},
    it={style:regular, features:{default,slanted}},
    sl={style:regular, features:{default,slanted}}]

ok, i'll fix that (build is down so no update)

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: \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: additional font faces

2024-03-08 Thread Hans Hagen

On 3/8/2024 5:55 PM, Henning Hraban Ramm wrote:
Hi, if I need an additional pair of upright and italic font faces, e.g. 
a Medium or Light version, would it make sense to define them like this:


I'd just define a new typeface / bodyfont, using fo rinstance

\starttypescript [sans] [AlegreyaMedium]

and then use

\switchtobodyfont[AlegreyaMedium]\sl

or

\AlegreyaMedium\sl

which is also more efficient than adding more variants

Hans


% adapted from font-pre.mkxl

\definefontalternative[md]
\definefontalternative[mi]
\definefontalternative[ms]

\definealternativestyle [medium] [\md] []
\definealternativestyle [mediumitalic,italicmedium]  [\mi] []
\definealternativestyle [mediumslanted,slantedmedium][\ms] []

\definealternativestyle [sansmedium]  [\ss\md] []
\definealternativestyle [serifmedium] [\rm\md] []
\definealternativestyle [monomedium]  [\tt\md] []

%\definealternativestyle [mediumface]    [\mediumface]    []

\unexpanded\def\normalmd{\let\fontalternative\md\font_helpers_synchronize_font}
\unexpanded\def\normalmi{\let\fontalternative\mi\font_helpers_synchronize_font}
\unexpanded\def\normalms{\let\fontalternative\ms\font_helpers_synchronize_font}

\let\md\normalmd
\let\mi\normalmi
\let\ms\normalms

\definehighlight[medium   ] [command=no,style=medium]
\definehighlight[mediumitalic ] [command=no,style=mediumitalic]
\definehighlight[mediumslanted] [command=no,style=mediumslanted]


Is that necessary? And is it enough?


\starttypescript [sans] [alegreya]
   \definefontsynonym[AlegreyaSans-Regular][name:AlegreyaSans-Regular]
   \definefontsynonym[AlegreyaSans-Italic][name:AlegreyaSans-Italic]
   \definefontsynonym[AlegreyaSans-Caps][name:AlegreyaSansSC-Regular]
   \definefontsynonym[AlegreyaSans-ItalicCaps][name:AlegreyaSansSC-Italic]
   \definefontsynonym[AlegreyaSans-Medium][name:AlegreyaSans-Medium]

\definefontsynonym[AlegreyaSans-MediumItalic][name:AlegreyaSans-MediumItalic]
   \definefontsynonym[AlegreyaSans-MediumCaps][name:AlegreyaSansSC-Medium]

\definefontsynonym[AlegreyaSans-MediumItalicCaps][name:AlegreyaSansSC-MediumItalic]
   \definefontsynonym[AlegreyaSans-Bold][name:AlegreyaSans-Bold]
   
\definefontsynonym[AlegreyaSans-BoldItalic][name:AlegreyaSans-BoldItalic]

   \definefontsynonym[AlegreyaSans-BoldCaps][name:AlegreyaSansSC-Bold]

\definefontsynonym[AlegreyaSans-BoldItalicCaps][name:AlegreyaSansSC-BoldItalic]
\stoptypescript

\starttypescript [sans] [alegreya] [name]
   \definefontsynonym [Sans]   [AlegreyaSans-Regular] []
   \definefontsynonym [SansItalic] [AlegreyaSans-Italic]  []
   \definefontsynonym [SansSlanted]    [AlegreyaSans-Italic]  []
   \definefontsynonym [SansMedium]   [AlegreyaSans-Medium] []
   \definefontsynonym [SansMediumItalic] [AlegreyaSans-MediumItalic][]
   \definefontsynonym [SansMediumSlanted][AlegreyaSans-MediumItalic][]
   \definefontsynonym [SansBold]   [AlegreyaSans-Bold]    []
   \definefontsynonym [SansBoldItalic] [AlegreyaSans-BoldItalic]  []
   \definefontsynonym [SansBoldSlanted][AlegreyaSans-BoldItalic]  []
   \definefontsynonym [SansCaps]   [AlegreyaSans-Caps] \stoptypescript
___
If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Log entries about confusing level change

2024-03-08 Thread Hans Hagen

On 3/8/2024 3:38 AM, Rik Kabel wrote:

Hello all,

The following example produces two log entries that seem a bit odd. The 
log entries are:


backend > bookmarks > confusing level change at level 3
around '1 body1'
backend > bookmarks > confusing level change at level 3
around 'back1'

and they refer to the first chapter of the bodymatter and the first 
chapter of the backmatter, respectively.


The example:

\setupinteraction [state=start]
\placebookmarks   [chapter]
\starttext
   \startfrontmatter
     \startchapter [title=front1]
   \samplefile {knuth-gpt}
     \stopchapter
   \stopfrontmatter
   \startbodymatter
     \startchapter [title=body1]
   \samplefile {knuth-gpt}
     \stopchapter
   \stopbodymatter
   \startbackmatter
     \startchapter [title=back1]
   \samplefile {knuth-gpt}
     \stopchapter
   \stopbackmatter
\stoptext

Does the level change message suggest that something is missing in the 
document?
normally harmless so i can add an extra check but bookmarks can be a 
pain when less structure is used (somewhat weird low level pdf stuff)


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 version parse question

2024-03-07 Thread Hans Hagen

On 3/7/2024 7:36 PM, Rik Kabel wrote:

Hello all,

The font tweak file libertinus_math.lfg tests for a font version of 
*7.040*, but the result of the version parse is *7.040;RELEASE*, 
resulting in an error message. I do not know if this is the fault of the 
parser or of the font metadata. Changing the test in the .lfg file fixes 
the error, but that is not a long-term solution.


The exact message I get in the log is:

mathematics > tweak > 'LibertinusMath-Regular', size 10, math
size 0, version 'Version, 7.040;RELEASE' found, version 'Version
7.040' expected

This is not a high-priority issue for me -- I have nothing in this 
document that would benefit -- but others may appreciate a fix.
Unless we have a crash it's just a warning, more for Mikael and me so 
that we know when to check. One cannot rely on a version being a number, 
so who knows what to test. Consistency, also within a font family is 
often an issue.


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: imposition: getting to the last page of a booklet

2024-03-06 Thread Hans Hagen

On 3/6/2024 7:50 PM, Wolfgang Schuster wrote:

The semicolon is a undocumented extension (I noticed it in the 
definition of \page[quadruple]) of \numexpr in Luametatex for the 
modulus operator.


One of these days I have to write the pending section in th elow level 
manual and also explain this:


\starttext
\ifnum  10  = 11 wrong \else okay  \fi
\ifnum  10 != 11 okay  \else wrong \fi
\ifnum  10 !> 11 okay  \else wrong \fi
\ifnum  10 !< 11 wrong \else okay  \fi
\ifnum  10 ≤  11 okay  \else wrong \fi
\ifnum  10 ≥  11 wrong \else okay  \fi
\ifnum  10 ≰  11 okay  \else wrong \fi
\ifnum  10 ≱  11 wrong \else okay  \fi
\ifnum "F0 ∈ "F0 okay  \else wrong \fi
\ifnum "F0 ∉ "F0 wrong \else okay  \fi
\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
___


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Hans Hagen

On 3/6/2024 11:18 AM, Marco Patzer wrote:

On Tue, 5 Mar 2024 23:14:04 +0100
Wolfgang Schuster  wrote:


Here is the official solution:

\startxmlsetups xml:meta
\setupmetadata
  [author={\xmltext{#1}{/author}},
   title={\xmltext{#1}{/title}}]
\stopxmlsetups


So now we have:

\setupinteraction
   [title=FooBar]

\setupdocument
   [metadata:title=FooBar]


that just sets defaults for \setupinteraction so that they inherit from 
document



\setupmetadata
   [title=FooBar]


that's for those who go global


Are any of those deprecated or the preferred way? I'm starting to
get confused.


even if we would use \setupmetadata we'd still have \setupinteraction 
because we remain compatible


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

2024-02-27 Thread Hans Hagen

On 2/26/2024 2:21 PM, Roger Mason wrote:

Hello Hans,

Hans Hagen  writes:


On 2/26/2024 12:22 PM, Roger Mason wrote:


Looks like the unset TEXMF and TEXMFCNF envars are a problem.   What
should they be set to and where should they be set?

fwiw, i'll do an update oen fo these days with the old bin

what you coudl do is download the latest zip and unzip it in
texmf-context and then take the ins from the garden build


Please do not go to this trouble on my account.  I have decided to give
up on context.

well, i put the older in in the latest anyway

Hans

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

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

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


[NTG-context] Re: Japanese

2024-02-26 Thread Hans Hagen

On 2/26/2024 9:08 PM, Otared Kavian wrote:

Hi all,

Does anyone have a simple setup of fonts to write a small Japanese document 
(possibly with furagana) ? I am using MacOS and I have several Japanese fonts 
on the system.
I have some old examples which do not typeset correctly now, maybe because they 
use the old module simplefonts and  commands such as \setcjkmainfont and 
friends.

Many thanks in advance: Otare
there are some files "japanese-*" in the test suite; it boils down to a 
setting up a font and enabling script (because of specific spacing)


Hans

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

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

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


[NTG-context] Re: FreeBSD 13.2

2024-02-26 Thread Hans Hagen

On 2/26/2024 12:22 PM, Roger Mason wrote:


Looks like the unset TEXMF and TEXMFCNF envars are a problem.   What
should they be set to and where should they be set?

fwiw, i'll do an update oen fo these days with the old bin

what you coudl do is download the latest zip and unzip it in 
texmf-context and then take the ins from the garden build


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

2024-02-25 Thread Hans Hagen

On 2/24/2024 4:28 PM, Mojca Miklavec wrote:

Dear Roger,

On Sat, 24 Feb 2024 at 15:34, Roger Mason wrote:


After unpacking, running the install scripts results in:

ld-elf.so.1: /home/rmason/Software/Context/bin/mtxrun: Undefined symbol
"__libc_start1@FBSD_1.7"

I assume this is because mtxrun is compiled for FreeBSD 14.0.


There were some troubles with our infrastructure which led Hans to
build the binaries himself without paying extra attention to
compatibility with older systems.


Can freebsd 14 work with older bins?

The previosu method of these hard coded version numbers was a pain as i 
have to adapt different scripts and the websit to newer versions so and 
i don't want that.


(We could put more bins in the installer for a platform and then let the 
install.sh choose what bins to fetch but even then the question is how 
far do we go back in time.)



You can find the binaries here:
 https://build.contextgarden.net/dl/luametatex/

but I hope that Hans will rebuild the installer in order to make the
older systems functional again.

Other than that, building luametatex is relatively straightforward with CMake.
The sources can be found either inside ConTeXt or separately inside
 https://github.com/contextgarden/luametatex
We could add a flag to the installer thaqt doesn't update the binaries 
but intead (advices) to build the bins but it assumes Cmake and gcc to 
be installed (we could cheat and use an existing cmake made make 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] new context option

2024-02-22 Thread Hans Hagen

Hi,

As I needed to check some commands i added this:

   context --find="%\starttabulate"

which will (should) give a list of lines/files in the documentation 
where this command is used.


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] Re: using an end of line as parameter

2024-02-20 Thread Hans Hagen

On 2/20/2024 12:26 PM, madiazm.eo...@gmail.com wrote:

Thanks Hans,
I supposed that lua would be more suitable, but unfortunately I still did not 
learn it (I hope in summer I have time to read the manual)

The problem arises from the fact that for each line i will perform a different 
action and for \def\foo I need four arguments so that I can correctly format 
the lines. How can i get the result of string.splitlines (s) separated into 
four arguments to pass to the macro? then \foo would be 
\def\foo#1SEPARATOR#2SEPARATOR#3SEPARATOR#4

I now use:


\starttext
%now I use the dirty trick of writing an ñ at the end of line so that the macro 
detects each argument; but for each question I have to manually add it, which 
is tedious; therefore I look for a solution to detect lines automatically

%the definition
\def\tareaAbc #1ñ#2ñ#3ñ#4ñ{\item #1
 \startitemgroup[lista1a]
 \item #2
 \item #3
 \item #4
 \stopitemgroup}

%in the document
/startitemgropu[lista1a]   %I manually open the first level of the list 
so the first argument -the question- gets numbered

\tareaAbc In den Büchereien gibt es auch …ñ   %the question; an item of 
first level
… Kuchen.ñ   %option a gets a new list of second level opened and argument 
2 is the first item
… Theater.ñ   %option b another item
… Workshops.ñ  %option c last item and closes the second level list

%some more macros with more questions and options

/stopitemgroup %I manually close the first level list
You have to provide more details about these lines. For instance, do you 
want to split on spaces?


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: using an end of line as parameter

2024-02-19 Thread Hans Hagen

On 2/19/2024 1:49 PM, Miguel Diaz wrote:

Dear list,
I want to format some language tests that different people are 
preparing. Each one uses different software and there are always 
problems in format that i want to solve.


for a a/b/c questions I receive text that I will format to a list 
(comments are mine)


In den Büchereien gibt es auch … %the question
… Kuchen. %option a
… Theater. %option b
… Workshops. %option c

I need to detect \par or whatever sign marks the newline character as an 
argument delimiter so that I dont have to paste hundreds of times braces 
for each argument.

For the example, I use this macro definition (which does no work!)

\long\def\prueba 
#1\par#2\par#3\par#4ñ{\framed[frame=off,width=0.8\textwidth,corner=round,offset=1em,align=flushleft]%

{{\bf Beispiel}: #1\\
\qquad  a) #2\\
\qquad  b) {\bf #3}\\
\qquad  c) #4
}

I get: tex error on line 493 in file ./prueba.tex: The file ended when 
scanning an argument.


the macro seems to  read to the end of file not detecting \par; I know 
its the \par that causes the problem; I used ^^M also which I read is a 
sinonym for return but it also does not work.


Help would be appreciated (my computer keyboard would appreciate it too...)

better start thinking something:

\starttext

\def\foo#1{<<<#1>>>>\par}

\startluacode
local s = [[
line 1
line 2
line 3
line 4
]]

-- local s - io.loaddata("yourfile.txt")

local lines = string.splitlines(s)

for i=1,#lines do
if lines[i] ~= "" then
context.foo(lines[i])
end
end

\stopluacode

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

2024-02-19 Thread Hans Hagen

On 2/19/2024 7:10 PM, Keith McKay wrote:
Thanks for the reply Fabrice. Looks like something changed in the recent 
update. I'm sure Hans will pick it up.
next upload (when mid cycles were introduced we lost an end one in some 
cases)


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: Memory consumption in new upload

2024-02-17 Thread Hans Hagen

On 2/17/2024 10:50 PM, Shiv Shankar Dayal wrote:
I assume you would have created typescripts for those fonts. Can you 
please add them to

ConTeXt distribution, at least for the popular fonts?


Many of those are covered by typescripts. Those that are not, are on my 
machine because we needed them (often long ago) for a project (these are 
commercial fonts, in most cases typeone and of such a collection 
actually a few were used then). There are also some commercial fonts 
that I got for free. Then there are fonts that I have to check because 
users had an issue (public ones, of different quality and useability). 
Of those 'trying to cover all of unicode with  different fonts of the 
same design' I tested subsets. And of course the fonts that come with 
the operating system (basically all fonts that context can access during 
a run).


We're not going to make typescripts for every combination as in practice 
for most documents one needs a single setup and therefore only a handful 
of lines of code (and likely use some typescript file for a math font). 
There's also the selectfont mechanism that uses heuristics to do the 
same. There are plenty of examples in the distribution and for a 
specific style that demands certain fonts one can also put the 
definitions in the style.


On Sun, Feb 18, 2024 at 3:12 AM Shiv Shankar Dayal 
mailto:shivshankar.da...@gmail.com>> wrote:


The only change I made was that I started using a 9pt modern font
than a 10 pt modern font.

My document decreased from 580+ pages to 500 pages after that.

About your document, I assume you had a lot of Graphics because text
only 180MB is too high.
I have only few diagrams and my file size is only 3MB.

On Sun, Feb 18, 2024 at 2:13 AM Hans Hagen mailto:j.ha...@xs4all.nl>> wrote:

On 2/17/2024 6:17 PM, Shiv Shankar Dayal wrote:
 > Thanks for new upload. I see that memory consumption is much
less than
 > previous version. So
 > once again, thanks a lot.
 >
 > I am curious about what has changed in recent upload, that
memory
 > consumption is about 60% of earlier versions.
it's hard to tell what exact consumpiton is becaue for instance
when lua
creates tables, they grow by factors two when then have to
(maybe 5.5 is
a bit less consuming)

on the one hand luametatex is more efficient than luatex due to
all kind
of ímprovements' but some nodes are larger so that takes more
memory,
which is only noticed when one has lots of text on a page (or keeps
boxes stuff around)

anyway, not that much changed since the previous upload, so
maybe you
just stay below a threshold

I recently generated a 180MB document with 2500 fonts + metapost
outlines of them and that could bump mem usage (with empty
cache) to 30
GB (less after fonts were cached) but normally we stay around
125 MB for
a document. Anyway, tex mem consumption can often be neglected
compared
to other applications.

Hans


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

___



-- 
Respect,

Shiv Shankar Dayal



--
Respect,
Shiv Shankar Dayal

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

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

[NTG-context] Re: Memory consumption in new upload

2024-02-17 Thread Hans Hagen

On 2/17/2024 6:17 PM, Shiv Shankar Dayal wrote:
Thanks for new upload. I see that memory consumption is much less than 
previous version. So

once again, thanks a lot.

I am curious about what has changed in recent upload, that memory 
consumption is about 60% of earlier versions.
it's hard to tell what exact consumpiton is becaue for instance when lua 
creates tables, they grow by factors two when then have to (maybe 5.5 is 
a bit less consuming)


on the one hand luametatex is more efficient than luatex due to all kind 
of ímprovements' but some nodes are larger so that takes more memory, 
which is only noticed when one has lots of text on a page (or keeps 
boxes stuff around)


anyway, not that much changed since the previous upload, so maybe you 
just stay below a threshold


I recently generated a 180MB document with 2500 fonts + metapost 
outlines of them and that could bump mem usage (with empty cache) to 30 
GB (less after fonts were cached) but normally we stay around 125 MB for 
a document. Anyway, tex mem consumption can often be neglected compared 
to other applications.


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   >