AmerMathSoc / texml

A repository for texml development
9 stars 2 forks source link

improving alt-text usage #55

Open pkra opened 4 years ago

pkra commented 4 years ago

Currently, only mbk103 has instances of the alt-text element. There, it appears only inside fig elements.

In ams-xml-to-html, we currently have

https://github.com/AmerMathSoc/ams-xml-to-html/blob/138f6c862fbe804ddafb9942be1cd245247ea4d0/ams-xml-to-html.xsl#L755-L757

This is very specific to this use case. For example, a figure with multiple graphics would have a single alt-text.

If we encounter new publications with alt-text (in particular, if content is required to include graphics alt-text), we should reconsider this. E.g., jats and bits allow alt-text as a child of graphic and inline-graphic.

In the JS implementation of ams-xml-to-html, it is somewhat inconvenient to implement the lookup the same way as in XSL; for simplicity, we will only look for alt-text if the parent is a fig element which will suffice for mbk103. We can update the implementation once we encounter new content.

pkra commented 3 years ago

Documented at https://github.com/AmerMathSoc/ams-platform-documentation/commit/22204a0f23e8077a009aa81222fe07f909f92ee4

pkra commented 2 years ago

Random note on authoring: make4ht supports \includegraphics[alt=hello]{hello.png} syntax.

pkra commented 8 months ago

Beyond the official LaTeX syntax, it would be good to provide an option for \begin{SVG}.

pkra commented 7 months ago

On another related note, it would be good to store the title in generated SVGs in the XML to make it simpler to find.

pkra commented 7 months ago

We should also prototype means of linking to long textual alternatives.

On the XML end, would could just have an xlink:href on the graphic though perhaps on a child works out better (e.g., long-desc ).

I don't know if TeX \label is too TeX-y - #36 comes to mind. I suspect if the href just links to a (empty) target element, we'll have trouble working out what to really use for the textual alternative.

pkra commented 6 months ago

For completeness, here's an experiment of mine for providing short labels inside math mode https://github.com/krautzource/mathjax-aria-label/ . The underlying constructs will remain explorable but on the higher level, SRE will pick up on the author's textual alternative.