Open waynemystir opened 6 years ago
The same problem.
Custom.js must be loaded before mathjax.js
. Unfortunately mathjax.js
loads first...
http://docs.mathjax.org/en/latest/configuration.html#using-in-line-configuration-options
Just open any notebook in jupyter notebook, press ctrl+U and look at source HTML code. Early mathjax was at the end of <body>
. Now it's on <head>
. :cry:
Sorry, but I don't know what's such difficult to place mathjax at the end of <body>
?
Hm... I found that mathjax.js
is loaded with option ,Safe&delayStartupUntil=configured
.
According this we should run MathJax.Hub.Configured();
after our settings. But this still doesn't works for me...
To be honest, now I don't understand anything.
I found here:
If you do not execute this function, MathJax will not process any of the math on the page.
That means MathJax.Hub.Configured()
must run. I found it in notebook/static/notebook/js/mathjaxutils.js
(code)
Then I found that mathjaxutils.js
is loaded by main.min.js
. That is MathJax.Hub.Configured()
is called after custom.js
. I even doesn't need for MathJax.Hub.Configured()
in custom.js
. But my Mathjax settings still doesn't works...
Maybe, Mathjax settings from mathjaxutils.js
override user Mathjax settings from custom.js
?
I have added custom.js to ~./jupyter/custom. And here's the beginning of the mathjax config section of my custom.js file:
MathJax.Hub.Config({ "tex2jax": { inlineMath: [ ["$","$"], ["(",")"] ], displayMath: [ ["$$","$$"], ["[","]"] ], processEscapes: true, }, "displayAlign": "center", "extensions": ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js","TeX/color.js","TeX/cancel.js"], "TeX": { Macros: { wes: "\blacksquare", qes: "\frac{1}{8}", qd: "\quad", dq: "\quad\quad", norm: ["{\lvert#1\rvert}", 1],
When I open a notebook that uses these macros, the notebook doesn't appear to recognize these macros:
But when I refresh the page, the macros are usually recognized and presented as expected. Is there something I can do to get Notebook to recognize the Mathjax macros when a file is opened?