在 OfficeMath 中工作
Contents
[
Hide
]
現在更方便使用 Office Math Type Objects 來工作。 在 Aspose.Words 中,用戶可以輕易地對齊並也可以管理一個方程式是否以內聯或分開一行來顯示。 “更重要的是,有了 MathObjectType 的可用性,可用的控制方式可以透過使用此矩阵物件來實現。”
以下程式碼範例說明了如何使用這些屬性:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_WorkingWithFields(); | |
Document doc = new Document(dataDir+ "MathEquations.docx"); | |
OfficeMath officeMath = (OfficeMath)doc.GetChild(NodeType.OfficeMath, 0, true); | |
// Gets/sets Office Math display format type which represents whether an equation is displayed inline with the text or displayed on its own line. | |
officeMath.DisplayType = OfficeMathDisplayType.Display; // or OfficeMathDisplayType.Inline | |
// Gets/sets Office Math justification. | |
officeMath.Justification = OfficeMathJustification.Left; // Left justification of Math Paragraph. | |
doc.Save(dataDir + "MathEquations_out.docx"); |