paulremo / NRPMHandbook

Repository to store and track the development on the ADS/Matrisk project for developing a jupyter book of the NRPM handbook.
Other
1 stars 1 forks source link

Math inside search table don't show compiled on website #11

Closed csxADS closed 2 years ago

csxADS commented 2 years ago

Using html math language in search tables, it is displayed perfectly on local files even on simulated web server but don't displayed right on published website (see https://nrpmhandbook.reliability.space/_static/interactivity/html/syst_table4_21.html)

paulremo commented 2 years ago

It looks like you are using MathML to display math inside tables. I am not sure this is a great idea because it looks like it isn't supported by all major browsers (e.g. Chrome). I think one option would be to switch to MathJax (https://www.mathjax.org/). This is also used by JupyterBook, so we should get consistently looking equations/math symbols this way.

What do you think?

paulremo commented 2 years ago

Okay - I just tested it and it's a breeze. Let's switch to mathjax. All you have to do is add the following lines to your <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/es5/tex-mml-chtml.js">

You can then use math symbols by simply enclosing them between \(and \) brackets. Have a look at this example.

You'll have to do some re-writing where math symbols are used (and remove the <math> tag), but it will greatly simplify the source and it looks really nice!

csxADS commented 2 years ago

Done commit 595abe0f131021d1697f385bce4f672f66ed1c5d

paulremo commented 2 years ago

Thank you! Did you reference the correct commit? I don't see the switch to MathJax in 595abe0f131021d1697f385bce4f672f66ed1c5d.

csxADS commented 2 years ago

Committed in https://github.com/paulremo/NRPMInteractivity/commit/0cce51d94af2f060f777974b3670e908b25c7a83

paulremo commented 2 years ago

Awesome!