Prepping Math for Export

Search this space

Please contact eXtyles Support if you have questions about export of math from your documents.

In this section

Example

Equations should be formatted using MathType, another add-in to MS Word. However, they can also be formatted as plain text (e.g., a + b = c), but note that this does not allow for the correct formatting of complex formulas (see the examples further on) and results in less rich XML.

For example, this MathType equation (in a paragraph styled as Equation):

Screenshot of the equation the square root of a-squared plus b-squared (tab arrow) (2)

when exported produces the following MathML:

<disp-formula id="formula_2"><mml:math 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>(2)</label></disp-formula>

The values of the <mml:math> id attribute are allocated sequentially on export and do not necessarily correspond to any equation number used in the text (if, in this example, the equation had been typed from the keyboard, so that equation 2 was the first MathType object in the document).

Values of the <disp-formula> id attribute are based on the equation numbers. No <disp-formula> id values are generated for unnumbered equations.

For more information about MathType, see https://docs.wiris.com/en/mathtype/start.

Problems with Math in XML

Commonly encountered problems with the correct export of math include the following:

Equations Are Not Actually Math Objects

If equations have been inserted into the text as objects (e.g., as pictures) other than those listed previously (e.g., MathType), they will not be exported as math.

If pictures are used for math, they will be exported as inline graphics or if another format is used they may be dropped entirely from the XML file.

A common reason for equations appearing as images in the Word file is: a Word 2007/2010 DOCX file containing Word Equation Builder objects has been saved as a Word 2003 DOC file. Because Equation Builder is not backward compatible with Word 2003, the equations are saved as images instead.

To avoid this problem, Equation Builder objects should be converted to MathType equations using the Convert Equations function on the MathType ribbon before saving the file to DOC format from DOCX.

Screenshot of the MathType 'Convert Equations' dialog box. Under 'Equation types to convert,' all options are checked including 'Word 2007 and later (OMML) equations. The Range is for the whole document. The section 'Convert equations to' has the option 'MathType equations (OLE objects)' chosen.

“Word 2007 and later (OMML) equations” must be selected under “Equation types to convert,” and “Convert equations to” must be set to “MathType equations (OLE objects).”

If an author has saved a file containing Equation Builder math as a DOC file without first converting the equations, these equations may be recovered by re-saving the file in DOCX format using Word 2007 or 2010 (Microsoft calls this process “rehydration”). After resaving the file, you should reconfirm that the equations are now editable Equation Builder objects. At this stage, we recommend you convert the equations to MathType using the instructions given earlier.

 

The Equation Number Is Included as Part of the Equation

eXtyles will automatically parse numbered equation paragraphs, enabling linking of equation citations and generating correct XML.

However, this functionality is not available if the equation numbers have been added as part of the equation object itself.

The equation numbers must be removed from the equation objects and added as text to the paragraph containing the equation (see the above example).

 

Equation Images Are Not Exported

The eXtyles NISO STS XML export does not generate <graphic> pointers to image files for math during XML export. Because of this, if your workflow requires images of the math, the images must be exported manually from the MathType ribbon in Word using the Export Equations function.

 

Notes about Equation Builder Math

Microsoft Equation Builder math cannot be exported as image files; these equations can only be exported as MathML.

Microsoft’s MathML is not the same as the MathML produced by MathType.

Should you choose to keep equations in Equation Builder format, be advised that Microsoft makes extensive use of Plane 1 Unicode in Equation Builder; many applications that render MathML do not have full support for Plane 1 Unicode, and end-user systems viewing MathML may not have font sets that include Plane 1 Unicode.

Copyright © 2022 Atypon Systems, LLC. All Rights Reserved.