nlbdev / mathml-guidelines

A collaboration on the MathML guidelines for marking up accessible math
1 stars 1 forks source link

Use of labels with `<mlabeledtr>` #44

Open samimaattaCelia opened 2 months ago

samimaattaCelia commented 2 months ago

I did some testing and it seems like there are problems with using the element <mlabeledtr>. It is used to provide labels for rows of matrices and also for equations.

It is not well supported by browsers. Also MathJax (at least 3) struggles with it.

Firefox rendering (does not render the label at all): kuva

Google Chrome and Microsoft Edge rendering (layout is very weird): kuva

Edge: kuva

MathJax rendering (renders the label, but the layout is weird): kuva

Thorium Reader uses MathJax to render the equations, so this would be the experience for people using it.

Mark up for this:

<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
        <mrow>
          <mrow>
            <mo>[</mo>
            <mtable>
              <mlabeledtr>
                <mtd>
                  <mtext>(3.1)</mtext>
                </mtd>
                <mtd>
                  <mn>3</mn>
                </mtd>
                <mtd>
                  <mn>1</mn>
                </mtd>
                <mtd>
                  <mn>4</mn>
                </mtd>
              </mlabeledtr>
              <mtr>
                <mtd>
                  <mn>0</mn>
                </mtd>
                <mtd>
                  <mn>2</mn>
                </mtd>
                <mtd>
                  <mn>6</mn>
                </mtd>
              </mtr>
            </mtable>
            <mo>]</mo>
          </mrow>
        </mrow>
      </math>

MathCAT

In version 0.5.6 of MathCAT, it reads out the wrong amount of columns when the label is used. I think this has been the case for a while now, right @AndersEkl and @TimArborealis? This is not the most updated version of MathCAT, but it is what you get when downloading it from the addon site. This should be tested by somebody else as well.

kuva

Equation labeling

Labeling equations is refenced by Tim in #4. It has the same problems, but for only one equation it looks ok. I didn't test with MathCAT.

Firefox: kuva

Google Chrome: kuva

MathJax: kuva

Should we use it?

It's not part of MathML Core and it works so inconsistently with regards to rendering and MathCAT that I wouldn't include it. We have to come up with a different way of labeling.

TimArborealis commented 2 months ago

Excellent job with the testing, Sami! Timely conundrum for the title I'm working on at the moment which contains a lot of eqn numbering, e.g. bild

Related, there's a lot of eqn annotations, e.g. bild

I do hope we find a solution which allows for cross-referencing of equation numbering, but seeing as the rendering is shaky (to say the least) at present I'm gonna opt for \<mtext> for both numbering and annotation.

Regarding how the latest version of MathCAT reads eqn numbers I have not had the chance to test it, but I do believe we reported the bug to Neil.

TimArborealis commented 2 months ago

This, however, I don't know how to handle at all: bild