Separator line in the MathJax menu

11 views
Skip to first unread message

albert....@gmail.com

unread,
Aug 15, 2017, 8:18:09 AM8/15/17
to MathJax Users
Dear All,

In the MathJax context menu there are a number of items like "Show Math As", "Math Settings" etc. The "Math Settings has a number of items like "Zoom Trigger" and "Zoom Factor" and below the "Zoom Factor" there is a separator line. In version 2.2 I was able to remove / hide this line by:
  MathJax.Menu.menu.items[2].menu.items[2].hidden = true;
in the function:
  MathJax.Hub.Register.StartupHook("MathMenu Ready",function ()

In version 2.7.1 (I didn't try intermediate version) this does not work anymore, I get the error message:
  TypeError: MathJax.Menu.menu.items[2].menu is null

How can I remove / hide the line?

Thanks in advance.

Best Regards,

Albert

Peter Krautzberger

unread,
Aug 15, 2017, 9:13:49 AM8/15/17
to mathja...@googlegroups.com
Hi,

I would not hack this by JavaScript but simply add 

   .MathJax_MenuRule { 
        display: none
    }

to your CSS (or, if you prefer, to your MathJax configuration, cf. http://docs.mathjax.org/en/latest/reference/CSS-styles.html)

Regards,
Peter.

--
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-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

albert....@gmail.com

unread,
Aug 15, 2017, 9:25:06 AM8/15/17
to MathJax Users
Dear Peter,

Thanks for this quick answer.
This solution does work, but has as disadvantage that all separator lines in the menu disappear and I have to add an extra file to my project. I already have the described startuphook and inhere I already remove some of the other items (to minimize the total distribution size, I cannot use a CDN as some users don't have internet access / very strict firewall rules on the computers where the documentation is show as part of the program).
In the startuphook I have e.g. already:
           var a=MathJax.Menu;
           a.menu.Find("Language").hidden = true;
and
          a.menu.Find("Math Settings","Scale All Math ...").hidden = true;
so some hacking is already done.

Best Regards,

Albert
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.

albert....@gmail.com

unread,
Aug 15, 2017, 10:39:21 AM8/15/17
to MathJax Users, albert....@gmail.com
Dear Peter,

As I have already a section:
  <script type="text/x-mathjax-config">
I added here:
MathJax.Hub.CombineConfig("MathMenu",{
styles: {
   ".MathJax_MenuRule": {
        display: "none",
    }
}});

So the extra file is gone. All separator lines are gone as well but this is not a big issue for me.

Best Regards,

Albert

Davide Cervone

unread,
Aug 15, 2017, 7:34:53 PM8/15/17
to mathja...@googlegroups.com
In a recent version of MathJax (2.5?) the .menu property was changed to .submenu, so I think what you want is

MathJax.Menu.menu.items[2].submenu.items[2].hidden = true;

(the top-level menu is still menu, if I recall correctly).

Davide



albert....@gmail.com

unread,
Aug 16, 2017, 5:47:00 AM8/16/17
to MathJax Users
Dear Davide,

Thanks for the answer.
This is indeed the case, when using submenu the mentioned division line disappears.

Best Regards,

Albert
Reply all
Reply to author
Forward
0 new messages