Skip to content

Commit f8a6e1c

Browse files
authored
Merge pull request #2792 from takluyver/mathjax-callback-err
Attempt to fix mysterious mathjax callback error
2 parents 30f739c + 379c359 commit f8a6e1c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

notebook/static/base/js/utils.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,17 @@ define([
940940
if(!window.MathJax){
941941
return;
942942
}
943-
return $el.map(function(){
943+
$el.map(function(){
944944
// MathJax takes a DOM node: $.map makes `this` the context
945-
return MathJax.Hub.Queue(
946-
["Typeset", MathJax.Hub, this],
947-
["resetEquationNumbers",MathJax.InputJax.TeX]
948-
);
945+
MathJax.Hub.Queue(["Typeset", MathJax.Hub, this]);
946+
try {
947+
MathJax.Hub.Queue(
948+
["Require", MathJax.Ajax, "[MathJax]/extensions/TeX/AMSmath.js"],
949+
function() { MathJax.InputJax.TeX.resetEquationNumbers(); }
950+
);
951+
} catch (e) {
952+
console.error("Error queueing resetEquationNumbers:", e);
953+
}
949954
});
950955
};
951956

notebook/static/notebook/js/notebook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ define([
30013001
this.fromJSON(data);
30023002
} catch (e) {
30033003
failed = e;
3004-
console.log("Notebook failed to load from JSON:", e);
3004+
console.error("Notebook failed to load from JSON:", e);
30053005
}
30063006
if (failed || data.message) {
30073007
// *either* fromJSON failed or validation failed

0 commit comments

Comments
 (0)