Using Aspose.Slides for Java, I am writing a tool to convert fragments of HTML into slides. One issue I am struggling with is the conversion the MathML. I am currently using MathRadical, MathFraction etc for conversion. This proves to be very time consuming as there are many MathML tags and they don’t fit neatly into the Aspose.Slides math model.

I am wondering:

Is there a way to import MathML XML into an Aspose.Slides object?

If not, using the XSLT script included in MS office distribution, I can convert MathML into OfficeMath. Is there a way to import an OfficeMath XML into an Aspose.Slides object?

If none of the above works, is there another way to achieve my goal?

@fzeng2012,
Thank you for contacting support and for your questions.

It looks like Aspose.Slides does not provide the features you requested yet. Could you please share some sample data or files that you would like to import into PowerPoint presentations? We will then plan to implement features for your purposes shortly.

While waiting for possible future enhancements from Aspose, I am writing code to convert MathML to PowerPoint equation. In the APIs in Aspose.Slides, I found partial support for the attributes in MathML tag menclose. Details for the tag can be found at Presentation Markup.

I was able to implement “left” , “right” , “top” , “bottom” and “box” and a few "strike"s, how I did not find anything in Aspose for the default “longdiv”, and “roundedbox” and “circle” and a few others.

@fzeng2012,
I’ve added a ticket with ID SLIDESJAVA-38946 to our issue tracking system. Our development team will consider importing MathML equations from HTML documents. We will inform you of any progress.

Unfortunately, I have not found such a feature. Could you please also share sample data?

The following produces a letter “a” in a square box with open top, as shown in the image. However MathBorderBox does not seem to support a circle or a phasorangle.

MathBorderBox mathBorderBox = new MathBorderBox(new MathematicalText("a"));
mathBorderBox.setHideTop(true);

@fzeng2012,
Thank you for the additional information. I’ve added a ticket with ID SLIDESJAVA-38947 to our issue-tracking system. Our developers will consider implementing the remaining features you specified in the menclose element. You will be notified when a new release of Aspose.Slides with a fix is published.

@fzeng2012,
Our development team has considered using of enclose expressions like “menclose” from MathML. To work with mathematical expressions, PowerPoint uses OMML, which is similar to MathML, but with a number of differences. Unfortunately, OOML has no analogs for “menclose”. You can verify this for yourself by trying to create a similar element using PowerPoint.

The issues you found earlier (filed as SLIDESJAVA-38946) have been fixed in Aspose.Slides for Java 23.1 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.

Is the issue resolved or still struggling?
I have done a little bit of research on it and I found this answer…It does not natively support importing MathML equations into a MathPortion. However, you may be able to convert a MathML equation to a different format (such as a PNG image) and then insert that image into a slide using Aspose.Slides. Alternatively, you can convert MathML to a vector format like SVG and then insert it in the slide as an image.

Because PowerPoint is not a flow document format, it is hard to mix images with text. Math formulas in images can not be part of normal paragraphs. While your suggestions will work in many situations, it does not work for my use case.

I will to test the new release Aspose.Slides for Java 23.1.

I tried out release 23.1 and got mixed results for my use cases.

On the one hand it handles fractions (mfrac), radicals (mroot) and summations (munderover) very well.

On the other hand it does not render arrows(mover + →) and harpoons (mover + ⇀) well. It does not do boxes (menclose) well either. It does not handle delimiters at all (mfenced).

I am attaching the following in a zip file for your reference:

inputMath.xml: MathML fragments. You may view the rendered formula using https://codepen.io/bqlou/pen/yOgbmb
Htmlmport.pptx: PPT generated with IParagraphCollection.addFromHtml(String)
MathApi: PPT generated with the math APIs provided in Aspose.Slides.