Wikitten
Wikitten copied to clipboard
added support for rendering LaTeX equations using MathJax
Used MathJax config that only supports TeX because that's all I need and it's more lightweight.
I see that other javascript libraries used in the code are included statically. Including a MathJax install instead of using the CDN version would be mildly complicated but I could be convinced to do it if that'd be more satisfactory.
Hi @jbchouinard,
Thank you for your contribution. Is there any way to only load the MathJax library when it's actually needed? I would prefer not loading an entire library on all pages, especially one that not all users will need.
@victorstanciu I agree that would be better. I'll have to research / think about it. The two solutions I can think of off the top of my head is either make it configurable (checkbox), or have a small piece of javascript detect LaTeX math and only load the full MathJax library if it finds some. Perhaps only load it if the first line of the markdown document is <!--- LaTeX ---> or something like that.
@victorstanciu @jbchouinard This is really useful, perhaps Math gimmicks in MDwiki should be a choice? http://dynalon.github.io/mdwiki/#!gimmicks.md
@jbchouinard: Loading the library only after detecting LaTeX math code sounds neat. But I would prefer KaTeX as a math library (much faster and less heavy than MathJax).