Skip to content

A small issue with Pandoc passing MathJax entries. #11292

@amones

Description

@amones

Hello, I encountered a small issue while using Pandoc(Version:3.8.2.1) and am reporting it here.Some EPUB e-books use MathJax to render mathematical formulas. However, when converting these EPUB files to PDF format with Pandoc and specifying the MathJax path, the exported PDF files do not properly render the MathJax formulas. After troubleshooting, it was found that the reason is that Pandoc does not specify the "defer" attribute for the MathJax strings in the intermediate HTML document. For example, if you use the following command to convert the document,

#Specify the locally installed MathJax
pandoc -f epub --mathjax="D:/MathJax/tex-mml-chtml.js" --toc -t pdf -o file.pdf file.epub

Will add to the HTML file:

<script src="D:/MathJax/tex-mml-chtml.js" type="text/javascript"></script>

And the correct sentence is:

<script defer src="D:/MathJax/tex-mml-chtml.js" type="text/javascript"></script>

I hope Pandoc will include a fix for this issue in the new version. Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions