Open ktarplee opened 2 years ago
The new mathjax.html.j2
template looks like this
{%- macro mathjax(url="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js") -%}
<!-- Load mathjax -->
<script src="{{url}}"> </script>
<script type="text/javascript" id="MathJax-script" async
src="{{url}}">
</script>
<!-- MathJax configuration -->
<script id=MathJax-configuration>
window.MathJax = {
tex: {
tags: "ams",
useLabelIds: true,
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true,
processEnvironments: true
}
};
</script>
<!-- End of mathjax configuration -->
{%- endmacro %}
I tested it with nbconvert 6.4 and it works.
Some context here https://github.com/jupyterlab/jupyterlab/issues/7218
We'd want to do a roll out of an updated default mathjax major version across JupyterLab, Jupyter Notebook and nbconvert at the same time.
There's nothing stopping folks today from using newer versions, e.g. mathjax3-extension so a standalone nbconvert-mathjax3
might be a good place to evaluate this.
Any update here? Now that https://github.com/jupyterlab/jupyterlab/pull/13877 is merged, i.e. Jupyterlab v4 uses Mathjax v3.
MathJax 3 is superior to MathJax 2 in every way so why not upgrade. MathJax 3 renders the math much faster. It is also smaller. MathJax 2.7.7 is ~177 MB while MathJax 3.2.0 is only 17 MB. When dockerizing
Simply change the MathJax config (in the HTML template) to support MathJax 3 and switch the default URl to MathJax 3.
It is not possible to simply change the mathjax_url to point to MathJax 3 since the config for MathJax 2 is incompatible with MathJax 3.