Mathjax: Formulas render only when cache was cleared.

Created on 11 Jul 2017  路  5Comments  路  Source: mathjax/MathJax

I have site which dynamically render some data from the server to front, so when I tried post content which use mathjax, formulas are rendered incorrectly, but if I cleaned up cache everything is okay.

Do someone has any ideas why?

By default:
image

When I clean up cache, history and reload the page all looks pretty nice:
image

Browser: Chrome 58.0.3029.110 (64-bit)
OS: Ubuntu 16.04
MatJax: 2.7.1

Question

All 5 comments

Please share a link to a live example exhibiting the problem.

@pkra Of course: here This site uses Cyrillic, I hope that you will not be embarrassed. Just look at the first element in output.

The configuration block needs to be placed before the call to MathJax.js, see http://docs.mathjax.org/en/latest/configuration.html#using-in-line-configuration-options.

Otherwise, there will be a race condition between fetching MathJax.js and parsing enough of the page to expose the configuration. On a fresh cache, that race will work out, with cached resources, it won't.

But, you should no longer use cdn.mathjax.org, see https://www.mathjax.org/cdn-shutting-down/ for more information. The redirect at cdn.mathjax.org might also be affecting the race.

@pkra I understand you. Thank you very much!

No problem. Good to hear you could resolve the issue.

Was this page helpful?
0 / 5 - 0 ratings