com.aspose.words

Class OfficeMathJustification

  • java.lang.Object
    • com.aspose.words.OfficeMathJustification
public class OfficeMathJustification 
extends java.lang.Object

Utility class containing constants. Specifies the justification of the equation.

Example:

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

OfficeMath officeMath = (OfficeMath) doc.getChild(NodeType.OFFICE_MATH, 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.assertEquals(MathObjectType.O_MATH_PARA, officeMath.getMathObjectType());
Assert.assertEquals(NodeType.OFFICE_MATH, officeMath.getNodeType());
Assert.assertEquals(officeMath.getParentNode(), officeMath.getParentParagraph());

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

// Change the location and display type of the OfficeMath node.
officeMath.setDisplayType(OfficeMathDisplayType.DISPLAY);
officeMath.setJustification(OfficeMathJustification.LEFT);

doc.save(getArtifactsDir() + "Shape.OfficeMath.docx");

Field Summary
static final intCENTER_GROUP = 1
Justifies 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.
static final intCENTER = 2
Centers each instance of mathematical text individually with respect to margins.
static final intLEFT = 3
Left justification of Math Paragraph.
static final intRIGHT = 4
Right Justification of Math Paragraph.
static final intINLINE = 7
Inline position of Math.
static final intDEFAULT = 1
Default value CENTER_GROUP.
 

    • Field Detail

      • CENTER_GROUP = 1

        public static final int CENTER_GROUP
        Justifies 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.
      • CENTER = 2

        public static final int CENTER
        Centers each instance of mathematical text individually with respect to margins.
      • LEFT = 3

        public static final int LEFT
        Left justification of Math Paragraph.
      • RIGHT = 4

        public static final int RIGHT
        Right Justification of Math Paragraph.
      • INLINE = 7

        public static final int INLINE
        Inline position of Math.
      • DEFAULT = 1

        public static final int DEFAULT
        Default value CENTER_GROUP.