How do I make MathJax work on the mobile web chat without using Tampermonkey?

up vote 2 down vote accepted

We'll be using robjohn's bookmarklet to make mathjax work on your mobile device.

As a matter of fact he's pretty much written a step by step guide for doing so.

  1. Copy the text from the box below.
  2. Create a bookmark to this (or any) page.
  3. Replace the contents of the bookmark URL with the copied text.
  4. Edit the bookmark title if you wish.

↓The userscript

javascript:(function(){if(window.MathJax===undefined){var%20script%20=%20document.createElement("script");script.type%20=%20"text/javascript";script.src%20=%20"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML";var%20config%20=%20%27MathJax.Hub.Config({%27%20+%20%27extensions:%20["tex2jax.js"],%27%20+%20%27tex2jax:%20{%20inlineMath:%20[["$","$"],["\\\\\\\\\\\\(","\\\\\\\\\\\\)"]],%20displayMath:%20[["$$","$$"],["\\\\[","\\\\]"]],%20processEscapes:%20true%20},%27%20+%20%27jax:%20["input/TeX","output/HTML-CSS"]%27%20+%20%27});%27%20+%20%27MathJax.Hub.Startup.onload();%27;if%20(window.opera)%20{script.innerHTML%20=%20config}%20else%20{script.text%20=%20config}%20document.getElementsByTagName("head")[0].appendChild(script);(doChatJax=function(){window.setTimeout(doChatJax,1000);MathJax.Hub.Queue(["Typeset",MathJax.Hub]);})();}else{MathJax.Hub.Queue(["Typeset",MathJax.Hub]);}})();

Just one thing to remember, the userscript only works if you access it from the search bar i.e you type in the name of the bookmark and tap on it. I've made a YouTube video for more clarity.

I hope Javascript enabled on your device.

  • 6
    Is it Java or JavaScript that needs to be enabled? And why is the script in a spoiler block? – rene Aug 10 at 9:41
  • @rene JavaScript. For copy pasting. – Avnish Kabaj Aug 10 at 12:54
  • still don't understand the copy-pasting. In chrome I have no problem copying code. – rene Aug 10 at 13:00
  • Thanks, btw why didn't you answered my question when I joined your chat group few days before – Loop Back Oct 16 at 3:09
  • @LoopBack I'm sorry it's just that I didn't see the question considering that jee's drawing closer day by day my activity on SE has started to decrease. Next time you want to ask anything ping me directly :) – Avnish Kabaj Oct 16 at 4:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .