Skip to content

Conversation

takluyver
Copy link
Member

Looking at #2733 again, I noticed that @willingc's JS console did show tracebacks, which I had somehow overlooked before. Partly that was just me not looking closely enough, but we can also make it stand out more by logging it with console.error, which this PR does.

That pointed to the code which was modified in PR #2677 just last month; this fits with people first running into the error when we made an RC.

That change asks Mathjax to call MathJax.InputJax.TeX.resetEquationNumbers() after typesetting each thing. That function is defined in a Mathjax extension extensions/TeX/AMSmath.js. While I still can't reproduce the error, I guess that looking up the function is in a race condition with the extension loading; if it loses the race, then there's nothing to call, so an error pops out.

This PR:

  • Catches errors from enqueueing resetEquationNumbers(), logs them and carries on, so that these (hopefully) cannot cause a failure to load the notebook.
  • Based on my speculation, enqueues a Mathjax Require call immediately before to ensure that the extension is loaded before we use it.

If this passes review, I suggest that we make an RC3 soon after merging it and ask the people who can reproduce the issue to see if it's fixed.

@gnestor
Copy link
Contributor

gnestor commented Aug 23, 2017

@takluyver Excellent!! Thanks for tracking this down! With your blessing, I will merge this and create a new rc release.

@takluyver
Copy link
Member Author

That's fine by me - I think it's the easiest way to get people to test it.

I have run with this locally and it doesn't obviously break anything for me, but I haven't tried using the equation numbering the code in question was meant to enable.

@mpacer
Copy link
Member

mpacer commented Aug 23, 2017 via email

@takluyver
Copy link
Member Author

If you render the same cell twice does it produce a weird box around he raw text of the internals instead of showing displayed math?

Not for me. Rendering mathematical expressions appears to be working as it does in master, at least on my system.

@mpacer
Copy link
Member

mpacer commented Aug 23, 2017 via email

@takluyver
Copy link
Member Author

How do you put a label in the equation?

@mpacer
Copy link
Member

mpacer commented Aug 23, 2017 via email

@takluyver
Copy link
Member Author

screenshot from 2017-08-23 17-18-09
screenshot from 2017-08-23 17-18-16

Seems to be fine. I've flipped it between rendered and unrendered a few times.

@willingc
Copy link
Member

@takluyver Thank you :D I haven't seen the mathjax error while using this fix. 🎉

@minrk minrk merged commit f8a6e1c into jupyter:master Aug 26, 2017
@takluyver takluyver deleted the mathjax-callback-err branch August 27, 2017 08:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants