MathJax does not render until page refresh


#1

Hi all,

I have linked Mathjax to my ghost blog (version 1.24.5) by linking
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' async></script>
to the {{ghost_foot}} code-injection.

When I try to load my page by clicking the blog entry in blog home, mathjax does not seem to render. It does render after a page refresh however.

You can find my blog post at https://www.codeon.tech/ with a title of “Solving The Lane-Emden Equation”. How ever directly going to the blog post through it’s link seems to work just fine.

I googled around a bit and found a github question in mathjax issue here.

If there is a way to fix this issue please let me know.

update: I tried to add a page-reload script to the blog post (as a dirty-solution) and it didn’t work as well. I figured, it is possible that with blog-posts ghost doesn’t run js scripts (probably).


#2

Finally I figured it was a problem with my ghost theme (theme being implemented with ajax calls to load blog posts can cause mathjax to not render synchronously).

Queuing typeset action with MathJax.Hub.Queue(["Typeset",MathJax.Hub]);can fix such an issue.

For more read MathJax Docs on typeset here.


#3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.