Forum


Replies: 13   Views: 3951
Add mathequation with bold-itlatic not working
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by 243127387@qq.com  · 12-10-2015 - 07:46

Hi :

    I have bought the Version pro 5.0

    when add MathEquation with bold-itlatic,  In the generated word by office2013, can't  display properly; but in office 2007 , it can display properly , I don't  know reason. According to the code is as follows:

$docx->addText('We write a math equation using MathMML:');

$mathML = '<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML">
    <mml:mrow>
        <mml:mi mathvariant= "bold-italic">x</mml:mi>
        <mml:mi >y</mml:mi>
    </mml:mrow>
</mml:math>';

$docx->addMathEquation($mathML, 'mathml');

 

Looking forward to the reply, thank you!

Posted by 243127387@qq.com  · 12-10-2015 - 08:16

No one encountered this problem?

Posted by 243127387@qq.com  · 13-10-2015 - 05:43

Any other ideas?

Posted by admin  · 13-10-2015 - 07:44

Hello,

We have dome some tests. The MathML to the Word format is done through a XSL file, so you need to use the correct input; for example instead of mi tags, use mn ones.

Phpdocx replaces automatically these tags, but only if they don't have attributes, so maybe you have removed that lines of the code.

This example works perfectly with MS Office 2013:

$mathML = '
<math xmlns="http://www.w3.org/1998/Math/MathML">
    <mrow>
        <mn mathvariant="bold-italic">x</mn>
        <mn>y</mn>
    </mrow>
</math>';

$docx->addMathEquation($mathML, 'mathml');

Regards.

Posted by 243127387@qq.com  · 13-10-2015 - 11:01

Thank you very much for your reply!  admin.

     In MS 2013 is normal, but MS 2007 not working. You can test on MS 2003 or 2007? Thank you very much!

$mathML = '
<math xmlns="http://www.w3.org/1998/Math/MathML">
    <mrow>
        <mn mathvariant="bold-italic">x</mn>
        <mn>y</mn>
    </mrow>
</math>';

$docx->addMathEquation($mathML, 'mathml');

  In the above code to run results, x display is abnormal, y display is normal in ms word 2007.

Posted by 243127387@qq.com  · 14-10-2015 - 05:48

If need to install a plug-in in MS office2003 or 2007 to display a mathematical formula with bold-itlatic ?

Posted by admin  · 14-10-2015 - 08:50

Hello,

Have you tried other styles such as bold? This is without mixing styles to check it it works.

MS Word 2003 has limit support of DOCX documents.

Regards.

Posted by 243127387@qq.com  · 14-10-2015 - 09:18

I try bold alonely. I also try itlatic alonely. It still can't display properly in MS 2003 or 2007.

Our company's app is about to online, it is a big problem about MathEquation's bold or itlatic, because our company's users of  80% use  the MS office 2007 or 2003. Really need your help.

Posted by admin  · 14-10-2015 - 09:34

Hello,

We're doing some tests.

Regards.

Posted by 243127387@qq.com  · 14-10-2015 - 14:24

Thank you very much, Looking forward to your reply.

Posted by 243127387@qq.com  · 15-10-2015 - 12:17

Have the news about the bold-itlatic question  in word 2007?

Posted by admin  · 16-10-2015 - 08:29

Hello,

The problem comes from the styles used. For some styles, such as bold-italic, MS Word 2007 needs to use a specific font (Cambria Math).

To solve it with MS Word 2007 you can set a default font or force it in the MathML.

Regards.

Posted by 243127387@qq.com  · 16-10-2015 - 15:20

force it in the MathML?  I don't understand. Thank you for your reply.admin.

Posted by 243127387@qq.com  · 17-10-2015 - 00:55

Admin, you really helped a lot in our company, I am a company's technical staff, by setting the default font, problem solved, thank you very much.