• <menu id="w2i4a"></menu>
  • logo E-iceblue中文文檔

    文檔首頁>>E-iceblue中文文檔>>將數(shù)學(xué)方程式和符號(hào)插入 Word 文檔

    將數(shù)學(xué)方程式和符號(hào)插入 Word 文檔


    從 7.6.5 版本開始,Spire.Doc 支持將 Latex 數(shù)學(xué)代碼添加到 C# 中的 Word 文檔中。本文將向您展示如何將 Latex 數(shù)學(xué)符號(hào)和方程式添加到 Word 文檔中。

    Spire.Doc for.NET 最新下載

    展示代碼:

    using Spire.Doc;
    using Spire.Doc.Documents;
    using System;
    namespace InsertMath;
    
    class Program
    {
    
    static void Main(string[] args)
    {
    //create a word document
    Document doc = new Document();
    
    //add a section
    Section section = doc.AddSection();
    
    //add a paragraph to the section
    Paragraph paragraph = section.AddParagraph();
    
    //add a LatexMathcode to the first paragraph
    OfficeMath officeMath = new OfficeMath(doc);
    paragraph.Items.Add(officeMath);
    officeMath.FromLatexMathCode("x^{2}+\\sqrt{x^{2}+1}=2");
    
    //add equation to the second paragraph
    Paragraph 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 paragraph
    Paragraph 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 file
    doc.SaveToFile("Equation.docx", FileFormat.Docx);
    System.Diagnostics.Process.Start("Equation.docx");
    }
    }
    }

    將latex數(shù)學(xué)代碼和符號(hào)添加到word文檔后的有效截圖:

    Add checkbox and picture content control to word document in C#


    歡迎下載|體驗(yàn)更多E-iceblue產(chǎn)品

    如需獲取更多產(chǎn)品相關(guān)信息請(qǐng)咨詢慧都在線客服  


    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();