Wikitten icon indicating copy to clipboard operation
Wikitten copied to clipboard

added support for rendering LaTeX equations using MathJax

Open jbchouinard opened this issue 9 years ago • 4 comments

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.

jbchouinard avatar Jan 07 '16 18:01 jbchouinard

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 avatar Feb 23 '16 10:02 victorstanciu

@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.

jbchouinard avatar Mar 03 '16 16:03 jbchouinard

@victorstanciu @jbchouinard This is really useful, perhaps Math gimmicks in MDwiki should be a choice? http://dynalon.github.io/mdwiki/#!gimmicks.md

zohead avatar Apr 26 '16 08:04 zohead

@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).

symera avatar Jun 01 '16 19:06 symera