-
-
Save Edenharder/83ebf37c08714e9aafe3ee5c852b36db to your computer and use it in GitHub Desktop.
Apply Mathjax to Trello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name MathJax Trello | |
// @description Apply Mathjax to Trello | |
// @include https://trello.com/* | |
// @grant none | |
// ==/UserScript== | |
// INSTALL: https://gist.githubusercontent.com/ViktorQvarfordt/c3f89c3cf50e3dc60b23257294af5710/raw/trello-mathjax.user.js | |
if (window.MathJax === undefined) { | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; | |
script.text = 'MathJax.Hub.Config({' | |
+ ' messageStyle: "none",' | |
+ ' tex2jax: {' | |
+ ' inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],' | |
+ ' processEscapes: true' | |
+ ' },' | |
+ ' "HTML-CSS": {' | |
+ ' availableFonts: ["TeX"]' | |
+ ' }' | |
+ '});' | |
// Run mathjax every second (the overhead is very low). | |
+ '(function doMathJax() {' | |
+ ' window.setTimeout(doMathJax, 1000);' | |
+ ' window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub]);' | |
+ '})();'; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
MathJax.Hub.Queue(["Typeset", MathJax.Hub]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment