Page MenuHomePhabricator

Need a way to write multiscripts around an expression
Open, Needs TriagePublic

Description

https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Subscripts.2C_superscripts.2C_integrals proposes some hacks to attach scripts around a base:

(1) \sideset{_1^2}{_3^4}\prod_a^b
(2) {}_1^2\!\Omega_3^4

Note that the scripts "1" and "2" are not semantically attached to the base (but to a dummy "empty base"). Same for 3 and 4 in (1). Also (2) results in the generation of a negative space to do "as if" the prescripts were attached to the base. This is discouraged by the MathML spec (http://www.w3.org/TR/MathML/chapter3.html#presm.warnspacing).

These hacks are in particular problematic for assistive technologies.

The MathML spec has the <mmultiscripts> and <munderover> element for that purpose, see "multiscripts
& greek alphabet" on Joe Java's test http://eyeasme.com/Joe/MathML/MathML_browser_test

Note that itex2MML proposes the commands \tensor or \mmultiscripts to generate several pre/post scripts:
https://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html#itex2MMLFrac

Event Timeline

fredw created this task.Jul 9 2015, 11:56 AM
fredw raised the priority of this task from to Needs Triage.
fredw updated the task description. (Show Details)
fredw added projects: Math, Mathoid, Accessibility.
fredw added a subscriber: fredw.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 9 2015, 11:56 AM
Physikerwelt set Security to None.Jul 20 2015, 12:22 AM
Physikerwelt added a subscriber: Pkra.
Physikerwelt added a subscriber: Physikerwelt.

@fredw: I guess this is a MathJax problem.

Can you give an example of how the MathJax looks now and how it should look like

fredw added a comment.Jul 22 2015, 6:47 PM

I don't know what you mean by "how MathJax looks now and how it should look like". As said in the first comment, it's not a problem with the visual rendering but with the way the generated MathML, which has bad semantics and so makes things hard for assistive technologies.

As a comparison, here is what LaTeXML generates:

<munderover>
  <mmultiscripts>
    <mo symmetric="true" movablelimits="false" largeop="true">∏</mo>
    <mn>3</mn>
    <mn>4</mn>
    <mprescripts/>
    <mn>1</mn>
    <mn>2</mn>
  </mmultiscripts>
  <mrow><mi>a</mi><mphantom><mn>4</mn></mphantom></mrow>
  <mrow><mi>b</mi><mphantom><mn>4</mn></mphantom></mrow>
</munderover>
<mmultiscripts>
  <mi mathvariant="normal">Ω</mi>
  <mn>3</mn>
  <mn>4</mn>
  <mprescripts/>
  <mn>1</mn>
  <mn>2</mn>
</mmultiscripts>

Then e.g. a screen reader like Orca will correctly read the sub/sup/presup/presub/under/over scripts.

Alternatively, we could add support for the \prescript command from the mathtools package (http://ctan.org/pkg/mathtools), but this will still not work well if people use the "empty base" hack:

\prescript{A}{B}{C}^{D}_{E}
Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptJan 22 2016, 11:07 PM
Pkra moved this task from Incoming to Mathoid on the Math board.