Mathjax & LaTeX in dash

I think a solution has been found here. It involves:

  1. adding mathjax external js
    app = dash.Dash(__name__, external_scripts=[
      'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML',
    ])
  1. configuring mathjax to re-run* every x (e.g. 1000) milliseconds via js script in assets/
    setInterval("MathJax.Hub.Queue(['Typeset',MathJax.Hub])",1000);

* latest MathJax is smart enough to only re-process as needed

3 Likes