Open Bug 1670965 Opened 6 years ago Updated 3 years ago

Poor spacing with a bracket next to a roman letter then an italic one

Categories

(Core :: MathML, defect)

Firefox 81
defect

Tracking

()

People

(Reporter: quasicomputational, Unassigned)

Details

Attachments

(3 files)

Attached image expected.png —

Reproduction steps:

  1. View this input:
<!DOCTYPE html>
<meta charset=utf-8>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mrow>
      <mo stretchy="true" form="prefix">(</mo>
      <mi>z</mi>
      <mo stretchy="true" form="postfix">)</mo>
    </mrow>
    <mstyle mathvariant="normal">
      <mi>d</mi>
    </mstyle>
    <mi>z</mi>
  </mrow>
</math>

Expected behaviour: the 'dz' would be together, separate from the closing bracket, like expected.png. This is MathJax's and KaTeX's rendering of similar input.

Observed behaviour: the 'd' is together with the closing bracket, separate from the 'z', like observed.png.

Attached image observed.png —

I think the main problem here is the unnecessary space between "d" and "z". For the space between ")" and "d", you could add an <mspace> element:

<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mrow>
      <mo stretchy="true" form="prefix">(</mo>
      <mi>z</mi>
      <mo stretchy="true" form="postfix">)</mo>
    </mrow>
    <mspace width="0.2em" />                <!-- new -->
    <mi mathvariant="normal">d</mi>
    <mi>z</mi>
  </mrow>
</math>

I think that's an okay solution, but the unnecessary space between "d" and "z" seems like a clear bug to me.

Attached image with_manual_space.png —
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: