dolanmiu / docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
https://docx.js.org/
MIT License
4.45k stars 486 forks source link

Insert Math with Mathml or latex #2842

Open king-jam1 opened 1 week ago

king-jam1 commented 1 week ago

I hope that the input of mathematical formulas and symbols can support the use of LaTeX or MathML, which is more compatible. Of course, existing methods can also be retained for coexistence latexlive this website can export word. Looking forward to your answer. Snipaste_2024-11-13_09-31-14 Snipaste_2024-11-13_09-32-16

dolanmiu commented 1 week ago

Yes, this is possible,

Is this what you need?

https://docx.js.org/#/usage/math

king-jam1 commented 4 days ago

Yes, this is possible,

Is this what you need?

https://docx.js.org/#/usage/math

I have reviewed the document you provided, but it is very inconvenient. For generating complex mathematical formulas, I would prefer to use LaTeX or MathML directly, and docx supports this approach. If the functionality hasn't been available yet, I really hope you can give me some advice on how to add such a feature on top of docx.

dolanmiu commented 3 days ago

That would require writing a parser/ast generator though. Are there any parsers available? I am sure this is not a trivial project