How do I make MathJax work on the mobile web chat without using Tampermonkey?
1 Answer
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.
- Copy the text from the box below.
- Create a bookmark to this (or any) page.
- Replace the contents of the bookmark URL with the copied text.
- 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.
-
6Is it Java or JavaScript that needs to be enabled? And why is the script in a spoiler block?2018-08-10 09:41:28 +00:00Commented Aug 10, 2018 at 9:41
-
@rene JavaScript. For copy pasting.Avyansh Katiyar– Avyansh Katiyar2018-08-10 12:54:28 +00:00Commented Aug 10, 2018 at 12:54
-
still don't understand the copy-pasting. In chrome I have no problem copying code.2018-08-10 13:00:25 +00:00Commented Aug 10, 2018 at 13:00
-
Thanks, btw why didn't you answered my question when I joined your chat group few days beforeuser404249– user4042492018-10-16 03:09:28 +00:00Commented Oct 16, 2018 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 :)Avyansh Katiyar– Avyansh Katiyar2018-10-16 04:47:17 +00:00Commented Oct 16, 2018 at 4:47