Forum Bugs

MathML: Rightarrow operand gets stretched as though it were a delimiter.

emperor
I am using Prince 10.1 on 64-bit Xubuntu LTS 14.02. (Previous versions also suffered from this bug.) From below picture it is obvious that the first four right double arrows are stretched in function of the height of the remainder of the equation.

The fifth and last arrow is placed within a <mtext> environment and is therefore not subject to scaling. This also seems to indicate that we are not dealing with a font issue.

Here is the MathML code of the topmost formula with stretched arrow.
Note that the arrow is not stretched when viewing the XHTML with a regular browser like Firefox.
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo>⇒</mo><mi>C</mi><mo>=</mo><mfrac><mrow><msubsup><mi>ω</mi><mn>2</mn><mn>2</mn></msubsup><mo>−</mo><msubsup><mi>ω</mi><mn>1</mn><mn>2</mn></msubsup></mrow><mrow><msub><mi>ω</mi><mn>1</mn></msub><msub><mi>ω</mi><mn>2</mn></msub><mrow><mo stretchy="true">(</mo><msub><mi>ω</mi><mn>1</mn></msub><msub><mi>X</mi><mn>2</mn></msub><mo>−</mo><msub><mi>ω</mi><mn>2</mn></msub><msub><mi>X</mi><mn>1</mn></msub><mo stretchy="true">)</mo></mrow></mrow></mfrac></mrow></math></p>


Workaround:
A workaround consists in placing the arrow in a <mtext> environment.
However, this is inconvenient and not really obvious.
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mrow><mtext mathvariant="normal">⇒ </mtext><mspace width="0.333em"></mspace></mrow><mi>L</mi><mo>=</mo><mfrac><mrow><msub><mi>ω</mi><mn>1</mn></msub><msub><mi>X</mi><mn>1</mn></msub><mo>+</mo><msub><mi>ω</mi><mn>2</mn></msub><msub><mi>X</mi><mn>2</mn></msub></mrow><mrow><msubsup><mi>ω</mi><mn>2</mn><mn>2</mn></msubsup><mo>−</mo><msubsup><mi>ω</mi><mn>1</mn><mn>2</mn></msubsup></mrow></mfrac></mrow></math></p>
mikeday
Very cute, looks like a spaceship, or a sideways house. :)

If you look in prince/math/operators.xml, there is a list of operators with options like the space around them and whether they are stretchy or not.

Confusingly, there are two rules for this arrow, as the &Implies; and &DoubleRightArrow; entities both apply to Unicode character U+21D2:

    <operator mo="&DoubleRightArrow;"
        form="infix" stretchy="true"
        lspace="thickmathspace" rspace="thickmathspace"/>

    <operator mo="&Implies;"
        form="infix" stretchy="true"
        lspace="thickmathspace" rspace="thickmathspace"/>


One of these rules can be deleted, and the remaining rule should have the stretchy="true" attribute removed. (We didn't actually make up this operator dictionary ourselves, it was taken from the MathML 2 specification, Operator Dictionary).

However, possibly we are interpreting the stretchy attribute incorrectly for infix operators, perhaps they are only supposed to stretch horizontally, eg. if they are combined with mover/munder?

Edited by mikeday

emperor
The symbol is best known under its presentational name &DoubleRightArrow;.
&Implies; would be its semantic name.

I agree with you that it should only stretch horizontally; for example when some expression, usually a condition, is placed above it.