-
Notifications
You must be signed in to change notification settings - Fork 73
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
When rendering many notebooks some have a visible MathJax overlay #23
Comments
That is annoying. notebook-to-pdf currently waits for the network to be idle as a way to determine that "everything has loaded". But there were always going to be cases where something slips through. I wonder if there is a way to check what we actually want to know "everything has loaded and is rendered" instead of a proxy measure like "the network has been quiet for a while, things must be ready then, i guess". I don't have a super good idea though. Do you? Maybe there is a way to run some JS to check if all the MathJax equations have been rendered? |
Maybe something like this could work. We could fetch the pages HTML periodically and wait until there are no changes in the HTML code any more. But maybe only as an extra flag, since this could significantly increase the execution time of each convert action |
What do you think of using https://miyakogi.github.io/pyppeteer/reference.html#pyppeteer.page.Page.waitForFunction with a small JS function that returns true when the MathJax overlay is not visible? |
From what I understand, you can force mathjax to render everything with
|
That does look like what we need! How would we use this? In pypetteer we have a way of setting up a JS function that polls ( I am not very good at JS and what patterns to use/not use, so ideas (or complete solutions) would be super welcome. |
That's the simple/easy way to go about it. It's also the suggested way on MathJax mailing list. I'm also not a pro at JS but given it's such a small thing (that can be changed anytime) I'd go this route without worrying too much about the "right" way :) |
Hi, when converting multiple Jupyter Notebooks to PDFs in a row, the first document to be converted always contains this in the bottom left corner, hiding some of the content:
The text was updated successfully, but these errors were encountered: