You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
I'm trying to learn how to make LaTeX more accessible and wanted to ask if anyone has any experience embedding alt text for commutative diagrams (drawn in my case with tikzcd) inside a LaTeX document.
I've read some useful author guidelines on preparing accessible mathematical content that describe how to do this for graphics included with \includegraphics but my tikzcd diagrams are drawn in a normal displayed equation environment. Those guidelines do discuss alt text for code generated figures:
If the code-generated figure is relatively complex with code much longer than a description of the figure’s key takeaway, e.g., a complex commutative diagram or a collection of curves on a surface, then include descriptive alt text as per the guidelines above
but suggest including this as a separate file. The file I have in mind has a huge number of figures, most of which are not labeled, so I don't like this solution. I'd rather embed the alt text near the source code in the LaTeX file itself. Does anyone have any pointers?
Eg the best idea I've had is to create a macro called \alt-text{} taking one argument (the natural language alt text) and displaying nothing. But this is a naive idea and I'd love a better one.
Maybe @Carlo Angiuli has a suggestion? (I'm recalling https://www.carloangiuli.com/pages/accessible-latex.html)
By alt-text, do you mean "a written description of what the diagram contains", like "A square with corners A,B,C,D, and arrows f,g,h,k, such that..." or something else?
Yes, that's the idea. I shudder to think what Igor Bakovic's worst/best diagrams would need to describe them.
David Michael Roberts said:
Yes, that's the idea. I shudder to think what Igor Bakovic's worst/best diagrams would need to describe them.
I̴̺̖͛̓ ̶̛͍̞̐a̵̗͒̈́̈́͜m̸̖̈ ̷̗̪̆a̵̭̣̩͊͝ ̸̧͊̒͂d̴͚͌́͒i̵̘͑a̷̡͍̿̕g̷̗͐͑͆r̸̨̾̀͠a̵̢̛͘m̵̦̮̎͂ ̸̲̂̅-̶̲̬̓̕ ̶̭̯̔̊b̸͇͋͒̈ḛ̴̈̽ ̷̻̆̇̅n̵̢̥̂ó̸̯̗̙͒ẗ̴̠́̏ ̵̺̰̑ḁ̵̠̒͑f̴̠̩̄r̵͙͈̋͋̇a̶̦̫̩͗́i̶͔͊͝d̵͓̩̈
Yes, I'm going to experiment with what the guidelines characterize as "descriptive alt text," meaning roughly 150 characters summarizing the main takeaway. As the recommendation for simple figures is to have the LaTeX source serve as the alt text, I may only do this for the more complicated diagrams, but we'll see.
Probably the simplest diagrams can have their implied equations or higher-cells definitions as alt-text?
Tikzcd code is basically a labelled directed graph, so the lowest effort solution would be to include the tikzcd code as the alt text. Presumably many of the people reading it would already be familiar with tikzcd syntax.
I don't believe that would be much better than nothing: tikzcd contains a lot of symbols, which screen readers aren't particularly good at dealing with.
Who is the alt-text for? Is it for people who can see, but only badly, or people who have gone blind or people who have been blind from birth? I imagine what a useful description is could be different in these different cases.
It's an interesting and difficult / maybe impossible problem to think how complicated diagrams could possibly be described in a comprehensible way. I'm not convinced 150 characters would be enough.
I guess an advantage of having the source code would be that, even if it isn't directly useful, it can be copied into an llm or something and the reader can ask it whatever questions they want about what the diagram looks like, though I don't know how good llms are at understanding the layout of diagrams from source code these days and maybe taking a screenshot would work better.
@Graham Manuell there are plenty of standards (some of them legal) for the content of alt-text; here is a standard set by the UK government for its communications, for example. But I understood Emily's question to be a practical one: PDF readers and screen readers can parse alt-text to be displayed or read aloud, respectively; it would be nice to have a standard way to achieve this in LaTeX in order to meet those standards where they exist (or even when they don't).
I did understand it as a technical question about LaTeX and that's important, but I thought it was also worth discussing how to actually describe the diagrams. If it's just about satisfying some legal conditions that's fine, but it's probably also a good idea to actually make the descriptions useful.
The standards set expectations about the function of the alt-text, but you're right that it doesn't answer what we should be aiming for, since just describing the topology/shape of the diagram isn't necessarily helpful. :thinking:
I agree with Graham, there is an extremely interesting question behind the mere technical problem. What does a diagram convey?
Hi, this isn't answering Emily's question, nor will it be new to many people here, but I just want to recommend the article the World of Blind Mathematicians, in the AMS, to anyone who hasn't read it. I especially liked the anecdote on page 1250 about the conference room plunged into darkness, and yet people, blind and sighted, were able to follow the lecture without any visual aids.
Thanks, what a fascinating read! It's fun because I was reading about Morin's proof of the sphere eversion a few days ago, and I was amazed to learn of his blindness. It reminded me of Thurston's strabism which allegedly make him unable to perceive depth without effort, and once he learned to do that, going one dimension higher wasn't such a big deal.
Graham Manuell said:
I guess an advantage of having the source code would be that, even if it isn't directly useful, it can be copied into an llm or something and the reader can ask it whatever questions they want about what the diagram looks like, though I don't know how good llms are at understanding the layout of diagrams from source code these days and maybe taking a screenshot would work better.
Recently I was pondering the use of rule-based NLG systems for expressing structured information. In Explaining Natural Language Query Results it's done for database queries. The reader would be able to query information about the graph, the author could include some queries that capture interesting information, or there could be some standard queries included for that sort of graph.