Closed xu756 closed 1 year ago
I have spent more than 10 hours finding solution for this. I have not found the answer untill now
Read the documentation here, it should give you a good idea:
Already I have read it. What I have understood from this documentation is math object useful if you know the math equations and you want to write it manually. What if I want to use the code to write different equations to the document that I don't know how they are? In my case i have different math equations in data base saved in latex format, I want to write them to the word document programmatically. How can I use math object to implement this, while I don't know if the equation will have radical or square e.t.c I have tried different approach, I tried to convert those latex equations into MathML and paste into word document manually I have found that equations are rendered correctly ,But I have not found the way to pass MathML to the document via docx library
Not in scope I am afraid, it would require creating a Latex tokeniser and parser, and then a way to convert that MathML AST into json. It would be possible, if there is an NPM package which turns MathML into JSON, but out of scope of this project.
Thanks for your response. So what is work round for this? Should I convert those equations into images and then imbed the to the document?
That can be a workaround yes. Would be cool if you could release this work around as an npm package too!
I wrote a tool to do that https://github.com/seewo-doc/docx-math-converter
I wrote a tool to do that https://github.com/seewo-doc/docx-math-converter
great
I wrote a tool to do that https://github.com/seewo-doc/docx-math-converter
This is awesome! I may integrate this into docx once I get time
Great library。
like this
new MathRun('c = \\pm\\sqrt{a^2 + b^2}')
I want
How can I do it?