-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Does version 3 support <script type="math/tex">? #2220
Comments
This is the expected behavior in version 3. See the last bullet point in the changes to the API section of the upgrading to v3 documentation. This gives a configuration that will process the scripts that you are using. |
Thank you so much for the information. This is exactly what I was looking for. Adding the following script successfully processed html files generated by Jekyll (from both html and markdown files). MathJax = {
options: {
renderActions: {
/* add a new named action not to override the original 'find' action */
find_script_mathtex: [10, function (doc) {
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
const display = !!node.type.match(/; *mode=display/);
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
const text = document.createTextNode('');
node.parentNode.replaceChild(text, node);
math.start = {node: text, delim: '', n: 0};
math.end = {node: text, delim: '', n: 0};
doc.math.push(math);
}
}, '']
}
}
}; |
Would you consider making this a simple option switch? |
@opeltre, No, but it could be made an extension you could load. |
For anyone still looking: @memakura's code just kinda works very well and out of the box :) |
It seems Mathjax version 3 does not render <script type="math/tex">, which was supported in version 2. (https://docs.mathjax.org/en/v2.7-latest/advanced/model.html#how-mathematics-is-stored-in-the-page)
I found this when I used Github Pages to convert a markdown file with$$...$$ . The markdown file was processed on the Github server, but nothing was rendered with Mathjax v3 (v2 had no problem). I also checked this locally with Jekyll and found that $$...$$ in a markdown file is converted to <script type="math/tex; mode=display">…</script> before processed by Mathjax.
I was wondering whether this is an expected behavior in v3 or not. If so, are there any options to turn on the rendering of <script type="math/tex">?
The following is for a simple test.
The text was updated successfully, but these errors were encountered: