Change speech text for symbols

21 views
Skip to first unread message

Richard Zach

unread,
Jul 29, 2023, 1:03:36 PM7/29/23
to MathJax Users
Hi,

Is it possible to change the screen reader text produced by MathJax for some symbols? I do a lot of mathematical logic and the stock pronunciation of many of the symbols aren't what a user would expect. E.g., ⊢ is voiced as "right tack" but I'd prefer "proves" (⊬ is "does not prove")

I assume what a screen reader does is use the `aria-label` that MathJax puts on the `<mjx-container>` it produces for a formula. I also assume that the text in there for a symbol comes from https://github.com/mathjax/MathJax/blob/master/es5/sre/mathmaps/en.json (or https://github.com/mathjax/MathJax-a11y/blob/master/dist/mathmaps/en.js ?) That's where you'll find the symbol mapped to the text string:
```
{"category":"Sm","mappings":{"default":{"default":"right tack"}},"key":"22A2"}
```
Is that right?

What I figure might be possible (either now or perhaps in in the future), and in order of (my) preference:

1. Provide some attribute on the relevant `<mo>` tag in the input MathML the page provides, e.g., `<mo data-semantic-speech="proves">⊢</mo>`.
2. Do something in the MathJax configuration for the page, e.g., load a patched .js or other file, pass some options, etc., that changes
```
{"category":"Sm","mappings":{"default":{"default":"right tack"}},"key":"22A2"}
```
to
```
{"category":"Sm","mappings":{"default":{"default":"proves"}},"key":"22A2"}
```
somehow.
3. Change what I want in the right source file(s) (which?) and make my own build of MathJax.

I don't actually have a lot of experience with screen readers, so if any change to what MathJax does is unlikely to help (e.g., if NVDA or JAWS ignores the aria-label MathJax provides and does its own thing), or if it would fix the aria-label on the entire formula but not the pronunciation of parts of it when it is explored using MathJax,  that would be helpful to know.

Thanks,
R

Willem van der Walt

unread,
Aug 2, 2023, 5:09:25 AM8/2/23
to MathJax Users
Those as I understand it comes from sre-l10n in the
mathmaps/en/symbols/math_symbols.json
Regards, Willem
> --
> You received this message because you are subscribed to the Google Groups "MathJax Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/f58463b0-9ff6-49b4-9b95-6d52804c3df0n%40googlegroups.com.
>
Reply all
Reply to author
Forward
0 new messages