0

Is there any way to generate word documents with equations and formulae using python? Now, I'm using python-docx to generate word documents. I have checked the documentation of python-docx but I didn't find anything related to formulae and equations.

I need to both extract formulae from the word document as well as generate a new word document with that extracted formulae.

Is it possible in python to extract equations from word document and store it in a database or something and then generate a word document with that formulae and equations???

Chemical equations

EDIT: I have attached some of the equations I need to extract/generate

rangarajan
  • 143
  • 5
  • 17

1 Answers1

1

Seems like python-docs does not support adding math equations since "there is currently no API support for equations" (GitHub issue).

aaossa
  • 3,763
  • 2
  • 21
  • 34
  • So, is there any other way to do it? like another library written in any other programming language? I was thinking about C#. – rangarajan Feb 20 '22 at 05:33
  • 1
    I'm not sure, but if I'm understanding the cited statement correctly, this is simply not possible because there's no interface for any program to interact with or create equations in Word – aaossa Feb 20 '22 at 05:37
  • 1
    An alternative could be to create the equation using a different library and export it as an image that you include in your document, but I'm not sure if that matches your expectations – aaossa Feb 20 '22 at 05:37
  • I have seen a software that allows the user to upload word documents with equations and extracts that equations and allows the user to edit or rearrange equations and then finally gives a new word document with equations with all the modifications. The extracted equations is extracted as a equation not as an image. – rangarajan Feb 20 '22 at 05:54
  • Does [this answer](https://stackoverflow.com/a/61031355/3281097) on another question help? – aaossa Feb 20 '22 at 05:59