diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js
index c58722c4b..886453816 100644
--- a/unpacked/jax/output/HTML-CSS/jax.js
+++ b/unpacked/jax/output/HTML-CSS/jax.js
@@ -2103,8 +2103,13 @@
// but can't call loadComplete within the callback for "mml Jax Ready"
// (it would call HTMLCSS's Require routine, asking for the mml jax again)
// so wait until after the mml jax has finished processing.
+ //
+ // We also need to wait for the onload handler to run, since the loadComplete
+ // will call Config and Startup, which need to modify the body.
//
- setTimeout(MathJax.Callback(["loadComplete",HTMLCSS,"jax.js"]),0);
+ MathJax.Hub.Register.StartupHook("onLoad",function () {
+ setTimeout(MathJax.Callback(["loadComplete",HTMLCSS,"jax.js"]),0);
+ });
});
//