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

Render MathJax on output to Word #302

Closed
arthurattwell opened this issue Sep 6, 2018 · 2 comments
Closed

Render MathJax on output to Word #302

arthurattwell opened this issue Sep 6, 2018 · 2 comments

Comments

@arthurattwell
Copy link
Member

Our output to Word doesn't render MathJax. This step needs to be added to the output scripts.

@arthurattwell
Copy link
Member Author

A problem may be that Pandoc doesn't support SVG in some conversions (jgm/pandoc#4058, jgm/pandoc#1793).

As mentioned in #198, we might still need to have an option for converting maths to PNG as a workaround for now.

@arthurattwell
Copy link
Member Author

The reason behind this:

  1. When outputting to Word from PDF builds, we render MathJax as SVG. But Pandoc doesn't support SVG, so the maths doesn't show.
  2. When outputting to Word from web or epub builds, kramdown wraps the source TeX in script elements. Since we're not running any JS in Pandoc or Word (obviously), these elements mean nothing and vanish from the Word output.

So we have two options:

  1. We can try to render the maths as PNGs. This would involve extending our gulp script to render maths as PNG under certain circumstances. This may be quite a lot of work and added complexity and dependencies.
  2. We can prevent kramdown from wrapping the TeX in script elements, and simply have the raw TeX in the Word output.

Option 2 is the no-brainer here. Not only is it simpler, but Word is primarily an editing format, not a publication format. That is, we export to Word so that someone can edit it. And so the maths should be in its most editable form. Keeping it in TeX means it's editable, and can be easily reused if we have to bring that edited content back into markdown.

I'll push a fix for this shortly.

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

No branches or pull requests

1 participant