Skip to content

Make MathML selectable for great interop with apps that consume MathML in HTML such as Word and PowerPoint #3508

@petewu100

Description

@petewu100
  1. In the web browser load the following webpage that uses MathJax 4.1 with assistiveMml on: https://petewu100.blob.core.windows.net/newcontainer/MathJax.4.1.Test.htm
  2. Drag across the web page to select some content including some math.
  3. Ctrl+C to Copy.
  4. Boot Word for Windows Version 2508 or later.
  5. Blank Document.
  6. Ctrl+V to Paste.

=> Note: the pasted content only contains the heading text and not the math.

Expected: the math to be included as well.

  1. In the web browser, go to https://petewu100.blob.core.windows.net/newcontainer/SelectableMathMLBookmarklet.htm.
  2. Click on the "Selectable MathML" link and drag it to the browser Favorites or Bookmarks bar.
  3. Go back to https://petewu100.blob.core.windows.net/newcontainer/MathJax.4.1.Test.htm.
  4. Click the "Selectable MathML" button on the browser Favorites or Bookmarks bar.
  5. Drag across the web page to select some content including some math.
  6. Ctrl+C to Copy.
  7. Switch back to Word.
  8. Ctrl+V to Paste.

=> Note: now the math is included.

Expected: the math to be included after step 6 without having to use the "Selectable MathML" bookmarklet.

MathJax adds the following CSS rule in the webpage which makes the MathML unselectable:

mjx-assistive-mml {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

Why?

I haven't noticed any interaction problems when the MathML is selectable. Other math packages on the web keep the MathML selectable and it doesn't seem to cause any problems.

Making the MathML selectable has a huge benefit. It allows the math to be copy/paste to apps that consume MathML in HTML such as Word, PowerPoint. Excel (within shapes in SmartArts), and soon OneNote. Furthermore, the semantics of the math are preserved so that it is editable and accessible in the documents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions