MathFont class

Office 2013 and later

Math Font. When the object is serialized out as xml, its qualified name is m:mathFont.

Namespace:  DocumentFormat.OpenXml.Math
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public class MathFont : OpenXmlLeafElement

[ISO/IEC 29500-1 1st Edition]

mathFont (Math Font)

This element specifies the default math font to be used in the document. If this element is omitted, font substitution (§17.8.2) should be used to determine the most appropriate font for use throughout the document. [Example: The XML containing this property is:

  <m:mathFont m:val="Cambria Math"/>
  <m:brkBin m:val="before"/>
  <m:brkBinSub m:val="--"/>
  <m:smallFrac m:val="0"/>
  <m:lMargin m:val="1440"/>
  <m:rMargin m:val="0"/>
  <m:defJc m:val="centerGroup"/>
  <m:wrapIndent m:val="1440"/>
  <m:intLim m:val="subSup"/>
  <m:naryLim m:val="undOvr"/>

end example]


Given the following equation:

and the following XML:

<m:mathFont m:val="Cambria Math"/>

Because the document option for Math font is set to the mathematically enabled font Cambria Math, Math is formatted with that font.

end example]

Parent Elements

mathPr (§



val (value)

Specifies the default math font to be used in the document.

The possible values for this attribute are defined by the ST_String simple type (§

[Note: The W3C XML Schema definition of this element’s content model (CT_String) is located in §A.6.1. end note]

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.