展示代码:
using Spire.Doc;using Spire.Doc.Documents;using System;namespace InsertMath;class Program{static void Main(string[] args){//create a word documentDocument doc = new Document();//add a sectionSection section = doc.AddSection();//add a paragraph to the sectionParagraph paragraph = section.AddParagraph();//add a LatexMathcode to the first paragraphOfficeMath officeMath = new OfficeMath(doc);paragraph.Items.Add(officeMath);officeMath.FromLatexMathCode("x^{2}+sqrt{x^{2}+1}=2");//add equation to the second paragraphParagraph paragraph2 = section.AddParagraph();OfficeMath officeMath1 = new OfficeMath(doc);paragraph2.Items.Add(officeMath1);officeMath1.FromLatexMathCode("forall x in X, quad exists y leq epsilon");//add symbols to the third paragraphParagraph paragraph3 = section.AddParagraph();OfficeMath officeMath2 = new OfficeMath(doc);paragraph3.Items.Add(officeMath2);officeMath2.FromLatexMathCode(" alpha,beta, gamma, Gamma, pi, Pi, phi, varphi, mu, Phi");//save the document to filedoc.SaveToFile("Equation.docx", FileFormat.Docx);System.Diagnostics.Process.Start("Equation.docx");}}}
将latex数学代码和符 添加到word文档后的有效截图:

欢迎下载|体验更多E-iceblue产品
如需获取更多产品相关信息请咨询在线客服

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!