Alternate text for images?

Hello, Is there an option for \includegraphics to add an alternate text to an image to make it accessible for screen readers? Thanks, Matthias

On 4/3/2025 8:35 PM, Matthias Weber wrote:
Hello,
Is there an option for \includegraphics to add an alternate text to an image to make it accessible for screen readers?
i suppose you mean \externalfigure .. we have \externalfigure[foo.pdf][label=whatever] and i think Pablo tested that with some viewers 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 -----------------------------------------------------------------

Thanks Hans, but no, I mean something like this (from the mailing list and Tagged PDF (2024)): \setupbackend[format=pdf/ua-2] \setuptagging[state=start] \setupstructure[state=start] \setupexternalfigures[location=default] \starttext \startPDFalternativetext {this is a cow}{\externalfigure[cow]} \stopPDFalternativetext \stoptext in order to provide screen readability (but the above doesn’t work, the PDF doesn’t have the alternate text). The background is the following: If I want to use my own texts in class, I have to (by 2026) — either not make them available to my students — or make them accessible — or move/find another job (a serious alternative indeed) Making them accessible means machine readable, which comes with its own problems I loathe. For me this means that all equatiions need to be somehow machine readable (I haven’t yet tried whether the tagging from Tagged PDF (2024)) works for my documents) and to add a reasonably descriptive text to the hundreds of images. My lecture notes run typically 100-200 pages and are rich of illustrations and formulas. From what I can see the only options are tagged PDFs or epubs with mathml. I have little experience with either but will be happy to learn. Any suggestions are most welcome. Thanks! Matthias
On Apr 3, 2025, at 6:51 PM, Hans Hagen via ntg-context
wrote: On 4/3/2025 8:35 PM, Matthias Weber wrote:
Hello, Is there an option for \includegraphics to add an alternate text to an image to make it accessible for screen readers?
i suppose you mean \externalfigure .. we have
\externalfigure[foo.pdf][label=whatever]
and i think Pablo tested that with some viewers
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 ___________________________________________________________________________________

On 4/4/25 03:37, Matthias Weber wrote:
Thanks Hans,
but no, I mean something like this (from the mailing list and Tagged PDF (2024)):> [...]
Hi Matthias, your MWE mostly works, but it has an issue when validating it. I‘m investigating it further (not clear to me whether it comes from ConTeXt or from the validator).
in order to provide screen readability
It isn’t clear to me how you tested this. Have you tried that Acrobat read aloud the PDF document? If not, please describe your testing and define what “screen readability” is. It would be great if you could provide a link to a (best when minimal) PDF document with alternative text whhat is screen--readable (as confirmed by your testing). Sorry, but I’m only a Linux user with occasional access to a Windows machine with the current version of Acrobat Reader. Validations are fine on Linux, but testing Acrobat is not an option here (sorry, no VM or similar things).
(but the above doesn’t work, the PDF doesn’t have the alternate text).
I must admit that I don’t have any idea why (or even what) doesn’t work on your side. But the alternative text is there (uncompress the PDF document and search for "/Alt <" [https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....]). I will report back as soon as I have found out what may not be working here. If you allow me a comment, testing math tagging (as described in “Tagged PDF”) would be great to confirm that it works as expected (or to know that it has to be improved). I hope it might help (in the meantime), Pablo

