REPRO STEPS:
- Create
doc.md
cat > doc.md <<'EOF'
$$
Z^p
$$
$$
Z^+
$$
$$
Z^\prime
$$
$$
Z'
$$
$$
Z\prime
$$
EOF
- Save an optional line of MathJax script:
cat > mathjax.md <<'EOF'
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js" type="text/javascript"></script>
EOF
- Generate MathML to be viewed with MathJax:
pandoc mathjax.md doc.md -s --mathml > mathjax-with-mathml.html
- Open mathjax-with-mathml.html in a browser.
RESULT:
The MathML generated by pandoc (in mathjax-with-mathml) is (edited for clarity):
<p> ... <msup><mi>Z</mi><mi>p</mi></msup> <annotation>Z^p</annotation> ... </p>
<p> ... <msup><mi>Z</mi><mo>+</mo></msup> <annotation>Z^+</annotation> ... </p>
<p> ... <msup><mi>Z</mi><mi>′</mi></msup> <annotation>Z^\prime</annotation> ... </p>
<p> ... <mrow><mi>Z</mi><mi>′</mi></mrow> <annotation>Z'</annotation> ... </p>
<p> ... <mrow><mi>Z</mi><mi>′</mi></mrow><annotation>Z\prime</annotation> ... </p>
And then visually looking at the webpage, the result of Z' looks like Z\prime and not Z^\prime.
EXPECTED:
Output like what LaTeX and MathJax generate.
Specifically the MathML for Z' should be a <msup>, like what MathJax generates, and not <mrow>.
<p> ... <msup><mi>Z</mi><mi>p</mi></msup> <annotation>Z^p</annotation> ... </p>
<p> ... <msup><mi>Z</mi><mo>+</mo></msup> <annotation>Z^+</annotation> ... </p>
<p> ... <msup><mi>Z</mi><mi>′</mi></msup> <annotation>Z^\prime</annotation> ... </p>
<p> ... <mrow><mi>Z</mi><mi>′</mi></mrow> <annotation>Z'</annotation> ... </p>
<p> ... <mrow><mi>Z</mi><mi>′</mi></mrow><annotation>Z\prime</annotation> ... </p>
Similarly, the visual result is not what LaTeX produces. The visual output of LaTeX for Z' looks like Z^\prime and not Z\prime.
I'll add more information and commentary separately in this thread.
REPRO STEPS:
doc.mdRESULT:
The MathML generated by pandoc (in mathjax-with-mathml) is (edited for clarity):
And then visually looking at the webpage, the result of
Z'looks likeZ\primeand notZ^\prime.EXPECTED:
Output like what LaTeX and MathJax generate.
Specifically the MathML for
Z'should be a<msup>, like what MathJax generates, and not<mrow>.Similarly, the visual result is not what LaTeX produces. The visual output of LaTeX for
Z'looks likeZ^\primeand notZ\prime.I'll add more information and commentary separately in this thread.