How can not to load MathZoom.js and MathMenu.js ?

1,188 views
Skip to first unread message

Jack

unread,
Mar 26, 2012, 3:49:32 AM3/26/12
to MathJax Users
In order to display math formula quickly, I have made the following
configuration file to disable showMathMenu.
But I still see the webpage to display loading MathZoom.js and
MathMenu.js files in the lower left-hand corner when I access a
webpage
How can I do? Thanks!

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js","asciimath2jax.js"],
"HTML-CSS": {imageFont: null },
showMathMenu: false,
showMathMenuMSIE: false,
TeX: { extensions:
["AMSmath.js","AMSsymbols.js","noUndefined.js"]},
jax: ["input/TeX","input/AsciiMath","output/HTML-CSS"]
});
</script>
<script type="text/javascript" src="Math/MathJax.js"></script>

Davide P. Cervone

unread,
Mar 26, 2012, 10:20:56 AM3/26/12
to mathja...@googlegroups.com
These get loaded automatically several seconds after the mathematics
is typeset. They will not slow down the typesetting, and it doesn't
hurt anything to have them loaded even if you have set showMathMenu to
false. And setting that value to false will not speed up the
typesetting, so I'm not sure the purpose in doing so.

But if you want to prevent those two components from loading
automatically, you can add

MathJax.Hub.Startup.MenuZoom = function () {};

after the MathJax.Hub.Config() call in your x-mathjax-config script.

Davide

Jack

unread,
Mar 26, 2012, 8:32:31 PM3/26/12
to MathJax Users
Thank you very much.

Shiv Shankar

unread,
Aug 25, 2013, 1:46:18 AM8/25/13
to mathja...@googlegroups.com
Hello Davide,

Even after setting this I notice that both MathZoom.js and MathMenu.js are being loaded. Can you please let me know the correct procedure.

Thanks,
Shiv

Davide P. Cervone

unread,
Aug 28, 2013, 5:19:52 PM8/28/13
to mathja...@googlegroups.com
OK, it looks like the MenuZoom function has already been pushed onto the MathJax Queue before the configuration is performed, so setting it is too late to set it to an empty function at that point.  Try removing the

MathJax.Hub.Startup.MenuZoom = function () {}

and replace it with

(function () {
 var EXT = MathJax.Extension, mm, mz;
          MathJax.Hub.Register.StartupHook("End Typeset",function () {
            mm = EXT.MathMenu; mz = EXT.MathZoom;
            EXT.MathMenu = EXT.MathZoom = {};
          });
 MathJax.Hub.Queue(function () {
   if (mm) {EXT.MathMenu = mm} else {delete EXT.MathMenu}
   if (mm) {EXT.MathZoom = mz} else {delete EXT.MathZoom}
 });
})();

This should prevent the loading of those components at startup, but still allow them to be loaded later if needed.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages