Mathjax 3.0.5 unable to hide menu while right clik

148 views
Skip to first unread message

subus...@gmail.com

unread,
Apr 14, 2020, 8:54:47 AM4/14/20
to MathJax Users
I'm currently using mathjax v3.0.5.
I'm not able to disable the contextual menu when right click. I refer latest document and apply this code too

MathJax = {
options: {
renderActions: {
addMenu: [0, '', '']
}
}
};
But not working... Again it displays... Please.. give me the correct code to disable contextual menu when right click on equation.. Thanks

Davide Cervone

unread,
Apr 14, 2020, 9:11:26 AM4/14/20
to mathja...@googlegroups.com
Your configuration works successfully for me (no MathJax menu), though I would recommend

MathJax = {
  options: {
    renderActions: {
      addMenu: [],
      checkLoading: []
    }
  }
};

instead.  Make sure this is in a script that occurs BEFORE you load MathJax itself.

If that doesn't work, check the browser console window for error messages to make sure your script is being processed.

Otherwise, you will need to provide a complete page that illustrates your problem.  We can't tell from this snippet because it is not the configuration itself that is the problem.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/678a7e52-ad39-49b9-9cb6-85714386917f%40googlegroups.com.

subus...@gmail.com

unread,
Apr 14, 2020, 9:44:28 AM4/14/20
to MathJax Users
my configure part

window.MathJax = {


options: {
renderActions: {
addMenu: [],
checkLoading: []
}

},
loader: { load: ['[tex]/boldsymbol'] },
tex: {
inlineMath: [
['$', '$'],
['\\(', '\\)']
],
displayMath: [
['$$', '$$'],
['\[', '\]']
],
packages: { '[+]': ['boldsymbol'] }
},
mml: {
parseAs: 'xml', // or 'xml'
forceReparse: false, // true to serialize and re-parse all MathML
parseError: function (node) { // function to process parsing errors
this.error(this.adaptor.textContent(node).replace(/\n.*/g, ''));
}
}

};

please give correct configuration for ui/menu disable

subus...@gmail.com

unread,
Apr 14, 2020, 10:22:08 AM4/14/20
to MathJax Users
(function () {

let script_CHTML = document.createElement('script');
script_CHTML.src = '/Scripts/External/mathjax_3.0/es5/tex-mml-chtml.js'; //Configure this to get the CHMTL
script_CHTML.async = true;
document.head.appendChild(script_CHTML); //Parent Tags
})();

Davide Cervone

unread,
Apr 14, 2020, 10:40:50 AM4/14/20
to mathja...@googlegroups.com
Your code and configuration work properly for me.  In the following page

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Disable Menu</title>
<script>
window.MathJax = {
   options: {
       renderActions: {
           addMenu: [],
           checkLoading: []
       }
   },
   loader: { load: ['[tex]/boldsymbol'] },
   tex: {
       inlineMath: [
           ['$', '$'],
           ['\\(', '\\)']
       ],
       displayMath: [
           ['$$', '$$'],
           ['\[', '\]']
       ],
       packages: { '[+]': ['boldsymbol'] }
   },
   mml: {
       parseAs: 'xml',                     // or 'xml'
       forceReparse: false,                 // true to serialize and re-parse all MathML
       parseError: function (node) {        // function to process parsing errors
           this.error(this.adaptor.textContent(node).replace(/\n.*/g, ''));
       }
   }

};
</script>
<script>
(function () {
   let script_CHTML = document.createElement('script');
   script_CHTML.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'; //Configure this to get the CHMTL
   script_CHTML.async = true;
   document.head.appendChild(script_CHTML);    //Parent Tags
})();
</script>
</head>
<body>

$$x+1\over x-1$$

</body>
</html>

the typeset math does not have the MathJax contextual menu.  I only changed the URL for the tex-mml-chtml.js file to the one from the CDN.

You did not do as I asked, which was to give a complete example, not code snippets.  Your snippets work correctly by themselves (as you can see above), but it may be how you have put them together in your page that is the problem.  I can't tel that from just the pieces.

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.

subus...@gmail.com

unread,
Apr 14, 2020, 10:57:50 AM4/14/20
to MathJax Users
still i'm issue with ui/menu disable.
How will i contact with you regarding this. can you mail me? subus...@gmail.com for discussion

kunal...@gmail.com

unread,
Apr 14, 2020, 1:02:34 PM4/14/20
to MathJax Users
Hi David,

Here i have differentiated the MathaJax object of each side, i.e., letf side is the mathjax object generated from subu project, and right side mathjax object generated from your code. Here we required mathjax from iFrame. I suspect due to iFrame window object we cant able to configure properly. 

Please let us know, how you are configuring the window.MathJax Object from js file to library or how the mathjax library find the configuration object from JS.  

Issue.png































To unsubscribe from this group and stop receiving emails from it, send an email to mathja...@googlegroups.com.

Davide Cervone

unread,
Apr 17, 2020, 2:39:24 PM4/17/20
to mathja...@googlegroups.com
If you made the changes to the configuration that correspond to those in my code, then it looks like the configuration object is not being found by MathJax.  Are you sure you are setting the global window.MathJax object?  And are you sure that it is set before MathJax is loaded?

You do not describe the system that you are using, but it sounds like it might be something called "subu"?  I don't know what that is, so I'm not sure.  But I suspect that the MathJax variable isn't being properly set, so the configuration isn't being used.  Without more information about your setup, it is hard to tell.

Here we required mathjax from iFrame. I suspect due to iFrame window object we cant able to configure properly. 

Are you setting the MathJax object within the iframe, and loading the MathJax tex-mml-chtml.js file within that iframe?  If the MathJax object is in the parent window of the iframe, that will not be able to be read by MathJax within the iframe.

Please let us know, how you are configuring the window.MathJax Object from js file to library or how the mathjax library find the configuration object from JS.  

I configured window.MathJax by setting its value (window.MathJax = {...}).  That sets the global MathJax object in the window where that command was processed.  MathJax looks for window.MathJax when it starts up to find the configuration that you have provided.  That is, it looks for the global MathJax object.

But if you are running MathJax within an iframe, that is effectively a separate window, and it has its own set of global values.  So window.MathJax inside the iframe is not the same as window.MathJax outside the iframe.  You must set window.MathJax in the same DOM as where you are loading MathJax.

Davide

kunal...@gmail.com

unread,
Apr 20, 2020, 10:36:19 PM4/20/20
to MathJax Users
Thanks for the clear explanation professor. Issue because of, we required the mathjax file before mathjax object. thanks a lot.

Davide Cervone

unread,
Apr 21, 2020, 1:32:00 PM4/21/20
to mathja...@googlegroups.com
Glad you got it to work out.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/4215bc74-08e5-4db9-9060-10e2170c9c10%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages