Forum


Replies: 5   Views: 3060
How to increase the font size of mathml in addmathequation and mathml alignment
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 admin  · 12-05-2017 - 07:05

Hello,

Sorry but there's no trial of the DOCXPath functionality, as it's only available in Advanced and Premium licenses.

This is a simple sample about how to set left alignment in equations using DOCXPath:

<?php

require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$mathML = '<math xmlns="http://www.w3.org/1998/Math/MathML">
        <mrow>
                <mi>A</mi> 
                <mo>=</mo>
                <mfenced open="[" close="]">
                        <mtable>
                                <mtr>
                                        <mtd>
                                                <mi>x</mi>
                                        </mtd> 
                                        <mtd>
                                                <mn>2</mn>
                                        </mtd>
                                </mtr>
                                <mtr>
                                        <mtd>
                                                <mn>3</mn>
                                        </mtd>
                                        <mtd>
                                                <mi>w</mi>
                                        </mtd>
                                </mtr>
                        </mtable>
                </mfenced>
        </mrow>
</math>';

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

$wordML = new WordFragment($docx);
$wordML->addWordML('<m:oMathParaPr><m:jc m:val="left"/></m:oMathParaPr>');

$referenceNode = array(
        'customQuery' => '//m:oMathPara/m:oMath',
);

$docx->insertWordFragment($wordML, $referenceNode, 'before');

$docx->createDocx('output');

Although you can accomplish it using DOCXPath as this script illustrates, after you have purchased an Advanced or Premium license please send us an email to contact[at]phpdocx.com, and we'll generate a patch to be able to set alignment using a new option with addMathEquation.

Regards.