Open infinity0 opened 1 year ago
The second commit is optional; I mentioned some details in #110. It would also be easy to tweak this PR to instead use plurimath over latexmath. That is, we have 3 options:
pandoc(1)
-- 3rd commitOne downside of docutil's latex2mathml is that "supports only a subset of LaTeX math syntax". For example, it doesn't support {align}
. (To its credit, latexmath does appear to support this.)
After some experimentation, my impression is that pandoc(1)
supports converting the most wide-ranging set of LaTeX math features to MathML. I've therefore added a 3rd commit to switch to using pandoc(1)
. So we have a total of 4 options to choose from; I've updated the above comment to reflect that.
MathML is due to be released and enabled by default in Chrome 109, so nudging again on this.
More info:
Note, MathML already works on Firefox and Opera.
Hello, I tried using your patch, but could not get it to work with AsciiDoctor PDF. Ended up with inline HTML in PDF.
<div class="stemblock"> <span class="math display">$$\lim_{n \to
\infty}\frac{n}{\sqrt[n]{n!}} = {\large e}$$</span> </div>
Could you please provide a example?
I've not tested PDF. I'm just using asciidoctor -a stem -r asciidoctor-mathematical -a mathematical-format=mathml -a mathematical-inline=true
.
Example source here: https://github.com/infinity0/mkwww/blob/master/example/src/test%20with%20spaces.adoc (raw) Example output here: https://infinity0.github.io/mkwww/test%20with%20spaces.html
This PR is about MathML support. How do you expect MathML support to work inside a PDF, @mateibarbu19 ?
This PR is about MathML support. How do you expect MathML support to work inside a PDF, @mateibarbu19 ?
Hey, thanks for your helpful example! I was thinking that there may be a way of rendering it with an external call (e.g., to Chromium to then print it), and then including those graphics inside the PDF should be no problem.
I see now that my assumption was foolish, and I understand now how to use your fork for an HTML output.
Thank you!
Enable by setting mathematical-format = mathml, mathematical-inline = true