# Mathjax support

As I mentioned in previous post, It would be cool if Mathjax is supported.
Mathjax is a js library for (la)tex rendering in browsers, there’s a wide range of use among academic people, engineers/programmers. Combining math formulas with Kinopio would be great for better math understanding.

It could be done with include Mathjax js library in the webpage or choosing server-side rendering. I know it actually involves many factors, server load, page loading speed, extra maintains, and server cost, so follow your roadmap, and if there is any chance to get it supported I’d appreciate it very much.

For the use case, please take a look at here.

Thanks

2 Likes

Thank you, this is super informative

1 Like

Sorry to bump up this thread again, I have figured out a way to display math by userscript, hope it could help someone

// ==UserScript==
// @name       MathJax for kinopio.club
// @namespace
// @version    0.1.1
// @description Enables MathJax on kinopio.club.
// @match      https://kinopio.club/*
// @namespace https://greasyfork.org/en/users/863335
// ==/UserScript==
if (window.MathJax === undefined) {
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\$$', '\$$']]
},
svg: {
fontCache: 'global'
},
startup: {
console.log('MathJax is loaded, but not yet initialized');
MathJax.typeset(document.querySelectorAll(".markdown span"));
console.log('MathJax is initialized, and the initial typeset is queued');
}
}
};

var polyfill_src = "https://polyfill.io/v3/polyfill.min.js?features=es6";
var mathjax_src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js";

var insert_script = function(src){
var script = document.createElement("script");
script.type = "text/javascript";
// script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML";
//script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML";
script.src = src;
script.async = true;

};
insert_script(polyfill_src);
insert_script(mathjax_src);

MathJax.typeset(MathJax.typeset(document.querySelectorAll(".markdown span")));
});

}
4 Likes

this is . there are a lot of interesting things you could do with this kind of mechanism beyond Mathjax, too

this is also a good example of something that would make a good widget/plugin for the future

3 Likes

How would this work on desktop app? There is no browser monkey. Also Katex might be faster than mathjax.

1 Like

Like Roam has roam/js, we should have something similar if we go down this route.

1 Like