WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: MathJax and thousands separator

for

Number of posts in this thread: 2 (In chronological order)

From: Mike Warner
Date: Tue, Mar 15 2022 2:09PM
Subject: MathJax and thousands separator
No previous message | Next message →

Hi all,

I've been trying to figure out how to get MathJax (2.7) to read $1,200 as
one thousand two hundred dollars or dollar one thousand two hundred.
However, kt sees the comma as a list item delimiter not a thousands
separator, so the speech output is dollar one (pause) two hundred. I've
tried a few things in both MathML and LaTex, but the comma is always read
as a pause. Any tips?

Thanks,
Mike

Mike Warner
Director of IT Services
MindEdge, Inc.

From: Cervone, Gian Carlo (gcervone)
Date: Tue, Mar 15 2022 3:43PM
Subject: Re: MathJax and thousands separator
← Previous message | No next message

From Davide P. Cervone, one of the developers:

The message does not actually include enough detail to diagnose the issue. I actually expect that it is not MathJax related at all, unless they have put the dollar amount inside a math expression, e.g., it is enclosed within math delimiters for LaTeX format. For LaTeX, one would want to encode that as

($12{,}000)

in order to get the 12,000 to be treated as a number (That is true in both actual LaTeX and MathJax.) MathJax's expression explorer will then send that as "dollar sign 12,000" to the screen reader, but it is up to the screen reader to speak "12,000" correctly. I don't know which ones will do and which don't, but I'd think they should be able to do that.

If they aren't using MathJax's expression explorer, but are relying on the hidden assistive MathML that MathJax produces, then the MathML generated is

<math xmlns="http://www.w3.org/1998/Math/MathML<;https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1998%2FMath%2FMathML&data%7C01%7Cgcervone%40brockport.edu%7C02beeded95c64b4186fd08da06c995cd%7C696ec4990f244fd9b691252a2884ef3b%7C0%7C0%7C637829760142690377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Vsk4k%2FXZf%2BWWzQMkuu%2BsjrAbxI7ek8ykD9m9A3iUpD4%3D&reserved=0>" display="block">
<mrow data-mjx-texclass="ORD">
<mo>$</mo>
</mrow>
<mn>12,000</mn>
</math>

and they are relying on the screen reader to understand the MathML. Again, how well that works depends on the screen reader, but the MathML is correct and should work.

I suspect they have not used the braces around the comma, and that means that it will be interpreted as an actual comma, and so will separate two numbers, $12 and 000. The generated MathML is

<math xmlns="http://www.w3.org/1998/Math/MathML<;https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1998%2FMath%2FMathML&data%7C01%7Cgcervone%40brockport.edu%7C02beeded95c64b4186fd08da06c995cd%7C696ec4990f244fd9b691252a2884ef3b%7C0%7C0%7C637829760142690377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Vsk4k%2FXZf%2BWWzQMkuu%2BsjrAbxI7ek8ykD9m9A3iUpD4%3D&reserved=0>" display="block">
<mrow>
<mrow data-mjx-texclass="ORD">
<mo>$</mo>
</mrow>
<mn>12</mn>
</mrow>
<mo>,</mo>
<mn>000</mn>
</math>

which is not what they want, and would account for the reading they are getting.

Finally, if they are entering MathML directly, they can use

<math xmlns="http://www.w3.org/1998/Math/MathML<;https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F1998%2FMath%2FMathML&data%7C01%7Cgcervone%40brockport.edu%7C02beeded95c64b4186fd08da06c995cd%7C696ec4990f244fd9b691252a2884ef3b%7C0%7C0%7C637829760142690377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Vsk4k%2FXZf%2BWWzQMkuu%2BsjrAbxI7ek8ykD9m9A3iUpD4%3D&reserved=0>" display="block">
<mo>$</mo>
<mn>12,000</mn>
</math>

They don't really say which version of MathJax they are using (2.7.5 vs 2.7.9, for example), so it may also be that they might consider updating their version of MathJax. The speech-rule-engine has been improved quite a bit in recent years, and if they are running below 2.7.7, they should update.

Anyway, without more information, that's the best I can tell you.

Davide

He also notes that

https://groups.google.com/g/mathjax-users<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fg%2Fmathjax-users&data%7C01%7Cgcervone%40brockport.edu%7Ca9922a0b111b4336d65908da06cc428b%7C696ec4990f244fd9b691252a2884ef3b%7C0%7C0%7C637829772392429684%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ueQg9bFbNQqzQFY98iXX6rRc%2Bj58%2B0rGcHCACw6jLO0%3D&reserved=0>

is a good place to ask MathJax questions.

Best regards,

-= GCC =-

Gian Carlo Cervone
Web Manager
SUNY Brockport
= EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = > ' 585-395-5073




On Mar 15, 2022, at 4:09 PM, Mike Warner < = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = >> wrote:

Warning: Message from non-Brockport Email Server. Treat message, links, and attachments with extra care.


Hi all,

I've been trying to figure out how to get MathJax (2.7) to read $1,200 as
one thousand two hundred dollars or dollar one thousand two hundred.
However, kt sees the comma as a list item delimiter not a thousands
separator, so the speech output is dollar one (pause) two hundred. I've
tried a few things in both MathML and LaTex, but the comma is always read
as a pause. Any tips?

Thanks,
Mike

Mike Warner
Director of IT Services
MindEdge, Inc.