0

I'm relatively new to Python and programming in general. I'm trying to create a Jupyter Notebook that recreates plots shown in an engineering textbook. I have some markdown cells where I've used LaTeX notation to display equations that have a few greek letters. The equations appear beautifully within the Jupyter Notebook. But when I "Download As" HTML, or use nbconvert to HTML, the resulting HTML file does not show the mathematical expressions, but rather the LaTeX notation. This happens with all web browsers I have (Chrome, Firefox, Edge).

I have seen some possible solutions online that point to external websites. The bad news is I do not have access / permissions to do something like that. The good news, however, is I do have access to the Pypi repo. So, if there are libraries that I need in order to make the expressions appear properly, I should be able to install it. V/r.

1 Answers1

0

If you want to render LaTeX equations on HTML, you can consider using Mathjax. Just add these following lines to the <head> tag:

    <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> 
    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
blaccod
  • 71
  • 3
  • I have access to Python libraries through Pypi, but not to websites as you've suggested above. Is there a library that I could use that would do the trick? – punjabWala81 Oct 31 '22 at 16:12
  • Does [this StackOverflow question](https://stackoverflow.com/questions/37754756/can-i-integrate-mathjax-into-a-python-program) solve your problem? Also a quick search on PyPi gave me [this](https://pypi.org/project/py-mathjax/), but I haven't tried either of them – blaccod Nov 01 '22 at 15:15