Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Dec 13, 2021 5:31 pm

Hi.Can you help me. How do i use cyrillic language in formula.

Code: Select all
    public void firstFormula(String t,double t1,String t3){
    Paragraph paragraph = section.addParagraph();
    String[] latexMathCode = {
            "\\sigma_{"+"раст"+"}= ",
            "\\sigma_{ekv}",
            "\\cdot",
            "n_{\\sigma}",
            " = "+t+
                    "\\cdot"+ t1," = "+t3
    };

    OfficeMath officeMath;
    for (int i = 0; i < latexMathCode.length; i++) {
        officeMath = new OfficeMath(document);
        officeMath.fromLatexMathCode(latexMathCode[i]);
        paragraph.getItems().add(officeMath);

    }
}


index in document is now "xxxx", but should be "раст"

biskvitka
 
Posts: 8
Joined: Thu Sep 10, 2020 5:47 pm

Tue Dec 14, 2021 1:39 am

Hello,

Thanks for your inquiry!

I tested your code with the latest Spire.Doc for java version 4.12.1, but did not reproduce your issue, the "раст" can normally display. Here I attached the file I generated.

addformula.png

If you are not using the latest version of Spire.Doc for java, I recommend that you can try it first. And please make sure that your system environment has font "Cambria Math" installed.

If the issue still exists, please provide us with the following information for further investigate. Thanks in advance.
1. Your system information (E.g. Win7, 64 bit) and region setting (E.g. China, Chinese)
2. The java version you were using (E.g. 1.8.0_271).

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Dec 14, 2021 4:38 pm

I changed spire.office on spire.doc last version and It helped me. My problem is solved. Thank you!

biskvitka
 
Posts: 8
Joined: Thu Sep 10, 2020 5:47 pm

Wed Dec 15, 2021 1:30 am

Hello,

Thanks for your feedback!

Glad to hear that your issue has been solved.

If you encounter any issues related to our product in the future, just feel free to contact us.

Have a nice day!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Doc

cron