-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Support rendering tex even when global MathJax rendering mode is not SVG #2994
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
951523d
Support rendering tex even when global MathJax rendering mode is not SVG
jonmmease 1dd4fd3
Call final MathJax.Hub.setRenderer directly (not with Queue)
jonmmease 9569648
Don't call setRenderer if renderer is already SVG
jonmmease 8d610e7
Create tmpDiv on the `Queue` just before Typesetting
jonmmease 6cba8e3
Perform MathJax.Hub.Config before each rendering call, and restore co…
jonmmease b0628b0
A compromise solution
jonmmease 41f7747
Set MathJax.Hub.processSectionDelay to 0 to fix jumping behavior in M…
jonmmease b02ba17
Add support for a new global window.PlotlyConfig configuration object
jonmmease 6a572fd
Add README description of the new window.PlotlyConfig.MathJaxConfig p…
jonmmease 57e32ba
Move new MathJax instructions to `tasks/stats.js`
jonmmease File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this decision synchronously?
As is I'm concerned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trouble is that
MathJax.Hub.config.menuSettings.renderer
isn't initialized right away, so if it's accessed outside of aQueue
command it will be null in the beginning. Perhaps there's a better way to wait for the first initialization than putting theMathJax.Hub.config.menuSettings.renderer
on theQueue
, but I'm not sure at this point.Let me know if you have any ideas, I'll try a few more experiments tonight...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK... I see it immediately but perhaps that's just due to how we loaded MathJax in the first place... but I guess even if it's present, there's a case where someone else has put something in the
Queue
that changes the renderer, so by the time our expression gets rendered we have a different value from the one we read synchronously.OK, so perhaps we can't do anything about the overhead - MathJax has enough overhead anyway, this is probably the least of our problems - but the race condition is still there. Since we're already in a function being executed by the
Queue
, can we just callMathJax.Hub.setRenderer(originalRenderer)
directly, right where you have it, rather than putting it in theQueue
? Or I guess, to be even safer, move this to the end of our finalize function so we canreturn MathJax.Hub.setRenderer(originalRenderer)
in the (presumably unlikely) event that this happens async.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see what you mean about the race condition. I'll give that a try again, but for some reason when I was testing earlier the direct
MathJax.Hub.setRenderer
call (not through theQueue
) wasn't working properly, but I don't remember in what context that was. I'll report back...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it does work fine to end with
return MathJax.Hub.setRenderer(originalRenderer)
and remove the extraQueue
command. Done in 1dd4fd3.