Site icon Colecandoo!

Using InDesign’s MathML – Real World Situation

About to try InDesign's MathML for the first time? Just know that it isn't a Microsoft Word Equation converter, but it will do what you want.

Advertisements

A new feature in the 2025 release of Adobe InDesign is the Insert MathML dialog.

As a person that formats mathematics, chemistry and physics titles from time to time, this feature piqued my interest.

How equations have been handled so far

If you’re a designer with plenty of experience in composing layout that contains many equations, you will most likely be familiar with a solution such as LaTeX. However, I would argue that most readers will encounter equations when taking in content from a more popular source, such as Microsoft Word.

Let’s take this equation from Microsoft Word for example.

I’d like to import it into InDesign as a graphic. If I make a new text frame in InDesign and import the Word file, will it import?

No. Instead, a single space character has imported.

What if I copy the formula from Microsoft Word and paste it into InDesign?

Looks like it is working, but I notice it’s embedded. I can unembed the formula by clicking on the link in the links palette and selecting Unembed Link and then saving it locally.

With an actual file, I can now open this in Illustrator to make edits. Unfortunately, I’m now greeted with this mess:

How the new dialog works

So far, usual methods of image extraction out of Microsoft Word haven’t worked to import this equation. Time to use the new Insert MathML feature – a dialog to import a specific markup code of math formulae known as MathML.

There’s just one problem… to start with

So how do we get this from the Microsoft Word equation?

If I highlight the formula in Word, copy it and then paste that into the Insert MathML dialog, is that all I need to do?

Nothing copies in. If I copy the formula in Word, copy it into BB edit, copy the new content from BB edit and then paste that into the Insert MathML dialog, will that work?

No, instead I get the error message “Invalid XML structure”.

This formatting isn’t MathML – that formatting looks more like XML which is like HTML, that is, has lots of start and stop tags with endless amounts of angle brackets and backslashes. After looking for about ten minutes through Microsoft Word’s countless preferences and options, I stumbled onto Format, Equation Options…

This then presents a dialog box where I can select the radio button Copy MathML to the clipboard as plain text, and then click OK.

Even after doing this, I still can’t copy the equation from Word into InDesign’s dialog directly, I have to copy it via BBedit…

The dialog is picky about its code

Even still, I have Invalid XML structure. Looks like the user interface is really picky about the code being 100% clean with no errors at all.

Looking at the code, there are a series of mml: letters that shouldn’t be there. If I clear them, does it work?

No, it still says I have Invalid XML structure.

If I go to a website that lets me copy and paste this amended XML into its UI however, it works!

Perhaps Word (or the author of the formula) included some illegal characters. If I make a new xml file in Visual Code Studio and paste the code from BBedit, I can now see yellow squares indicating illegal characters.

If I remove them and then import them into the Insert MathML feature, does it work?

YES, finally!

The fun isn’t over yet

Trouble is, it is using Cambria Math MathJax TeX, and I’d like to set the type in red. Unfortunately, this is where several pain-points that are mission critical present themselves:

These issues have been raised over at CreativePro and I strongly urge you to read their article. I’d also encourage you to add your vote to the InDesign Uservoice to have these two pain-points addressed.

But this is only one formula – If I’m reformatting an entire senior high school physics title, I’m in for a rough ride!

The dialog wasn’t intended as a converter

So this example looks at the use-case of extracting a Microsoft Word equation and importing it into InDesign via the MathML route. However, the intention of the Insert MathML is to use a dedicated equation editing application that can export reilable MathML that can then be imported into InDesign. Take the following example of respiration that was set using the website iMathEQ and then exported using the SetMathML button and imported through the Insert MathML dialog.

Tidy in Illustrator in the meantime?

Once it is InDesign, I can copy the equation and paste it over in Adobe Illustrator to change its color and export as an .ai file as a workaround until the colour issue is resolved. What I can’t do in Illustrator is edit the equation using my text cursor – the equation is now outlines.

It is not – and does not – replace LaTeX

As I mentioned earlier in the article, if you’re a designer with plenty of experience in composing layout that contains many equations, you will most likely be familiar with a solution such as LaTeX. This is certainly not a replacement for LaTeX.

My thoughts?

I’m glad that the InDesign developers answered the call of over 600 uservoices that were requesting this feature, and implemented the dialog in the 2025 release of Adobe InDesign. That said, I cannot call this dialog complete as it has the pain-points that still need to be addressed before I’d truly call it a function that I’d use, such as:

One last suggestion that I’d make is if I need to edit the MathML in InDesign and I need the code, instead of the “learn more…” hyperlink on the bottom left of the dialog, there was an option to take me to a MathML editor of Adobe’s choice that I could click on so I could then edit the formula in a WYSIWYG environment rather than a code environment.

Exit mobile version