Skip to content

Pandoc doesn't include MathJax CDN in HTML when document contains no math #8469

@rnwst

Description

@rnwst

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:

pandoc test.md -o test.html -f markdown -t html --mathjax --standalone

The resulting HTML file contains no link to the MathJax CDN.

test.md:

---
title: A Test.
---

A document without math!

Pandoc version?

$ pandoc --version
pandoc 2.19.2
Compiled with pandoc-types 1.22.2.1, texmath 0.12.5.4, skylighting 0.13.1.1,
citeproc 0.8.0.2, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4

OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions