
Thanks Pablo, I managed to patch the files (I don’t have lpdf-tag-imp-testing.lmt but patched lpdf-tag-imp-mkiv.lmt instead, as well as lpdf-tag.lmt), and Acrobat finds the tags and is able to read the math. This will need some work, in order to have variables and symbols to be read properly, but it is a very promising beginning. Matthias
On Apr 16, 2025, at 12:32 AM, Pablo Rodriguez via ntg-context
wrote: On 4/16/25 00:50, Matthias Weber wrote:
Thanks Pablo, this is excellent news. There is no urgency, but I will be happy to try it out and use it.
Matthias,
there is another approach with some cheating that may also work.
The attached PDF document is the compilation from the source below.
First you have to add math tagging in lpdf-tag-imp-testing.lmt (right after "-- no math here"):
math = { pua = "ua1", pdf = "Formula" }, inlinemath = { pua = "ua1", pdf = "Formula" }, displaymath = { pua = "ua1", pdf = "Formula" },
Then you need to patch lpdf-tag.lmt:
--- lpdf-tag.lmt 2025-04-15 19:44:55.157060209 +0200 +++ mkxl/lpdf-tag.lmt 2025-04-16 06:26:56.731391047 +0200 @@ -1062 +1062 @@ - -- Alt = alternate, + Alt = actualtext or nil, @@ -1064 +1064 @@ - ActualText = actualtext or nil, + -- ActualText = actualtext or nil, @@ -1090 +1090 @@ - -- Alt = alternate, + Alt = actualtext or nil, @@ -1092 +1092 @@ - ActualText = actualtext or nil, + -- ActualText = actualtext or nil, @@ -1141 +1141 @@ - Alt = pdfunicode(label ~= "" and label or "image"), + -- Alt = pdfunicode(label ~= "" and label or "image"), @@ -1142,0 +1143 @@ + parent.dict.Alt = pdfunicode(label ~= "" and label or "image")
And it should work for PDF/UA-1. Please, don’t forget that I don’t use math in ConTeXt at all (only for these testings).
Source for the attached PDF document:
\enabledirectives [backend.usetags=testing] \setupstructure[state=start] \setupbackend [format=PDF/A-3a, intent=sRGB IEC61966-2.1, level=0] \setupbackend[format=pdf/ua-1]
\setuptagging[state=start]
\registermathsymbol[default][en]["1D467][the variable] \registermathsymbol[default][en]["1D458][the index]
\starttext \startformula \abs {(z__0 + h)^n - z__0^n } \alignhere = \abs {\sum_{k = 1}^n \binom{n}{k} h^k z__0^{n - k} } \breakhere = \abs {h \sum_{k = 0}^{n - 1} \binom{n}{k + 1} h^k z__0^{n - 1 - k} } \breakhere = \abs {h \sum_{k = 0}^{n - 1} \frac {n}{k + 1} \binom{n - 1}{k} h^k z__0^{n - 1 - k} } \breakhere \le n \abs{h} \sum_{k = 0}^{n - 1} \binom{n - 1}{k} \abs{h}^k \abs{z__0}^{n - 1 - k} \breakhere \le n \abs{h} (\abs{z__0} + \abs{h})^{n - 1} \stopformula
\registermathsymbol[default][en][lowercasebold][the vector]
\startformula (\alpha + \beta) \mathbf{u} = \alpha \mathbf{u} + \beta \mathbf{u} \stopformula
\stoptext
I hope it helps,
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 ___________________________________________________________________________________