daisy / math-a11y

5 stars 2 forks source link

Unable to Create a Clean/Finished Expression for “Subscript n Baseline upper C Subscript k” That Renders Without Empty Placeholders #2

Open brichwin opened 2 months ago

brichwin commented 2 months ago

eDAD tracking ticket for this issue is Accessibility 228595

Description:

“Subscript n Baseline upper C Subscript k” (or \[_nC_k\] in LaTeX), is a very common notation used to indicate the number of ways to chose m elements from a set of n elements without regard to the order of selection. The LaTeX for this expression would typically render something like shown in this image: rendered from LaTeX via mathJax. It renders as an italic descended lowercase n, followed by an italic capital C at baseline, followed by an italic descended k. It could not be determined how to enter this notation using a keyboard via Linear Mode (Unicode or LaTeX) nor via the commands in the Structures group on the Equations tab. All attempts made result in an empty placeholder rectangle being present in the expression. For example: A series of attempts to create [begin math] Subscript n Baseline upper C Subscript k [end math] in Word. Each attempt includes a rectangle with a dotted outline. The rectangle is a placeholder where a superscript or subscript's content goes. Which do not disappear once in Professional mode and not being rendered.

Why this Issue Is Important

Faculty can be quite particular and may reject using MS Word's Equation Editor for creating mathematics if it is not easy to create a math expression in the visual rendering they want. For example, they may wish to show the typical definition that includes several forms of the notation as having students learn the various forms is important: Subscript n Baseline upper C Subscript m Baseline equals StartBinomial n Choose m EndBinomial; is equal to; the fraction with numerator; n factorial; and denominator m factorial, open paren n minus m, close paren; factorial; end fraction, Which in LaTeX is:

\[
  _nC_m = \binom{n}{m} = \frac{n!}{m!(n-m)!}
\]

Steps to Reproduce:

Unicode Linear Mode

The support documentation provides the following example: Example UnicodeMath format Built-up format
LeftSubSup _a^b<space>x<space> Subscript a Superscript b Baseline x

We interpreted that to mean we needed to try _n<space>C_m<space>:

  1. Open Microsoft Word 365 (Desktop version) on Windows 11.
  2. Create a new document.
  3. Press Alt+= to enter the equation editor.
  4. Ensure the input mode is set to Linear and Unicode.
  5. Type _n<space>C_m<space>
  6. Convert to Professional mode and leave the expression.
  7. Note that a placeholder rectangle remains in the built-up Professional mode (not editing) version were the LeftSup would be despite not entering the ^ code on the left.
  8. Other combinations tried with the same result were: _(n)<space>C_m<space>, _(n)^()<space>C_m<space>, _n^<space>C_m<space>

Unicode LaTeX Mode

  1. Open Microsoft Word 365 (Desktop version) on Windows 11.
  2. Create a new document.
  3. Press Alt+= to enter the equation editor.
  4. Ensure the input mode is set to Linear and LaTeX.
  5. Type _nC_m and then convert to Professional mode.
  6. Note that a placeholder rectangle remains in the built-up version in the LeftSup position even in Professional mode and not being edited.

Commands in the Structures Group of the Equations Tab

  1. Open Microsoft Word 365 (Desktop version) on Windows 11.
  2. Create a new document.
  3. Press Alt+= to enter the equation editor.
  4. Use the Script dropdown gallery command in the Structures group to open the Subscripts and Superscripts gallery.
  5. Note that no structure matches the desired format: image
  6. Using any combination of those in attempt to create the desired expression will result in unwanted empty placeholders when in Professional mode and not being edited.

By Pasting in MathML of the Desired Expression

  1. Open Microsoft Word 365 (Desktop version) on Windows 11.
  2. Create a new document.
  3. Copy either of the following MathML samples, then paste it into the document:
    <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
    <msub>
    <mi></mi>
    <mi>n</mi>
    </msub>
    <mo>&#x2062;</mo>
    <msub>
    <mi>C</mi>
    <mi>m</mi>
    </msub>
    </math>

    or

    <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
    <mmultiscripts>
    <mi>C</mi>
    <mi>m</mi>
    <none></none>
    <mprescripts></mprescripts>
    <mi>n</mi>
    <none></none>
    </mmultiscripts>
    </math>
  4. Using either of these in attempt to create the desired expression will result in unwanted empty placeholders when in Professional mode and not being edited.

Expected Behavior:

Empty placeholders should disappear visually and semantically (if appropriate) when built-up into Professional expressions. Note that it may be important to note empty multi-script positions semantically (in Tensor notation perhaps).

Observed Behavior:

Empty placeholders remain both visually and semantically when built-up into Professional expressions.

Version Information:

Sample Document:

I have attached a sample file where series of series of attempts were made to create the desired expression but resulted in unwanted empty placeholders.

Attachment:

Various Failed Attempts to Create Subscript n Baseline upper C Subscript k.docx

MurrayIII commented 2 months ago

You can type _n C_k and then enter \zwsp into the empty placeholder. \zwsp (U+200B) is a zero-width space. Then the place holder disappears. But it would be better if Word worked like OneNote (which uses RichEdit as its text editor). There the place holder is only displayed if you move the insertion point into the missing argument. Ditto for the index of roots, missing integral limits, etc. This is described in https://learn.microsoft.com/en-us/archive/blogs/murrays/automatic-arguments

jkhurdan commented 1 month ago

Description

I recreated the word doc using MacOS and the instructions above, and found the same results.

Version Description

Observed behavior

The same issue appeared for MacOS users. I tried the above steps by @MurrayIII and that did remove the box. Additionally, I was able to insert a into that field and that also removed the box. Both the \zwsp and a normal space was ignored by the Read Aloud.

jkhurdan commented 1 month ago

Tested this with on Windows 11, using Word 365 and was able to recreate this issue. This issue is verified.