public class OfficeMathJustification
Example:
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 a base node, so its location and display type can be changed
Assert.assertEquals(officeMath.getMathObjectType(), MathObjectType.O_MATH_PARA);
Assert.assertEquals(officeMath.getNodeType(), NodeType.OFFICE_MATH);
Assert.assertEquals(officeMath.getParentParagraph(), officeMath.getParentNode());
// Used by OOXML and WML formats
Assert.assertNull(officeMath.getEquationXmlEncoding());
// We can 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 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.
|
||
static final int | CENTER | |
Centers each instance of mathematical text individually with respect to margins.
|
||
static final int | LEFT | |
Left justification of Math Paragraph.
|
||
static final int | RIGHT | |
Right Justification of Math Paragraph.
|
||
static final int | INLINE | |
Inline position of Math.
|
||
static final int | DEFAULT | |
Default value |
public static final int CENTER_GROUP
public static final int CENTER
public static final int LEFT
public static final int RIGHT
public static final int INLINE
public static final int DEFAULT