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

🧮 Use katex for mathml rendering in jats #507

Merged
merged 3 commits into from
Aug 2, 2023
Merged

Conversation

fwkoch
Copy link
Collaborator

@fwkoch fwkoch commented Jul 31, 2023

This addresses the bullet point Math should be parsed and exported to mml on this issue: #347

JATS export now uses mathml to represent equations / inline math, rather than leaving the raw latex math.

Copy link
Member

@rowanc1 rowanc1 left a comment

Choose a reason for hiding this comment

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

Looks awesome! A few points/questions below.

Can you maintain the latex/cdata in the output using an alternatives? I think it is good to have both included.

Should we move xmlns:mml="http://www.w3.org/1998/Math/MathML" to the top of the document? Is it common to have that throughout?

@rowanc1
Copy link
Member

rowanc1 commented Jul 31, 2023

Just saw that the MML that katex gives includes the annotation:

<mml:annotation encoding="application/x-tex">w_{t+1} = (1 + r_{t+1}) s(w_t) + y_{t+1}</mml:annotation>

I think we may want to remove that in favour of alternatives bundle in JATS? Would need to look at more examples to be sure.

Base automatically changed from feat/pypi to main August 1, 2023 15:41
@rowanc1
Copy link
Member

rowanc1 commented Aug 2, 2023

Tested locally, and JATS validation is working well!

@rowanc1 rowanc1 merged commit eb32ae9 into main Aug 2, 2023
3 checks passed
@rowanc1 rowanc1 deleted the feat/katex-jats branch August 2, 2023 17:10
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