Closed nmanumr closed 6 years ago
This was mentioned over at the MkDocs material repo, but I want to post this here for others who come along so they understand what happened.
Version 4.6.0 recently simplified arithmatex logic to output in MathJax script format (wrapped in a script). The reason why this wasn't done before is that the script format won't show a fallback preview while loading. But I recently discovered how to do previews with the script format, so I migrated to that to have one output format.
In short, Arithmatex was originally written for MathJax, so that was the only library I checked against. I was either unaware or have since forgotten that libraries like KaTeX are available to do this as well. So this change was backwards compatible for MathJax, which I test for, but not for anything else.
With that said, I see no reason why I can't add an option to bring back the plain format (non-script).
For now, the following seems to be a workaround, instead of the normal auto-render
of KaTeX (though I'm not a JavaScript expert and it's not thoroughly tested)
renderMathInElement(document.body);
var items = document.getElementsByClassName("MathJax_Preview");
for (var i = 0; i < items.length; i++) {
katex.render(items[i].innerText, items[i]);
}
@tueda Thanks for the workaround! That is a good temporary workaround.
If adding additional JavaScript is not possible, or unwanted, you can also just lock skip the the current 4.6.0 version in your dependencies. 4.7.0 is planned to bring back old functionality, most likely under a new boolean options. Though I will bring back the options to configure how the content is wrapped. I am hoping over the weekend to get the old functionality back.
4.7.0 will bring back the generic output via the generic
option.
I recently updated to the latest version of pymdown-extensions Here I am facing an issue rendering equations using katex.
Here is the output of above markdown before update
And here is the output of above markdown after update
Further, I noticed that the output of each math equation become something like this: But in previous version its output is something like this: