Search code examples
node.jsexpresslatexejsmathjax

MathJax with Node partials


I'm using Node and Express with MathJax to make a comment system with TeX. The problem is, the TeX is only rendered when the page first loads, or when I refresh the page, but does not load when rendering a partial. Any advice?

Thanks.


Solution

  • See the MathJax documentation on dynamic pages, which will suggest that you use

    MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
    

    after adding math to the page.

    Also, you could check out the MathJax-node project, which implements APIs for interacting with MathJax through node.js programs.