User:Magicmat/common.js

(function initializeMagicmatUserScript {   console.group('magicmat Wikipedia user script');    console.log("Initializing magicmat's custom Wikpedia user script from https://en.wikipedia.org/wiki/User:Magicmat/common.js");

try { if(!!window.magicmatUserScriptLoaded) { throw new Error("Initialization function has already run on this page. Aborting this duplicate execution."); }       window.magicmatUserScriptLoaded = true; if(!window.MathJax) { console.log('Loading customized version of MathJax');

window.MathJax = { showProcessingMessages: false, messageStyle: "none", showMathMenu: false, styles: { ".mjx-chtml": { "-webkit-font-smoothing": "antialiased" }       			},        			tex2jax: { inlineMath: [ ["$","$"], ["\\(","\\)"] ], ignoreClass: ".*", processClass: "tex" }           };

var mjScript = document.createElement('script'); mjScript.type = "text/javascript"; mjScript.src = "//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"; document.getElementsByTagName('head')[0].appendChild(mjScript); } else { console.warn('MathJax has already been loaded. Will skip loading our custom version.'); }   } catch(err) { console.error('User script initialization error:', err); } finally { console.log('Finished initialization'); console.groupEnd; } });