Setting up Math in Word

There are various different ways in which math can be presented in Word. This page looks at several of these methods and describes their implications for the XML generated by eXtyles NLM.

We recommend that all equations and other "math-like material" that cannot be typed from the keyboard should be created in Word using MathType from Wiris. MathType is a plug-in to Microsoft Word. It has a Convert Equations function that can be used to convert equations generated with either Microsoft Equation 3.0 (a stripped-down version of MathType licensed by Microsoft for inclusion in Word) or Microsoft Equation Builder (the new equation editor introduced in Word 2007).

The JATS DTD allows math to be encoded in a number of ways: as MathML, as a pointer to an image file, or as a combination of the two. How your eXtyles NLM export has been set up depends on the uses that are going to be made of your XML and the needs of any downstream partners such as compositors and online hosts. Equations created in MathType can be exported to either MathML or an image file, or both, depending on your precise configuration settings.


The examples highlight various aspects of how to set up math in Word in order to obtain the optimal XML. The examples are taken from the sample document: Sample_7_Math-setup.docx

Math Exported as MathML

This simple equation, set up in Word using MathType:

generates the following MathML when exported with eXtyles NLM using the export filter "eXtyles-JATS Journal Publishing XML 1.0 (MathML)":

JATS XML Example - MathType MathML
<disp-formula id="e1">
	<mml:math display="block" id="m1">
		<mml:mrow>
			<mml:msqrt>
				<mml:mrow>
					<mml:msup>
						<mml:mi>
							a
						</mml:mi>
						<mml:mn>
							2
						</mml:mn>
					</mml:msup>
					<mml:mo>
						+
					</mml:mo>
					<mml:msup>
						<mml:mi>
							b
						</mml:mi>
						<mml:mn>
							2
						</mml:mn>
					</mml:msup>
				</mml:mrow>
			</mml:msqrt>
		</mml:mrow>
	</mml:math>
	<label>
		(1)
	</label>
</disp-formula>

Math exported as images

If instead the same equation is exported using the export filter "eXtyles-JATS Journal Publishing XML 1.0 (math as graphics)", this XML is generated:

JATS XML Example - Math as image
<disp-formula id="e1">
<graphic position="anchor" xlink:href="1345-m1" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<label>(1)</label>
</disp-formula>

Under JATS 1.0 or later, it is also possible to use the <alternatives> element to include both MathML and a pointer to an image in the XML for each equation. This can be useful in situations where the required output depends on the rendering environment. Contact extyles-support@inera.com if you have questions about the handling of math in your exported XML.

Microsoft Equation Builder math

As well as MathType objects (and Microsoft Equation 3.0), eXtyles can also support math created using the Microsoft Equation Builder, introduced as the new default math-editing function in Word as of Word 2007. Equation Builder objects look like this:

While the Equation Builder does a nice job of displaying math in the Word environment, it is not as flexible as MathType when it comes to exporting math to XML. First, it may not yield the same MathML as MathType, as can be seen from this example:

JATS XML Example - Equation Builder MathML
<disp-formula id="e1___1">
	<mml:math id="m2">
		<mml:msqrt>
			<mml:msup>
				<mml:mrow>
					<mml:mi>
						a
					</mml:mi>
				</mml:mrow>
				<mml:mrow>
					<mml:mn>
						2
					</mml:mn>
				</mml:mrow>
			</mml:msup>
			<mml:mo>
				+
			</mml:mo>
			<mml:msup>
				<mml:mrow>
					<mml:mi>
						b
					</mml:mi>
				</mml:mrow>
				<mml:mrow>
					<mml:mn>
						2
					</mml:mn>
				</mml:mrow>
			</mml:msup>
		</mml:msqrt>
	</mml:math>
	<label>
		(1)
	</label>
</disp-formula>

The MathML from MathType and Equation Builder is generally similar, but, in this case, the order of nesting of the mml:mrow and mml:msup elements is different. While this particular difference is likely to be benign, these differences may have an impact on display.

Second, it is not possible to export images of Equation Builder math, meaning that workflows that require images of equations cannot easily accommodate Equation Builder math objects.

The eXtyles NLM Font Audit function will alert the user to the number of Equation Builder objects that appear in the file. You can then make business decisions about how to handle these equations. MathType has a Convert Equations function that will convert all OMML (Equation Builder) objects in the document to MathType equations.

© 2021 Atypon Systems. All Rights Reserved.

Icons made by Freepik from Flaticon are licensed under CC 3.0 BY