Skip to content
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

feat: translate equations to latex when running MSWord backend #825

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

rateixei
Copy link

At the moment, equations present in MSWord documents are not exported. This PR translates the MSWord equations to latex and includes it in the text output. New test files have been added to test this feature.

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Copy link

mergify bot commented Jan 28, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Require two reviewer for test updates

This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@rateixei rateixei changed the title Feat: Translate equations to latex when running MSWord backend feat: translate equations to latex when running MSWord backend Jan 28, 2025
Signed-off-by: Rafael Teixeira de Lima <[email protected]>
Signed-off-by: Rafael Teixeira de Lima <[email protected]>
Signed-off-by: Rafael Teixeira de Lima <[email protected]>
Signed-off-by: Rafael Teixeira de Lima <[email protected]>
Signed-off-by: Rafael Teixeira de Lima <[email protected]>
Copy link
Contributor

@PeterStaar-IBM PeterStaar-IBM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -291,7 +312,6 @@ def handle_text_elements(self, element, docx_obj, doc):
doc.add_text(
label=DocItemLabel.PARAGRAPH, parent=self.parents[level - 1], text=text
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline equation will default to Text (DocItemLabel.TEXT), while seperate equations need to be marked as DocItemLabel.EQUATION .

Signed-off-by: Rafael Teixeira de Lima <[email protected]>
Signed-off-by: Rafael Teixeira de Lima <[email protected]>
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