[NTG-context] Re: Thesis in ConTeXt
On 4/11/2025 2:33 AM, Max Chernoff via ntg-context wrote: (Also, what happened to "primitives.pdf"? That was one of my favourite documents!) that is now a chapter in luametatex.pdf Also, ConTeXt is way faster than LaTeX Yes, indeed, this is one of my favourite parts of ConTeXt. (though much slower than Typst but AFAIK, Typst is not as complete as ConTeXt). > > Yeah, Typst is faster than pretty much anything, but they put in _a lot_ of work to get it that way, and it comes with quite a few limitations: https://www.researchgate.net/publication/364622490 in the end it all depends on functionality ... the more one supports and adds the slower ... the problem doesn't change (a simple macro package would also be very fast) also, users have some influence too: (1) check your style for bottlenecks (2) make an example of what is slow and mention it on the list Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] read out of \tx-value possible?
Hi folks, is it possible to read out the value of \tx (or \txx ... ) for calculations if bodyfont and fontsize is given? \the\tx doesn't work. \setuplayout[grid=yes] \setupbodyfont[libertinus,12pt] \setupinterlinespace[1.25\bodyfontsize] \starttext \samplefile{tufte}\par \startlinecorrection \setuplocalinterlinespace[12.5pt] \placefigure [middle,nonumber]{\tx\midaligned{bla blablabla blabla\\ blubdibla blabla bla}} {\externalfigure[][height=40mm, width=60mm]} \stoplinecorrection \samplefile{tufte}\par \stoptext I would like to calculate the setuplocalinterlinespace similar to the setupinterlinespace. Thanks in advance Thomas___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Alternate text for images?
> Am 10.04.2025 um 16:41 schrieb Pablo Rodriguez via ntg-context > mailto:ntg-context@ntg.nl>>: > > On 4/10/25 15:38, Steffen Wolfrum wrote: >> In Acrobat Pro (2020 Mac) it looks like this, see attached. > > Hi Steffen, > > sorry, but I‘m afraid you might be testing a different PDF document. I was testing the PDF document that was created when running «testing-tagging.tex» with ConTeXt ver: 2025.04.01 12:45 LMTX. As you reported below «lpdf-tag-imp-testing.lmt» was missing, and thus the Figure tags were missing, I assume. > ... > I sent the final PDF document, because I had to edit it manually to make > it work. If you compiled the source testing-tagging.tex I also attached, > lpdf-tag-imp-testing.lmt should be reached by ConTeXt to have both > Figure and Formula tags. But what do you mean by «lpdf-tag-imp-testing.lmt should be reached by ConTeXt»? Where should I place it? Yours, Steffen ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: read out of \tx-value possible?
Am 11.04.25 um 10:03 schrieb Thomas Meyer: is it possible to read out the value of \tx (or \txx ... ) for calculations if bodyfont and fontsize is given? \the\tx doesn't work. Does \showbodyfontenvironment help? Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Tagging Math
Am Thu, 10 Apr 2025 15:02:53 -0400 schrieb Matthias Weber: > Thank you Mikael, > > What I would like to to is to have what \placenotes[mathnote] > produces added to the pdf as a tag so that a screen reader > would be able to read the math. The only reader that can currently make use of MathML embedded as associated file is Foxit together with a beta version of NVDA and a current MathCat. See https://latex3.github.io/tagging-project/documentation/wtpdf/fulldoc for some discussions. To find and use the associated MathML file Foxit requires that it is attached to a Formula element in the PDF 2.0 namespace: https://github.com/foxitsoftware/PDF_UA-2. context attaches the MathML to a `math` element declared in a context specific namespace and then rolemapped (like all other structure elements) to the NonStruct structure element (which as the name implies has no semantic meaning). This means that this MathML is not seen by any reader and useless. If some math is read then simply in the amount reader can extract math from untagged PDFs. -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Tagging Math
Thanks Ulrike, This is helpful (and sad) information. Would it be possible to have ConTeXt produce two documents, one that shows the typeset formula as usual, and a second one that shows instead of the formula the text that Mikael’s example shows as a note? Then screen-reading the second output should be acceptable, at least as far as math is concerned? Thanks, Matthias > On Apr 11, 2025, at 6:53 AM, Ulrike Fischer wrote: > > Am Thu, 10 Apr 2025 15:02:53 -0400 schrieb Matthias Weber: > >> Thank you Mikael, >> >> What I would like to to is to have what \placenotes[mathnote] >> produces added to the pdf as a tag so that a screen reader >> would be able to read the math. > > The only reader that can currently make use of MathML embedded as > associated file is Foxit together with a beta version of NVDA and a > current MathCat. > See > https://latex3.github.io/tagging-project/documentation/wtpdf/fulldoc > for some discussions. > > To find and use the associated MathML file Foxit requires that it is > attached to a Formula element in the PDF 2.0 namespace: > https://github.com/foxitsoftware/PDF_UA-2. > > context attaches the MathML to a `math` element declared in a > context specific namespace and then rolemapped (like all other > structure elements) to the NonStruct structure element (which as the > name implies has no semantic meaning). This means that this MathML > is not seen by any reader and useless. If some math is read then > simply in the amount reader can extract math from untagged PDFs. > > > -- > Ulrike Fischer > http://www.troubleshooting-tex.de/ > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.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 ___
[NTG-context] Re: \switchtobodyfont issue
Thank you, Wolfgang! That is very helpful and much appreciated. Re \switchtobodyfont, I see that I misinterpreted the entry on the wiki. All best, Alan On Apr 10, 2025 at 14:06:16, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> wrote: > Am 10.04.2025 um 18:28 schrieb Alan Bowen: > > Oops. I forgot the macro definition: > > > \def\modCyr#1{{\switchtobodyfont[dejavu]{#1}}} > > > To get your text in dejavu add > > \usebodyfont [dejavu] > \setupbodyfont[modern] > > at the begin of the document to preload the typescript, otherwise you > load the font in a local group where the settings are forgotten at the > end of the group. > > > Be also be aware of \switchtobodyfont being an argumentless switch, this > means the form > > \switchtobodyfont[]{...} > > is wrong and the correct form is > > {\switchtobodyfont[]...} > > 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 > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Tagging Math
On 4/10/2025 9:02 PM, Matthias Weber wrote: Thank you Mikael, What I would like to to is to have what \placenotes[mathnote] produces added to the pdf as a tag so that a screen reader would be able to read the math. Right now, with your example, it reads the typeset math in an extremely garbled way (but the mathnotes at leats make sense). So the question is how to get the content of the mathnotes into the PDF tags… Last time we looked into this (over a year ago) we tested several variants with some viewers (Mikael and I use Sumatra (mupdf) and Okular) and did some tests with speech. We don't have acrobat installed and can't assume users have anyway, esp not on linux. We checked what is done with Alt and ActualText and such and decided that it made no sense to keep trial and erroring. Okular can show the embedded xml blob fine. So at that time we settled on adding the serialized formula as ActualText because that at least gave no errors in validators. We explicitly decided not to flag /math as Formula because that gave validating issues with complex formulas that have non-math inside. (We expect that by llm will be able to interpret a '/math' tag some day, why not.) So, from our perspective, we try to make sure something validates, add as much structure as possible / reasonable, then wait till the viewers that we use catch up (maybe they do when all that tagging dust has settled and standards are stable) and then pick up the thread when we know how to adapt. In the meantime users can finetune mapping as they like, but we don't want to be held responsbile for a mess. After all users know what they coded and want out of it. As said before, tagging is not that complex to support. The only condition it that we don't want to cripple context structure support by adapting to suboptimal situations. So patience is your friend. Hans ps. For decades we now use as test a math content base that covers a lot of dutch education and we had to go from content mathml (nice) to openmath (mess) to presentational mathml (dropped from browsers) to asciimath (insufficient) to again a mix of presentational mathml (back in browsers) and asciimath to ... so we know a bit what we're dealing with here: multiple output from the same source (web as well as properly made up teacher driven math). Everything web related keeps changing, often in an oscillating way. - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Tagging Math
Thanks Hans, I agree and I am merely weighing my options. I don’t want anyone to waste their time on something useless just to satisfy some compliance mandate. Any document I want to make available to my students needs to be “compliant” by April 2026. Nobody knows what that exactly means or how this will be tested. I strongly support providing accessibility in addition to what I want my students to use. The best way(while waiting) seems to be to provide two documents, where the accessible version replaces all images with text that I write, and all formulas with the text that Mikael’s example produces. So my question is just this: how do I make that automatic: have all formulas replaced by a text that reads like a spoken formula? Matthias > On Apr 11, 2025, at 11:52, Hans Hagen via ntg-context > wrote: > > On 4/10/2025 9:02 PM, Matthias Weber wrote: >> Thank you Mikael, >> What I would like to to is to have what \placenotes[mathnote] produces added >> to the pdf as a tag so that a screen reader would be able to read the math. >> Right now, >> with your example, it reads the typeset math in an extremely garbled way >> (but the mathnotes at leats make sense). >> So the question is how to get the content of the mathnotes into the PDF tags… > > Last time we looked into this (over a year ago) we tested several variants > with some viewers (Mikael and I use Sumatra (mupdf) and Okular) and did some > tests with speech. We don't have acrobat installed and can't assume users > have anyway, esp not on linux. > > We checked what is done with Alt and ActualText and such and decided that it > made no sense to keep trial and erroring. Okular can show the embedded xml > blob fine. > > So at that time we settled on adding the serialized formula as ActualText > because that at least gave no errors in validators. We explicitly decided not > to flag /math as Formula because that gave validating issues with complex > formulas that have non-math inside. (We expect that by llm will be able to > interpret a '/math' tag some day, why not.) > > So, from our perspective, we try to make sure something validates, add as > much structure as possible / reasonable, then wait till the viewers that we > use catch up (maybe they do when all that tagging dust has settled and > standards are stable) and then pick up the thread when we know how to adapt. > > In the meantime users can finetune mapping as they like, but we don't want to > be held responsbile for a mess. After all users know what they coded and want > out of it. As said before, tagging is not that complex to support. The only > condition it that we don't want to cripple context structure support by > adapting to suboptimal situations. > > So patience is your friend. > > Hans > > ps. For decades we now use as test a math content base that covers a lot of > dutch education and we had to go from content mathml (nice) to openmath > (mess) to presentational mathml (dropped from browsers) to asciimath > (insufficient) to again a mix of presentational mathml (back in browsers) and > asciimath to ... so we know a bit what we're dealing with here: multiple > output from the same source (web as well as properly made up teacher driven > math). Everything web related keeps changing, often in an oscillating way. > > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.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 ___
[NTG-context] Re: Tagging Math
On 4/11/2025 6:44 PM, Matthias Weber wrote: Any document I want to make available to my students needs to be “compliant” by April 2026. Nobody knows what that exactly means or how this will be tested. I strongly support providing accessibility in addition to what I want my students to use. ok, so we have some time to see how things evolve and adapt The best way(while waiting) seems to be to provide two documents, where the accessible version replaces all images with text that I write, and all formulas with the text that Mikael’s example produces. So my question is just this: how do I make that automatic: have all formulas replaced by a text that reads like a spoken formula? checking: you mean in the typeset text? concerning images, we can make some mechanism for that: adding more elaborate descriptions (alongside images, or in files) and some mode control Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Tagging Math
Yes, no rush at all. I think the best and most consistent way to currently provide accessibility is to replace all math by what the tracker/placenote ‘magically’ produces. So at the end of the day there would be two documents, one with 1+1 =2 and one with one plus one equals two As for images, I can use modes to accomplish that. The accessible PDF would contain text only. There are other things to worry about at some point like indices, hyperlinks, tables. Matthias > On Apr 11, 2025, at 1:53 PM, Hans Hagen via ntg-context > wrote: > > On 4/11/2025 6:44 PM, Matthias Weber wrote: > >> Any document I want to make available to my students needs to be “compliant” >> by April 2026. Nobody knows what that exactly means or how this will be >> tested. >> I strongly support providing accessibility in addition to what I want my >> students to use. > > ok, so we have some time to see how things evolve and adapt > >> The best way(while waiting) seems to be to provide two documents, where the >> accessible version replaces all images with text that I write, and all >> formulas with the text that Mikael’s example produces. So my question is >> just this: how do I make that automatic: have all formulas replaced by a >> text that reads like a spoken formula? > > checking: you mean in the typeset text? > > concerning images, we can make some mechanism for that: adding more elaborate > descriptions (alongside images, or in files) and some mode control > > Hans > > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl 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 way to do \addff?
Hello, \addff (and \doaddfeature) no longer seem to work. What's the alternative to add/remove features on the fly? MNWE: === \starttext \startluacode fonts.handlers.otf.addfeature{ name = "fanum", type = "substitution", data = { [0x30] = 0x41 -- '0' => 'A' } } \stopluacode \definefontfeature[fanum][fanum=yes] {0123 %\addff{fanum} \doaddfeature{fanum} 0123 %% does not work \definedfont[dejavusans*fanum] 0123 %% works } 0123 \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: Tagging Math
On Fri, 11 Apr 2025, Matthias Weber wrote: > Yes, no rush at all. > > I think the best and most consistent way to currently provide accessibility > is to replace all math by what the tracker/placenote ‘magically’ produces. > So at the end of the day there would be two documents, one with > > 1+1 =2 > > and one with > > one plus one equals two > > As for images, I can use modes to accomplish that. The accessible PDF would > contain text only. > There are other things to worry about at some point like indices, > hyperlinks, tables. Have you considered exporting to XHTML/XML? That may be more reliably read by screen readers. Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___