Hi Pablo, Thanks for looking into this. I am very new to the requirements, and I don’t know (yet) what defines screen readability and how this might be certified. I will investigate. So far, I have heard that all images need to have an alternate text (and I assume this can't be done automatically in order to be useful), and all equations need to be able to be read out loud by a screen reader software. There are obviously lots of issues here. So far, I have only tried Acrobat on a Mac to see whether I can add alternate texts in ConTexT that would be recognized by Acrobat. Acrobat says that the document has the accessibility flag checked, but that the image is not tagged. Letting it read the document skips the image. I have not tried what happens to formulas or other structures. I also don’t know what compliancy means in this case. I will investigate, and I’ll be more than happy to try all my documents … Thanks, Matthias
On Apr 4, 2025, at 11:34 AM, Pablo Rodriguez via ntg-context
wrote: On 4/4/25 03:37, Matthias Weber wrote:
Thanks Hans,
but no, I mean something like this (from the mailing list and Tagged PDF (2024)):> [...]
Hi Matthias,
your MWE mostly works, but it has an issue when validating it.
I‘m investigating it further (not clear to me whether it comes from ConTeXt or from the validator).
in order to provide screen readability
It isn’t clear to me how you tested this. Have you tried that Acrobat read aloud the PDF document?
If not, please describe your testing and define what “screen readability” is.
It would be great if you could provide a link to a (best when minimal) PDF document with alternative text whhat is screen--readable (as confirmed by your testing).
Sorry, but I’m only a Linux user with occasional access to a Windows machine with the current version of Acrobat Reader.
Validations are fine on Linux, but testing Acrobat is not an option here (sorry, no VM or similar things).
(but the above doesn’t work, the PDF doesn’t have the alternate text).
I must admit that I don’t have any idea why (or even what) doesn’t work on your side.
But the alternative text is there (uncompress the PDF document and search for "/Alt <" [https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....]).
I will report back as soon as I have found out what may not be working here.
If you allow me a comment, testing math tagging (as described in “Tagged PDF”) would be great to confirm that it works as expected (or to know that it has to be improved).
I hope it might help (in the meantime),
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 ___________________________________________________________________________________

On 4/4/25 20:41, Matthias Weber wrote:
Hi Pablo,
Thanks for looking into this. I am very new to the requirements,
Hi Matthias, I’m afraid we are all new to what boils down to the EU Accessibility Directive (and national transposition legal norms).
and I don’t know (yet) what defines screen readability and how this might be certified. I will investigate.
I guess that screen readability could be to be read aloud by a screen reader software. BTW, taking samples from four European official journals: https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=OJ:L_202500684 passes only PDF/A-2A validation. https://www.recht.bund.de/bgbl/1/2025/104/regelungstext.pdf?__blob=publicationFile&v=3 fails both PDF/A-2A and PDF/UA-1 validations. https://boe.es/boe/dias/2025/04/04/pdfs/BOE-A-2025-6796.pdf passes only PDF/A-1A validation. https://www.officielebekendmakingen.nl/stb-2025-88.pdf passes only PDF/A-1A validation. From my limited samples, only Germany seems to have thought of having accessible PDF documents in practice.
So far, I have only tried Acrobat on a Mac to see whether I can add alternate texts in ConTexT that would be recognized by Acrobat. Acrobat says that the document has the accessibility flag checked, but that the image is not tagged. Letting it read the document skips the image.
Could you test Acrobat to read alould the PDF document form the »Bundesgesetztblatt« above? The image has an alternative text, but the tagging is not properly mapped. Let us know what you find out with Acrobat reading aloud, Pablo

I listened to the German document. The picture at the top is read as “Bundesadler”, so an alternate text is found and used. The rest is just verbatim text-to-speech. Acrobat can also create an accessibility report, which I am attaching. Matthias
On 4/4/25, at 3:42 PM, Pablo Rodriguez via ntg-context
wrote: On 4/4/25 20:41, Matthias Weber wrote:
Hi Pablo,
Thanks for looking into this. I am very new to the requirements,
Hi Matthias,
I’m afraid we are all new to what boils down to the EU Accessibility Directive (and national transposition legal norms).
and I don’t know (yet) what defines screen readability and how this might be certified. I will investigate.
I guess that screen readability could be to be read aloud by a screen reader software.
BTW, taking samples from four European official journals:
https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=OJ:L_202500684 passes only PDF/A-2A validation.
https://www.recht.bund.de/bgbl/1/2025/104/regelungstext.pdf?__blob=publicationFile&v=3 fails both PDF/A-2A and PDF/UA-1 validations.
https://boe.es/boe/dias/2025/04/04/pdfs/BOE-A-2025-6796.pdf passes only PDF/A-1A validation.
https://www.officielebekendmakingen.nl/stb-2025-88.pdf passes only PDF/A-1A validation.
From my limited samples, only Germany seems to have thought of having accessible PDF documents in practice.
So far, I have only tried Acrobat on a Mac to see whether I can add alternate texts in ConTexT that would be recognized by Acrobat. Acrobat says that the document has the accessibility flag checked, but that the image is not tagged. Letting it read the document skips the image.
Could you test Acrobat to read alould the PDF document form the »Bundesgesetztblatt« above?
The image has an alternative text, but the tagging is not properly mapped.
Let us know what you find out with Acrobat reading aloud,
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 ___________________________________________________________________________________

On 4/4/25 22:10, Matthias Weber wrote:
I listened to the German document. The picture at the top is read as “Bundesadler”, so an alternate text is found and used. The rest is just verbatim text-to-speech. Hi Matthias,
I think the following may work (could you test it?): \setupbackend[format=pdf/ua-1] \setuptagging[state=start] \setupstructure[state=start] \setupbackend [format=PDF/A-3a, intent=sRGB IEC61966-2.1, level=0] \setupexternalfigures[location=default] \starttext \externalfigure[cow][label={this is a cow}] \stoptext At least, the validator only complains for the use of /DocumentFragment (unknown to PDF-1.7). BTW, the use of \setupbackend is mandatory when you add images (these are color profiles).
Acrobat can also create an accessibility report, which I am attaching.
Many thanks for that, it would be great to have something like that when all main issues with accessibility are solved. Manny thanks for your help, Pablo

Hi Pablo, Thanks, but no, that doesn’t work. Acrobat reads the document by just warning that the page is empty. While the report comes back mostly ok. When I ask it to “add tags”, it tells me it will go through the document, detect all images, and display their tags, but then it says that there are is no figure information to display. The tag report list that lists all accessibility tags identifies the figure as <NonStruct> with information PathPathPathPathPathPath. Below is the generated report. Thanks! Matthias
On Apr 5, 2025, at 3:05 AM, Pablo Rodriguez via ntg-context
wrote: On 4/4/25 22:10, Matthias Weber wrote:
I listened to the German document. The picture at the top is read as “Bundesadler”, so an alternate text is found and used. The rest is just verbatim text-to-speech. Hi Matthias,
I think the following may work (could you test it?):
\setupbackend[format=pdf/ua-1] \setuptagging[state=start] \setupstructure[state=start] \setupbackend [format=PDF/A-3a, intent=sRGB IEC61966-2.1, level=0]
\setupexternalfigures[location=default] \starttext \externalfigure[cow][label={this is a cow}] \stoptext
At least, the validator only complains for the use of /DocumentFragment (unknown to PDF-1.7).
BTW, the use of \setupbackend is mandatory when you add images (these are color profiles).
Acrobat can also create an accessibility report, which I am attaching.
Many thanks for that, it would be great to have something like that when all main issues with accessibility are solved.
Manny 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 ___________________________________________________________________________________

On 4/5/25 14:35, Matthias Weber wrote:
Hi Pablo,
Thanks, but no, that doesn’t work.
Sorry, Matthias, that was my fault. After replying and asking you to test, I started a new thread where I discovered that PDF/UA files were missing proper PDF/UA tagging. It couldn’t work.
Acrobat reads the document by just warning that the page is empty. While the report comes back mostly ok.
I’m afraid the report isn’t that useful for us at the current stage of tagging development.
The tag report list that lists all accessibility tags identifies the figure as <NonStruct> with information PathPathPathPathPathPath.
I had no idea, but I have read in the source (lines 217-218 from strc-tag.lmt) that figures (and mpgraphics) are tagged as "NonStruct" (as many other things). I think it is pretty consistent to tag them as "Figure". As for the information "PathPathPathPathPathPath", I cannot find such a string either as pure text (not even case-insensitive "ath") or as hex string (https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....). But I admit I have to be doing something wrong. Since you work with math, I also think that formula (line 221 from the same file) should be tagged as Formula. I’m happy to help debugging ConTeXt and investigating accesibility, but Hans has the last word on how this is going to be implemented in ConTeXt. Since there are many issues that have to be fixed (or decided) first, let’s wait until Hans replies. Many thanks for your help, Pablo

On 4/5/2025 9:05 AM, Pablo Rodriguez via ntg-context wrote:
On 4/4/25 22:10, Matthias Weber wrote:
I listened to the German document. The picture at the top is read as “Bundesadler”, so an alternate text is found and used. The rest is just verbatim text-to-speech. Hi Matthias,
I think the following may work (could you test it?):
\setupbackend[format=pdf/ua-1] \setuptagging[state=start] \setupstructure[state=start] \setupbackend [format=PDF/A-3a, intent=sRGB IEC61966-2.1, level=0]
\setupexternalfigures[location=default] \starttext \externalfigure[cow][label={this is a cow}] \stoptext
At least, the validator only complains for the use of /DocumentFragment (unknown to PDF-1.7).
I think that (cf the tagging.pdf manual) \enabledirectives [backend.usetags=crap] should work and one can define ones own mappings
BTW, the use of \setupbackend is mandatory when you add images (these are color profiles).
i'm currently trying to make this profile mess a bit less cumbersome (which involves some trial and error with validation)
Acrobat can also create an accessibility report, which I am attaching.
Many thanks for that, it would be great to have something like that when all main issues with accessibility are solved.
the report tells little about the quality 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 -----------------------------------------------------------------

On 4/7/25 22:23, Hans Hagen wrote:
On 4/5/2025 9:05 AM, Pablo Rodriguez via ntg-context wrote:
[...] At least, the validator only complains for the use of /DocumentFragment (unknown to PDF-1.7).
I think that (cf the tagging.pdf manual)
\enabledirectives [backend.usetags=crap]
should work and one can define ones own mappings
Now I get it (https://www.pragma-ade.nl/general/manuals/tagging.pdf#search=enabledirective...). Many thanks for the reference, Pablo

On 4/4/25 17:34, Pablo Rodriguez via ntg-context wrote:
[...] I will report back as soon as I have found out what may not be working here. After some testing, it seems we have two main issues with PDF/A-3a validations.
First, PDF/A-2 and PDF/A-3 both require "/MarkInfo << /Marked true >>", the same way as PDF/A-1 does. https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Parts-2-and... is just for reference. lpdf-tag.lmt contains on line 590: if version == 1 then It isn’t clear to me whether "version" here refers to PDF/A version. If that were the case, /MarkInfo is a requirement for all versions prior to PDF/A-4 (according to https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-4-rule...). Second, /Namespace, /NS and /RoleMapNS are only allowed in PDF-2.0 (https://github.com/pdf-association/arlington-pdf-model/blob/master/tsv/lates...). Since we have PDF/A-3a (and not PDF/A-4F [at least, yet]), I’m afraid the dictionary has to be /StructTreeRoot here. There is a third issue, PDF-1.7 doesn’t allow /DocummentFragment as standard structure type. Only Part, Art (article), Sect (section) or Div would match here (https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....). Hans, I’m afraid this is the way to go. If my writting isn’t clear, let me know. Ulrike, in case you are listening, I would like to ask you some questions about PDF validation and tagging. Many thanks for your help, Pablo

On 4/4/2025 9:09 PM, Pablo Rodriguez via ntg-context wrote:
On 4/4/25 17:34, Pablo Rodriguez via ntg-context wrote:
[...] I will report back as soon as I have found out what may not be working here. After some testing, it seems we have two main issues with PDF/A-3a validations.
First, PDF/A-2 and PDF/A-3 both require "/MarkInfo << /Marked true >>", the same way as PDF/A-1 does.
https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Parts-2-and... is just for reference.
lpdf-tag.lmt contains on line 590:
if version == 1 then
pdf version
It isn’t clear to me whether "version" here refers to PDF/A version. If that were the case, /MarkInfo is a requirement for all versions prior to PDF/A-4 (according to https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-4-rule...).
hm, peter checked all that against the 1.7 standard so i'm reluctant to change that; not all documents have to be marked
Second, /Namespace, /NS and /RoleMapNS are only allowed in PDF-2.0 (https://github.com/pdf-association/arlington-pdf-model/blob/master/tsv/lates...).
Since we have PDF/A-3a (and not PDF/A-4F [at least, yet]), I’m afraid the dictionary has to be /StructTreeRoot here.
There is a third issue, PDF-1.7 doesn’t allow /DocummentFragment as standard structure type. Only Part, Art (article), Sect (section) or Div would match here (https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....).
Hans, I’m afraid this is the way to go. If my writting isn’t clear, let me know.
not sure what you mean: you either tag version 1 or you tag version 2; order matters so don't enable tagging for 2 and then choose some version 1 related format (maybe i can check someplace if users mix up) but we tested and got validated documents from vera .. unless of course the standard changed again (vera also changes and there are also differences between the used parsers) it's not something i want to waste time on continuously ... just an occasional catch up with changes .. really it's not the complication but the mess that determines pace here 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 -----------------------------------------------------------------

On 4/7/25 22:16, Hans Hagen wrote:
On 4/4/2025 9:09 PM, Pablo Rodriguez via ntg-context wrote:
[...] Hans, I’m afraid this is the way to go. If my writting isn’t clear, let me know.
not sure what you mean: you either tag version 1 or you tag version 2;
Well, I tried to UA-2, but all output intents (since we have no PDF/A-4) are for PDF-1.x. So I needed a profile and I loaded PDF/A-3a (which is the newest we have). BTW, from what Ulrike said I understood (as per RFC 2119, “should” indicates recomendation and not obligation), PDF/UA-2 should use PDF/A-4, but it didn’t have to. After checking publication dates, I’m not sure whether PDF/UA-2 can only use PDF/A-4.
order matters so don't enable tagging for 2 and then choose some version 1 related format (maybe i can check someplace if users mix up) but we tested and got validated documents from vera .. unless of course the standard changed again (vera also changes and there are also differences between the used parsers)
Please, add a check (and a correction), so that users can forget about loading order.
it's not something i want to waste time on continuously ... just an occasional catch up with changes .. really it's not the complication but the mess that determines pace here
I want to waste as little from your time as possible with this. That being said, I’m afraid that the accessibility directive includes the possibility of sanctions for non-compliant services (ebooks are considered services, if I’m not wrong). Not sure (I’m not a lawyer and this is no legal advice) whether free services may be liable for publishing unaccessible documents, but this is the main reason why accessibility is important in ConTeXt. Many thanks for your help, Pablo

On 4/8/2025 7:31 PM, Pablo Rodriguez via ntg-context wrote:
On 4/7/25 22:16, Hans Hagen wrote:
On 4/4/2025 9:09 PM, Pablo Rodriguez via ntg-context wrote:
[...] Hans, I’m afraid this is the way to go. If my writting isn’t clear, let me know.
not sure what you mean: you either tag version 1 or you tag version 2;
Well, I tried to UA-2, but all output intents (since we have no PDF/A-4) are for PDF-1.x.
So I needed a profile and I loaded PDF/A-3a (which is the newest we have).
BTW, from what Ulrike said I understood (as per RFC 2119, “should” indicates recomendation and not obligation), PDF/UA-2 should use PDF/A-4, but it didn’t have to.
After checking publication dates, I’m not sure whether PDF/UA-2 can only use PDF/A-4.
order matters so don't enable tagging for 2 and then choose some version 1 related format (maybe i can check someplace if users mix up) but we tested and got validated documents from vera .. unless of course the standard changed again (vera also changes and there are also differences between the used parsers)
Please, add a check (and a correction), so that users can forget about loading order.
it's not something i want to waste time on continuously ... just an occasional catch up with changes .. really it's not the complication but the mess that determines pace here
I want to waste as little from your time as possible with this.
That being said, I’m afraid that the accessibility directive includes the possibility of sanctions for non-compliant services (ebooks are considered services, if I’m not wrong).
Not sure (I’m not a lawyer and this is no legal advice) whether free services may be liable for publishing unaccessible documents, but this is the main reason why accessibility is important in ConTeXt.
These standards are all about combinations of features permitted and 'tags' are 'just a feature' and have been present for a long time (used to store info for pdf editors for instance). Tags can also serve other purposes like when used for providing structure (that then can play soem role in accessibility). So, in principle one can choose some A (rgb workflows), X (cmyk workflows) or E standard and either or not tagging. The A4 are the latest and (of course) iso protected but we're trying to get hold of the rip-off. 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 -----------------------------------------------------------------

On 4/4/2025 3:37 AM, Matthias Weber wrote:
Thanks Hans,
but no, I mean something like this (from the mailing list and Tagged PDF (2024)):
\setupbackend[format=pdf/ua-2] \setuptagging[state=start] \setupstructure[state=start]
\setupexternalfigures[location=default] \starttext
\startPDFalternativetext {this is a cow}{\externalfigure[cow]} \stopPDFalternativetext
\stoptext
in order to provide screen readability (but the above doesn’t work, the PDF doesn’t have the alternate text).
This one will add an Alt to the element \externalfigure[cow][label={this is a cow}] This one will wrap the lot with Alt \startPDFalternativetext{this is a cow} \externalfigure[cow] \stopPDFalternativetext And what is done with it depends on the viewer.
The background is the following: If I want to use my own texts in class, I have to (by 2026)
— either not make them available to my students — or make them accessible — or move/find another job (a serious alternative indeed)
the middle option should work, assuming you added the right info (lke this label) but to be honest, even that will nto make a document really accessible let's assume that the majority of readers doesn't need this accessibility ... but some need, then you need to identify what is the problem and solution and then just make a few more variants of the document - maybe a black/white version - replacing images by descriptions, more that just "this is a nice picture" (which is ok for the checker) - render is a larger font etc .. all possible already; context has always been about 'multiple output from the same source without too much hassle' (keep in mind that it evolved in educational use) just using some accessibility checker (and trying to satisfy it) is imo a cheat on potential readers / users .. tuning a document to an audience is way better i'm pretty sure that you have ideas on how documents should look ... and what students need and it's a pitty that one has to waste time on these managment-driven issues
Making them accessible means machine readable, which comes with its own problems I loathe.
indeed; the problem is that like many specific pdf features it is big business ... so conflicting interests (there are also software vendors out there who claim that they can make existing docs accessible .. if so, then why tag in the first place and not do that runtime; in fact, someday soon these llm's will do the job anyway; some can parse the pdf stream and deduce already) (validaiton is tricky anyway: what validated yesterday might not today)
For me this means that all equatiions need to be somehow machine readable (I haven’t yet tried whether the tagging from Tagged PDF (2024)) works for my documents)> and to add a reasonably descriptive text to the hundreds of images.
that's the least of your problems because we have that; in fact we have tagging already for ages and actually last year we had a presentation at BT about formulas being 'spoken' in different languages) the hundreds ... \setupexternalfigures [location=default, label={this is an image}] will do as a starter t be clear: tagging is not the most complicated thing to support (adding it to context was kind of easy), the main issue is lack of tools (and i don't have acrobat anyway) and the fact that it is a crappy part of pdf and not well designed
My lecture notes run typically 100-200 pages and are rich of illustrations and formulas.
From what I can see the only options are tagged PDFs or epubs with mathml. I have little experience with either but will be happy to learn. Any suggestions are most welcome.
tagged pdf is there, currently we're moving from mp bitmap / 3d mode inti columnset mode but after that we probably will look at some tagging / export again (in the perspective of Mikaels lecture notes that we use for testing); concerning epubs ... exporting actually works quite okay (also tested with lecture notes) but we want to automate that a bit more (mathml in browsers is in flux anyway) a lot of this boils down to 'fighting with the viewers etc' which is a continuous battle with changes (and the fact that i don't need it also determines priorities) and of course we need users to test 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 -----------------------------------------------------------------

On 4/7/25 22:08, Hans Hagen wrote:
On 4/4/2025 3:37 AM, Matthias Weber wrote:
[...] in order to provide screen readability (but the above doesn’t work, the PDF doesn’t have the alternate text).
This one will add an Alt to the element
\externalfigure[cow][label={this is a cow}]
Matthias, this should work: \enabledirectives [backend.usetags=crap] \setuptagging[state=start] \setupstructure[state=start] \setupbackend [format=PDF/A-3a, intent=sRGB IEC61966-2.1, level=0] \setupbackend[format=pdf/ua-1] \setupexternalfigures[location=default] \starttext \externalfigure[cow][label={this is a cow}] \stoptext Let us know whether your Acrobat reads the text (but this is validated fine by veraPDF). I hope it helps, Pablo

Hi Pablo (and Hans) No, Acrobat reports an empty page when reading the text, and Preview (on the Mac) doesn’t read anything either. I can’t find the text when looking at the pdf in an editor. I’d be happy to use modes to produce different documents for different user groups, this would make it easy to deal with figures. I will also need to deal with equations and tables (and eventually Lua generated content). For equations, I have been able to see the xml attachments, but the Mac software I have available to read PDFs (Preview and Acrobat) doesn’t make much sense of them. Are there any example documents available? Also, is it (currently) easy to generate an epub file with MATHML from a ConTeXt source? Thanks again, Matthias
On Apr 8, 2025, at 1:41 PM, Pablo Rodriguez via ntg-context
wrote: On 4/7/25 22:08, Hans Hagen wrote:
On 4/4/2025 3:37 AM, Matthias Weber wrote:
[...] in order to provide screen readability (but the above doesn’t work, the PDF doesn’t have the alternate text).
This one will add an Alt to the element
\externalfigure[cow][label={this is a cow}]
Matthias,
this should work:
\enabledirectives [backend.usetags=crap] \setuptagging[state=start] \setupstructure[state=start] \setupbackend [format=PDF/A-3a, intent=sRGB IEC61966-2.1, level=0] \setupbackend[format=pdf/ua-1]
\setupexternalfigures[location=default] \starttext \externalfigure[cow][label={this is a cow}] \stoptext
Let us know whether your Acrobat reads the text (but this is validated fine by veraPDF).
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 ___________________________________________________________________________________

On 4/9/25 11:41, Matthias Weber wrote:
Hi Pablo (and Hans)
No, Acrobat reports an empty page when reading the text, and Preview (on the Mac) doesn’t read anything either. I can’t find the text when looking at the pdf in an editor.
Hi Matthias, the attached PDF document should work now. Unfortunately Acrobat Reader doesn’t work for me at all (reading texts alould). But I was able to see the value of /Alt (alternative text) with the editor from https://www.ngpdf.com/. There were two issues here: First, image was originally tagged as /NonStruct instead of /Figure (which I changed with lpdf-tag-imp-testing.lmt). Second, /Alt wasn’t properly placed. veraPDF rightly warns about no /Alt or /ActualText (after having the image tagged as figure). /Alt is an entry in a /StructElem dictionary (the parent of /K, where ConTeXt places it now [https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....]). After manually placing /Alt in the parent dictionary of /K and both veraPDF and https://www.ngpdf.com/ work fine now. BTW, when adding a formula (source plus mapping below), veraPDF warns about no /Alt or /ActualText for the formula (which is a requirement for PDF/UA-1, no mathml in this version [at least, no mention to mathml in the veraPDF validation rules]). Hans, I’m afraid that this haven’t been visible due to images not tagged as figures. Could it be fixed? Many thanks for your help, Pablo

Hi Pablo, Yes, this PDF works, even in Acrobat. Thank you so much. This should be good enough for the figures. I will play with the math next and report back… Thanks again! Matthias
On Apr 9, 2025, at 12:40 PM, Pablo Rodriguez via ntg-context
wrote: On 4/9/25 11:41, Matthias Weber wrote:
Hi Pablo (and Hans)
No, Acrobat reports an empty page when reading the text, and Preview (on the Mac) doesn’t read anything either. I can’t find the text when looking at the pdf in an editor.
Hi Matthias,
the attached PDF document should work now.
Unfortunately Acrobat Reader doesn’t work for me at all (reading texts alould). But I was able to see the value of /Alt (alternative text) with the editor from https://www.ngpdf.com/.
There were two issues here:
First, image was originally tagged as /NonStruct instead of /Figure (which I changed with lpdf-tag-imp-testing.lmt).
Second, /Alt wasn’t properly placed. veraPDF rightly warns about no /Alt or /ActualText (after having the image tagged as figure).
/Alt is an entry in a /StructElem dictionary (the parent of /K, where ConTeXt places it now [https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....]).
After manually placing /Alt in the parent dictionary of /K and both veraPDF and https://www.ngpdf.com/ work fine now.
BTW, when adding a formula (source plus mapping below), veraPDF warns about no /Alt or /ActualText for the formula (which is a requirement for PDF/UA-1, no mathml in this version [at least, no mention to mathml in the veraPDF validation rules]).
Hans, I’m afraid that this haven’t been visible due to images not tagged as figures. Could it be fixed?
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 ___________________________________________________________________________________

In Acrobat Pro (2020 Mac) it looks like this, see attached. Steffen
Am 09.04.2025 um 18:40 schrieb Pablo Rodriguez via ntg-context
mailto:ntg-context@ntg.nl>: On 4/9/25 11:41, Matthias Weber wrote:
Hi Pablo (and Hans)
No, Acrobat reports an empty page when reading the text, and Preview (on the Mac) doesn’t read anything either. I can’t find the text when looking at the pdf in an editor.
Hi Matthias,
the attached PDF document should work now.
Unfortunately Acrobat Reader doesn’t work for me at all (reading texts alould). But I was able to see the value of /Alt (alternative text) with the editor from https://www.ngpdf.com/ https://www.ngpdf.com/.
There were two issues here:
First, image was originally tagged as /NonStruct instead of /Figure (which I changed with lpdf-tag-imp-testing.lmt).
Second, /Alt wasn’t properly placed. veraPDF rightly warns about no /Alt or /ActualText (after having the image tagged as figure).
/Alt is an entry in a /StructElem dictionary (the parent of /K, where ConTeXt places it now [https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.... https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008....]).
After manually placing /Alt in the parent dictionary of /K and both veraPDF and https://www.ngpdf.com/ https://www.ngpdf.com/ work fine now.
BTW, when adding a formula (source plus mapping below), veraPDF warns about no /Alt or /ActualText for the formula (which is a requirement for PDF/UA-1, no mathml in this version [at least, no mention to mathml in the veraPDF validation rules]).
Hans, I’m afraid that this haven’t been visible due to images not tagged as figures. Could it be fixed?
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 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/ ___________________________________________________________________________________

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. The document I attached to the message you reply (b.pdf, SHA512 starting with 9e6f566722d69b3e26d9f419c8107c52a97c479dcc4b8e2d3f14ae58bd24a86c13 and available at https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/YEWPKPJSPTGL...) looks like https://ngpdf.com displays (see attached screenshot). 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. As for the NonStruct PfadPfadPfadPfadPfadPfad, it may come from navigationpage (which I thought it was the page number, but it doesn’t seem to be that). If you allow me a suggestion, use PNG as image format for screenshots (unless they contain pictures). Image size is smaller and the quality loss isn’t so perceptible. Besides that, you can use pngquant to make them smaller (https://pngquant.org/). I hope it is clearer now, Pablo

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

On 4/11/25 11:54, Steffen Wolfrum wrote:
[...] But what do you mean by «lpdf-tag-imp-testing.lmt should be reached by ConTeXt»? Where should I place it?
Usually, $HOME/texmf/texmf-local/ is a good place (or %USERPROFILE%/texmf/texmf-local/, if you use Windows). I hope it helps, Pablo

There is an improvement: now the tags are identified as <Figure> and <Formula>! But still the figures label={this is a cow} is missing. Steffen (with Acrobat Pro 2020 macOS, ConTeXt ver: 2025.04.01 12:45 LMTX)
Am 12.04.2025 um 18:37 schrieb Pablo Rodriguez via ntg-context
mailto:ntg-context@ntg.nl>: On 4/11/25 11:54, Steffen Wolfrum wrote:
[...] But what do you mean by «lpdf-tag-imp-testing.lmt should be reached by ConTeXt»? Where should I place it?
Usually, $HOME/texmf/texmf-local/ is a good place (or %USERPROFILE%/texmf/texmf-local/, if you use Windows).
I hope it helps,
Pablo

On 4/14/25 11:57, Steffen Wolfrum wrote:
There is an improvement: now the tags are identified as <Figure> and <Formula>! But still the figures label={this is a cow} is missing.
Sorry, Steffen, I thought I explained this in a previous message. Alternative text is missing from \externalfigure, because this is the generated PDF object: 17 0 obj << /K [ << /Alt <FEFF0063006F0077> /MCID 1 /Pg 1 0 R /Type /MCR >> ] /P 15 0 R /Pg 1 0 R /S /image
endobj
But it should read: 17 0 obj << /K [ << /MCID 1 /Pg 1 0 R /Type /MCR >> ] /Alt <FEFF0063006F0077> /P 15 0 R /Pg 1 0 R /S /image
endobj
All I know is that it has to be fixed in lpdf-tag.lmt, but I don’t know how to fix it. It is the same for alternative texts in formulas for PDF/UA-1.
Steffen (with Acrobat Pro 2020 macOS, ConTeXt ver: 2025.04.01 12:45 LMTX)
Many thanks for that, but https://www.ngpdf.com/ also shows properties for structure elements. I hope it is clearer now, Pablo

On 4/15/2025 5:24 PM, Pablo Rodriguez via ntg-context wrote:
On 4/14/25 11:57, Steffen Wolfrum wrote:
There is an improvement: now the tags are identified as <Figure> and <Formula>! But still the figures label={this is a cow} is missing.
Sorry, Steffen, I thought I explained this in a previous message.
Alternative text is missing from \externalfigure, because this is the generated PDF object:
17 0 obj << /K [ << /Alt <FEFF0063006F0077> /MCID 1 /Pg 1 0 R /Type /MCR >> ] /P 15 0 R /Pg 1 0 R /S /image
endobj
But it should read:
17 0 obj << /K [ << /MCID 1 /Pg 1 0 R /Type /MCR >> ] /Alt <FEFF0063006F0077> /P 15 0 R /Pg 1 0 R /S /image
endobj
All I know is that it has to be fixed in lpdf-tag.lmt, but I don’t know how to fix it.
you can move the Alt and test local d = pdfdictionary { Type = pdf_mcr, Pg = pageref, MCID = last, } parent.dict.Alt = pdfunicode(label ~= "" and label or "image")
It is the same for alternative texts in formulas for PDF/UA-1.
you can play with -- Alt = alternate, NS = namespace, ActualText = actualtext or nil, Alt = actualtext or nil, NS = namespace, -- ActualText = actualtext or nil, and such to see if your viewer does soemthing useful 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 -----------------------------------------------------------------

On 4/15/25 19:10, Hans Hagen wrote:
On 4/15/2025 5:24 PM, Pablo Rodriguez via ntg-context wrote:
[...] All I know is that it has to be fixed in lpdf-tag.lmt, but I don’t know how to fix it.
you can move the Alt and test
local d = pdfdictionary { Type = pdf_mcr, Pg = pageref, MCID = last, } parent.dict.Alt = pdfunicode(label ~= "" and label or "image")
Many thanks for your reply, Hans. This fixes the issue.
It is the same for alternative texts in formulas for PDF/UA-1.
you can play with
-- Alt = alternate, NS = namespace, ActualText = actualtext or nil,
Alt = actualtext or nil, NS = namespace, -- ActualText = actualtext or nil,
and such to see if your viewer does soemthing useful
I get an /Alt key automatically generated by ConTeXt, but I get: 18 0 obj << /K [ 19 0 R ] /P 15 0 R /Pg 1 0 R /S /formula
endobj
19 0 obj << /K [ 23 0 R ] /P 18 0 R /Pg 1 0 R /S /formulacontent
endob
23 0 obj
<<
/AF 22 0 R
/Alt
endobj
/Alt is in object 23 and it needs to be in object 18 (which is tagged as /Formula), how do I get that? Many thanks for your help, Pablo
participants (5)
-
Hans Hagen
-
Hans Hagen
-
Matthias Weber
-
Pablo Rodriguez
-
Steffen Wolfrum