-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Pandoc doesn't include MathJax CDN in HTML when document contains no math #8469
Comments
It's seems a desirable feature not to include the link if the document doesn't contain math. (That avoids some unnecessary network activity.) Yes, you could omit But if you're injecting Math elements using a filter, the writer should include the link. The writer is seeing the AST, as modified by the filter, not the original document. Are you perhaps including these elements as RawInline or RawBlock instead of Math? |
I did notice one flaw in the HTML writer: it doesn't set the "math" template variable when it renders raw LaTeX "math environments" (these are things, like the align environment, that shouldn't be enclosed in Math elements because in LaTeX they aren't valid in math mode). I'll fix this, maybe that's your issue if you're using RawBlock/RawInline? |
commands or environments that can be interpreted as math e.g. by MathJax. See #8469.
Thank you @jgm for your quick response. I hadn't considered the use case of processing a large amount of files with the same options, and I agree that it is sensible to avoid unnecessary network activity. In my particular use case, the filter injects SVGs inside of |
One option would be to set the
so you could use |
Perfect, thanks! |
Explain the problem.
Currently, pandoc only includes the MathJax CDN in the HTML output when the document contains math. I am using a pandoc filter which injects math into a page which otherwise contains no math. Since pandoc does not include the MathJax CDN, this math isn't being rendered when the page is loaded (since MathJax never gets loaded). My initial expectation was that when the
--mathjax
option is passed to pandoc, it will include the MathJax CDN, no matter what. In particular, when the URL is specified according to--mathjax=URL
, I most certainly expect the resulting HTML file to contain the MathJax URL that I have explicitly passed to pandoc.Test command:
The resulting HTML file contains no link to the MathJax CDN.
test.md:
Pandoc version?
OS: Linux
The text was updated successfully, but these errors were encountered: