Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendered pages sometimes do not render math #143

Open
iincer opened this issue Apr 4, 2023 · 3 comments
Open

Rendered pages sometimes do not render math #143

iincer opened this issue Apr 4, 2023 · 3 comments

Comments

@iincer
Copy link

iincer commented Apr 4, 2023

The screenshot below was taken from the demo site for this package. As you can see, the math is not rendered correctly. However, sometimes reloading the page fixes the issue, and things are rendered correctly. It seems that the code does not ensure that MathJax functionality has been loaded before using it.

I am using Microsoft edge. I have also tested iOS devices, and they often show this incorrect behavior.

image

@iincer
Copy link
Author

iincer commented Apr 4, 2023

For reference, this is what I get on iOS:

IMG_1084

IMG_1085

@iincer
Copy link
Author

iincer commented Apr 6, 2023

@danielfrg, mkdocs-jupyter currently places the mathjax imports in the body tag instead of the head tags of the generated html of a notebook--see lines 1440-1472 of https://mkdocs-jupyter.danielfrg.com/variational-inference-nb/index.html. nbconvert places these imports under the head tag.

  1. I modified my html to get the imports under the head tag, and performance improved considerably. mkdocs-jupyter should place these imports under the head tag.

  2. Even after making this change, reloads are not 100% deterministic: sometimes math won't render correctly when reloading a webpage. Do you have insight into whether MathJax should be configured differently to avoid this?

@danielfrg
Copy link
Owner

Yes, we have to put the mathjax code in the body because thats where we can add code. I intentionally changed this from the nbconvert template so they render. I am not sure if we can update the head scripts from a plugin.

@danielfrg danielfrg changed the title [BUG] Jupyter notebooks rendered as html pages sometimes do not render math Jupyter notebooks rendered as html pages sometimes do not render math Sep 24, 2023
@danielfrg danielfrg changed the title Jupyter notebooks rendered as html pages sometimes do not render math Rendered pages sometimes do not render math Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants