Aspose::Words::Math::OfficeMathJustification enum

OfficeMathJustification enum

Specifies the justification of the equation.

enum class OfficeMathJustification : int

Values

NameValueDescription
Center2Centers each instance of mathematical text individually with respect to margins.
CenterGroup1Justifies instances of mathematical text to the left with respect to each other, and centers the group of mathematical text (the Math Paragraph) with respect to the page.
Default1Default value CenterGroup.
Inline7Inline position of Math.
Left3Left justification of Math Paragraph.
Right4Right Justification of Math Paragraph.

Examples

Shows how to set office math display formatting.

auto doc = System::MakeObject<Aspose::Words::Document>(System::String(get_MyDir() + u"Office math.docx"));

auto officeMath = System::ExplicitCast<Aspose::Words::Math::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_EQ(officeMath->get_MathObjectType(), MathObjectType::OMathPara);
ASSERT_EQ(officeMath->get_NodeType(), NodeType::OfficeMath);
ASPOSE_ASSERT_EQ(officeMath->get_ParentParagraph(), officeMath->get_ParentNode());

// Change the location and display type of the OfficeMath node.
officeMath->set_DisplayType(OfficeMathDisplayType::Display);
officeMath->set_Justification(OfficeMathJustification::Left);

doc->Save(get_ArtifactsDir() + u"Shape.OfficeMath.docx");

See Also