-1

I have converted MathML code from Latex text, when I paste the code in word documents necessary spaces are not retained. Is there any way to fix the space issue. (You can just copy the MathML code and paste it in Ms Word)

The tag "<mspace/> completely ignored in Word Equation.

eg: <mspace width="2.3in" />

MS office version : 2010

I have tried to and some manual space but the output is awful.

<?xml version="1.0"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
    <mtr>
      <mtd>
        <mspace width="2.4in" />
        <mfrac>
          <mrow>
            <msup>
              <mi>d</mi>
              <mrow class="MJX-TeXAtom-ORD">
                <mn>2</mn>
              </mrow>
            </msup>
            <mi>y</mi>
          </mrow>
          <mrow>
            <mi>d</mi>
            <msup>
              <mi>x</mi>
              <mrow class="MJX-TeXAtom-ORD">
                <mn>2</mn>
              </mrow>
            </msup>
          </mrow>
        </mfrac>
        <mo>+</mo>
        <mi>y</mi>
        <mo>=</mo>
        <mn>0</mn>
        <mspace width="2.3in" />
        <mo stretchy="false">(</mo>
        <mn>1.2.1</mn>
        <mo stretchy="false">)</mo>
      </mtd>
    </mtr>
  </mtable>
</math>

Actual Output: █((d^2 y)/(dx^2 ) + y=0(1.2.1))

Required Output: █((d^2 y)/(dx^2 ) + y=0<some space here>(1.2.1))

Jason
  • 65
  • 7

1 Answers1

0

I tried to transform the Mathml code to MML2OMML.XSL which is Open-Xml style sheet using "XslCompiledTransform", but the <mspace> spacing are not retained.

So I used a temporary fix by adding spaces in the <mspace> tag's next sibling using the entity (&#160;), multiplying the mspace width with value '25' i can get the space count.

The output is good.

Jason
  • 65
  • 7