Tex or mathml to Alttext

47 views
Skip to first unread message

Sri Krishnan

unread,
Aug 2, 2024, 12:00:59 AM8/2/24
to MathJax Users
Hi all,

I am trying to generate TeX to mathml and Alt text using "MathJax-demos-node". I configured and installed all the dependencies. I run the following command in CMD. MathML produces correctly. But Alt-text not generated. I have tried all the possibilities by googling it, but no success.

i encountered following errors:

Unable to load locale: base
Unable to load locale: en
Something went wrong computing speech.

Can any one help me in this regard?

C:\MathJax-demos-node\speech>node -r esm tex2mml "a^2+b^2"
Unable to load locale: base
Unable to load locale: en
Something went wrong computing speech.
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" data-semantic-speech="">
  <msup>
    <mi>a</mi>
    <mn>2</mn>
  </msup>
  <mo>+</mo>
  <msup>
    <mi>b</mi>
    <mn>2</mn>
  </msup>
</math>

screenshot.png

Davide Cervone

unread,
Aug 2, 2024, 5:11:05 PM8/2/24
to mathja...@googlegroups.com
The speech-rule-engine component for MathJax is getting the path to its json files wrong when run in Windows, due to Window's use of "\" for directory separator rather than the unix "/" separator.  If you edit the node_modules/mathjax-full/components/src/a11y/sre/sre_config.js file and change line 15 from

        path + '/base.json').replace(/\/base\.json$/, '');

to 

        path + '/base.json').replace(/\\base\.json$/, '');

(changing "\/" to "\\" in the replacement pattern) and that should take care of it for you.

Davide



<screenshot.png>

--
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/0afc09c4-ab57-4ce6-b9e3-e7c0a6af6516n%40googlegroups.com.
<screenshot.png>

Reply all
Reply to author
Forward
0 new messages