OfficeMathJustification enumeration

OfficeMathJustification enumeration

Specifies the justification of the equation.

Members

NameDescription
CENTER_GROUPJustifies 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.
CENTERCenters each instance of mathematical text individually with respect to margins.
LEFTLeft justification of Math Paragraph.
RIGHTRight Justification of Math Paragraph.
INLINEInline position of Math.
DEFAULTDefault value OfficeMathJustification.CENTER_GROUP.

Examples

Shows how to set office math display formatting.

doc = aw.Document(file_name=MY_DIR + 'Office math.docx')
office_math = doc.get_child(aw.NodeType.OFFICE_MATH, 0, True).as_office_math()
# 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.
self.assertEqual(aw.math.MathObjectType.O_MATH_PARA, office_math.math_object_type)
self.assertEqual(aw.NodeType.OFFICE_MATH, office_math.node_type)
self.assertEqual(office_math.parent_node, office_math.parent_paragraph)
# Change the location and display type of the OfficeMath node.
office_math.display_type = aw.math.OfficeMathDisplayType.DISPLAY
office_math.justification = aw.math.OfficeMathJustification.LEFT
doc.save(file_name=ARTIFACTS_DIR + 'Shape.OfficeMath.docx')

See Also