Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS-Word converting plain text to math has problem with minus (dash) #7

Open
GeorgeKerscher opened this issue Aug 4, 2024 · 4 comments

Comments

@GeorgeKerscher
Copy link
Collaborator

GeorgeKerscher commented Aug 4, 2024

eDAD tracking ticket for this issue is Accessibility 228599

While using alt + = is the best way to enter math expressions, the typing of simple math and then highlighting the text to convert with alt + = is supported

The "-" character is converted as a ndash instead of a minus sign.

Typing x -3= 4 andhighlighting and pressing alt + = yields unpredictable results. Sometimes it is minus and other times it is an ndash.

Will not convert properly.

@brichwin
Copy link
Collaborator

brichwin commented Aug 7, 2024

I've verified that when selecting normal text in a word document that represents a simple math expression and then pressing Alt+=, many of the various dash characters are not converted into a minus math operator.

I tested many of the characters that OCR engines (ABBYY Fine Reader, etc.) commonly generate when recognizing text with math expressions. Only the hyphen-minus character (002d) and the Unicode minus sign character (2212) appear to be recognized as the minus math operator when selected text is converted using Alt+=.

Here is a list of characters that are commonly generated by OCR engines that were not recognized:

  • Figure Dash Character 2012
  • En Dash Character 2013
  • Em Dash Character 2014
  • Nonbreaking Hyphen Character 2011

I tested this on:

  • OS Version:
    -- OS Name: Microsoft Windows 11 Enterprise
    -- Version: 10.0.22621 Build 22621
    -- Locale: United States
  • Microsoft Word Version:
    -- Microsoft 365 Apps for enterprise
    -- Version 2402 (Build 17328.20452 Click-to-run)

Sample file:
various_math_operator_symbols.docx

@MurrayIII
Copy link

Alt+= on plain text converts the ASCII hyphen-dash (U+002D) into the math minus (U+2212) as it should. You can see this by typing Alt+x immediately following the minus sign: you get 2212. Interesting idea to convert other dashes via Alt+x. Problem is that the user might want to use them. With the ASCII hyphen-dash. it's pretty unambiguous that a minus is intended.

@GeorgeKerscher
Copy link
Collaborator Author

Hi,

When I type:

7 - 3 = x and then highlight it and press alt+= The - becomes an ndash and not a minus.

I wonder about Word settings and what characters that are converted by word similar to " being converted to beginning quotes and the following " being converted to end quotes.

@MurrayIII
Copy link

MurrayIII commented Aug 17, 2024

Surrounding the - with spaces causes this. If you type 7-3=x, i.e., without the spaces, selecting and Alt+= converts the dash to a minus (U+2212) and the math spacing is correct. In OneNote and PowerPoint, the conversion is to U+2212 with or without spaces, but the spaces aren't deleted. They should not appear since they cause poor math spacing. I don't have access to the Word code to figure out why Word converts the dash to U+2013 when the dash is surrounded by spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants