MathJax Contextual Menu


MathJax adds a contextual menu to every mathematical expression that it typesets. You can access the menu by right-clicking (on Windows) or control-clicking (on MacOS) on any mathematics produced by MathJax. Try it out on the mathematics below:

The menu lets you view the “source code” for the mathematics (that is, the textual representation of the mathematics that was used to generate it), change settings that control how MathJax operates, and get help on MathJax. These actions are described below.

Showing the Math Source


You may want to copy the mathematics from a web page into another program, like a word processor, or a computer algebra system. While it would be nice to be able to copy mathematics directly to the clipboard, JavaScript does not include a reliable mechanism of doing that, so MathJax has provided an alternative: the Show Source contextual menu item. When you select this, you will get a small window that contains the source format for the mathematics you indicated; you can “select all” (via control-A or command-A) in that window and then copy the text (via control-V or command-V) to copy the mathematics to the clipboard. See the video on the Copy and Paste with MathJax page for more details.

The Format submenu lets you select what format you want to see in the Show Source window. Since MathJax’s internal format is MathML, you can always view any math expression in that form. MathJax also allows you to view the mathematics in its original markup format. Often this will be TeX, but it may also be MathML, in which case the Original entry in the Format menu will let you get the original MathML markup exactly as it was entered (rather than MathJax’s internal version). Select the format you want, and then show the source — it will appear in that format.

Changing MathJax Settings


The Settings submenu allows you to change settings that control how MathJax operates. These include the zoom trigger and scaling factor, the renderer to use for displaying mathematics, and the global scaling factor for all math on the page.

  • The Zoom Trigger and Zoom Factor determine what action triggers the “Math Zoom” feature, and how large to zoom the math when that action is performed. See the Math Zoom page for more information.
  • The Math Renderer submenu lets you select how MathJax will display mathematics. Some browsers (such as Firefox and Internet Explorer when the MathPlayer plugin is installed) can render MathML directly, and MathJax can use that method to display the formulas in the web page. This will work quickly, but the results may not have the quality of MathJax’s HTML-based renderer. The latter is available in all browsers, and produces uniform results across browsers and platforms. The disadvantage is that it is slower than native MathML support. See the documention on MathJax output formats for more details.


    Note that you can select the MathML renderer even if you don’t have native MathML support (in which case the equations will not format properly).

  • In addition to zooming individual equations, you can change the size of all the mathematics on the page at once, so if the math is too small initially, you can enlarge it in relation to the surrounding text. This is accomplished through the Scale All Math... item in the Settings submenu. When you select it, a dialog box will open that allows you to specify a scaling factor as a percentage of the size MathJax would normally select for the mathematics. This can be used to scale the mathematics in relation to the surrounding text to make it larger (or smaller if the percentage is less than 100%). When you close the dialog box, all the mathematics on the page will be redisplayed with the new size.

If you change any of the settings, they will be remembered from page to page on the site where you set them (unfortunately, you will need to set them again for each site that uses MathJax). The settings will be remembered for a year, so you won’t have to set them again each time you visit the site — just make the setting, and it should be there for you the next time you view the site.

  • Gifcyy Thomas

    Can i disable the contextual menu as such? i.e in case if don’t want to open the contextual menu when a user right clicks the equation .

  • Peter Krautzberger

    Yes you can. You might want to consult the documentation on the core configuration options regarding showMathMenu: true.

  • TK

    Is there an option for accessing the source mathml besides the context menu? Or is it possible to programmatically copy the context of the source “pop-up” once it’s active? There is a lot of math on a page I want to copy, and I’d rather not do it manually and once-by-one if that’s possible. Thanks. This is a great script overall! Kudos

  • Peter Krautzberger

    You might want to ask this on the MathJax User Group, the comments here on mathjax.org are not really suited for this.

  • Davide P. Cervone

    See this discussion in the forum that Peter mentioned.

  • http://twitter.com/wvqusrai 倪新东

    Is there any example of MathJax on this Web sit?