Jump to content

User:Esquivalience/mathjax.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Esquivalience (talk | contribs) at 03:19, 30 April 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(".mwe-math-fallback-source-inline").css("vertical-align", "");
$("head").append("<script type=\"text/x-mathjax-config\">MathJax.Hub.Config({tex2jax: {inlineMath: [['$ ',' $']]}});</script>");
$("head").append("<script type=\"text/javascript\" async src=\"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML\"></script>");
// http://stackoverflow.com/questions/10655202/detect-multiple-keys-on-single-keypress-event-in-jquery
var map = {18: false, 192: false};
$(document).keydown(function(e) {
    if (e.keyCode in map) {
        map[e.keyCode] = true;
        if (map[18] && map[192]) {
        	MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
        }
    }
}).keyup(function(e) {
    if (e.keyCode in map) {
        map[e.keyCode] = false;
    }
});