We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Adding html content with latex equation in word document


We would like to add html content having latex equation into a word document. E.g. as follows :

({P_0} = \frac{{EP{S_0} \cdot \pi \cdot (1 + g)}}{{{k_E} - g}} = \frac{{\left( {1.5 \cdot 0.6} \right) \cdot \left( {1 + 0.235} \right)}}{{0.15 - 0.235}} = 28.10)

Is it supported by Aspose.Words?

Please guide us as to how this could be added to the word document. We tried using InsertHtml method of the DocumentBuilder class, but it adds the latex equation as text only. We want it to be displayed as a proper equation in the Word document.

Please help with the above.

Best Regards,

Isfsdc team
Hi there,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does.

Could you please attach valid input html which contains latex equation along with expected output Word document here for our reference? Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will then provide you more information on this along with code.

Hi Tahir,

Thanks for your reply.
The html content that we have pasted above is the latex format of a maths equation stored in the database
The latex format is :

\({P_0} = \frac{{EP{S_0} \cdot \pi \cdot (1 + g)}}{{{k_E} - g}} = \frac{{\left( {1.5 \cdot 0.6} \right) \cdot \left( {1 + 0.235} \right)}}{{0.15 - 0.235}} = 28.10\)

I am attaching a snapshot of the equation output as seen in the browser. Our requirement is to write this equation in a Word document. Is it possible using Aspose.Words ; please guide us as to how do we go about it.

Best Regards,
ISFSDC team.
Hi there,

Thanks for sharing the detail. OfficeMath class represents an Office Math object such as function, equation, matrix or alike. OfficeMath can contain child elements including runs of mathematical text, bookmarks, comments, other OfficeMath instances and some other nodes.

In this version of Aspose.Words, OfficeMath nodes do not provide public methods and properties to create or modify a OfficeMath object. In this version you are not able to instantiate Aspose.Words.Math nodes or modify existing except deleting them.

We had already logged a feature request as WORDSNET-6987 to create OfficeMath Object. You will be notified as soon as it is supported. We apologize for your inconvenience.