nlbdev / nordic-accessible-epub-guidelines

2 stars 2 forks source link

Rules for how to mark up numbers #37

Closed AndersEkl closed 7 months ago

AndersEkl commented 1 year ago

Originally written by @josteinaj

Also minus signs, some will mark it in red to signal that it's negative, rather than using a minus sign.

Spaces between operators and numbers? (plus, minus, etc.)

Which symbols to use for which operators? ("x" vs "×" vs "✕" for multiplication, etc)

One rule could be that spaces inside numbers should always use  ?

This is important when reading the numbers using text-to-speech, or when using a screen reader.

See also: https://github.com/nlbdev/nlbpub/issues/8

AndersEkl commented 1 year ago

This will in part be a matter for the suggested common nordic MathML guidelines that Arne has suggested we start working on quite soon. But there may also be useful to have some mentioning of this in the EPUB guidelines for a more general, non-mathematic, context.

AndersEkl commented 1 year ago

Write some clarification about this topic.

TorilBWM commented 1 year ago

NG 2020: All mathematical or scientific content, content that contains mathematical operators, special characters, subscripts, superscripts etc., must be marked up using MathML.

Our guidelines are currently more restrictive. Examples: Always mark up formulas (in chemistry, physics and mathematics) with ASCIIMath. In science books, excluding mathematics books, do not mark up chemical elements occurring in the regular text with ASCIIMath. Use <sub> and <sup>, e.g. CO2: CO<sub>2</sub>. To avoid any issues with decimal separators, always use ASCIIMath for decimal numbers. Always use ASCIIMath for individual natural numbers from 1000 and higher. Individual natural numbers from 0-999 do not need to be marked up with ASCIIMath. Numbers denoting time or date should not be marked up with ASCIIMath unless they are part of a calculation. Time spans given in years should not be marked up as ASCIIMath, e.g. 1990–2017.

AndersEkl commented 7 months ago

Some thoughts here... I agree that &nbsp; should be used in large numbers like "1 000 000". I think we should have a rule that says all numbers shall be written as they are in the source material. Numbers in the text, not in a mathematical expressions, should not be marked up as MathML. In fact, nothing that is presented not in a mathematical expression should be marked up as MathML. For instance 2 square kilometers should be marked up as 2 km<sup>2</sup>.

What about chemistry? Of course, if carbondioxide is mentioned in a book which is not a chemistry book, it should probably be marked up as CO<sub>2</sub>. But in a chemistry book... how should we think there? It is nice if these things are presented in a uniform way to the reader. I suspect that MathCAT might produce a different result than the screen reader itself.

jonaslil commented 7 months ago

ping @samimaattaCelia

AndersEkl commented 7 months ago

@martinpub @jonaslil @oscarlcarlsson @lindheli Please take a look at my proposed text here. Is this enough, or do I need to be more detailed?

martinpub commented 7 months ago

From my perspective it's enough, but please check with Tim. I made some minor comments on the commit.

oscarlcarlsson commented 7 months ago

+1 on martins comment

lindheli commented 7 months ago

looks good to me

samimaattaCelia commented 7 months ago

I think the proposed text is good overall.

The definition of a 'matematical expression' might prove challenging, since 2+2 is an expression, but wouldn't really require MathML to mark up. Then again 2+22 would probably be marked up as MathML even if it's this simple of an expression.

I don't know if it's worth the effort to try to make it clearer, since the ordering agency would have to make the call anyway. I bet it would also start slipping easily into MathML guidelines territory. So, this would be important for the ordering agencies to keep in mind when ordering STEM content.

AndersEkl commented 7 months ago

I would say 2+2<sup>2</sup> could be written like that too, in a non-STEM context. But yes, it is not easy to make a clear distinction between this. Agencies need to be aware when ordering non-STEM books that contains some STEM content. I have made some additions to the text to try and make it slightly clearer. Will submit in a short while.

martinpub commented 7 months ago

There is also @role="math". I know that DAISY people have been experimenting with this role for text-only math expressions, not sure about the status, but it should aid having AT interpret the expressions even though they are "only" plain text.

AndersEkl commented 7 months ago

I am not sure about this... I have tested it a bit with JAWS and can not see any advantage with having the role math set. Have tested the examples here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/math_role Using aria-label seems to make JAWS only reading the aria-label and not the contents of the element.

AndersEkl commented 7 months ago

MathCAT even ignores non-MathML contents marked up with role="math". So, let us wait with using that until we are sure it works.

AndersEkl commented 7 months ago

I added a few examples of what would typically be marked up as plain text and HTML and also wrote that anything that can't be exactly represented by standard HTML must be marked up with MathML. I think that helps a little with drawing the line. Will close this issue soon.

martinpub commented 7 months ago

Thanks Anders, sounds reasonable.

AndersEkl commented 7 months ago

Closing this issue now.