OfficeMathJustification Property

Gets/sets Office Math justification.

Namespace:  Aspose.Words.Math
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.6.0

ExpandedSyntax

public OfficeMathJustification Justification { get; set; }

Property Value

Type: OfficeMathJustification

ExpandedRemarks

Justification cannot be set to the Office Math with display format type Inline.

Inline justification cannot be set to the Office Math with display format type Display.

Corresponding DisplayType has to be set before setting Office Math justification.

ExpandedExamples

Shows how to set office math display formatting.
Document doc = new Document(MyDir + "Office math.docx");

OfficeMath officeMath = (OfficeMath) doc.GetChild(NodeType.OfficeMath, 0, true);

// OfficeMath nodes that are children of other OfficeMath nodes are always inline.
// The node we are working with is the base node to change its location and display type.
Assert.AreEqual(MathObjectType.OMathPara, officeMath.MathObjectType);
Assert.AreEqual(NodeType.OfficeMath, officeMath.NodeType);
Assert.AreEqual(officeMath.ParentNode, officeMath.ParentParagraph);

// OOXML and WML formats use the "EquationXmlEncoding" property.
Assert.IsNull(officeMath.EquationXmlEncoding);

// Change the location and display type of the OfficeMath node.
officeMath.DisplayType = OfficeMathDisplayType.Display;
officeMath.Justification = OfficeMathJustification.Left;

doc.Save(ArtifactsDir + "Shape.OfficeMath.docx");

ExpandedSee Also