Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Edenharder/83ebf37c08714e9aafe3ee5c852b36db to your computer and use it in GitHub Desktop.
Save Edenharder/83ebf37c08714e9aafe3ee5c852b36db to your computer and use it in GitHub Desktop.
Apply Mathjax to Trello
// ==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