Skip to content

office Open xml: shared_math #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

office Open xml: shared_math #209

wants to merge 5 commits into from

Conversation

IuryAlves
Copy link
Contributor

Hi, I spent some time writing the tags that is used with equations. This is not complete yet, but maybe is a good start to create a docx to latex exporter.

I also noticed that there is a issue (#49) to enable equations, but it is stopped for a long time. I would like to continue contributing to make this possible.

@winhamwr
Copy link
Contributor

Hello iury,

Thanks for the PR! We would love to have support for equations.

Would you be willing to implement at least some of these models in an exporter (preferably HTML), or perhaps write a separate exporter that adds support for these? We'd also love to have some basic smoke tests covering a .docx file with a mix of math and normal content, along with some XML tests covering all of the added models. It doesn't need to cover all of the corner cases or achieve full coverage, but in order to maintain this going forward, we need at least "happy path" coverage.

Thanks again!
-Wes

@IuryAlves
Copy link
Contributor Author

@winhamwr sure. I will do it.

@IuryAlves
Copy link
Contributor Author

@winhamwr Sorry for the delay. I've come to realize that there are many cyclic import issues in my pull request. For example:

<m:acc>
  <m:e>
    <m:acc/>
  </m:e>
</m:acc>

This becomes the following:

# accent.py
from pydocx.openxml.shared_math.element import Element
# element.py
from pydocx.openxml.shared_math.accent import Accent

I am wondering what is the best solution for this problem.

@winhamwr
Copy link
Contributor

@IuryAlves you can use a string to avoid the circular import, kind of like with Django's model syntax. here is an example.

@IuryAlves
Copy link
Contributor Author

Thanks @winhamwr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants