AsciiMath and the KaTeX Plugin

69 views
Skip to first unread message

andrewg_oz

unread,
Jan 5, 2020, 1:32:51 AM1/5/20
to TiddlyWikiDev

Hi,

I've recently needed to use mathematical equations in my TiddlyWiki and Googling turned up a MathJax plugin, which works well (after some modifications). I don't actually use it for the MathML support, but rather the AsciiMath support ( http://asciimath.org/ ). I find AsciiMath markup very easy to use, in much the same way wiki markup is easier than HTML.

I've since noted that there is a KaTeX plugin. It's nice in that it works offline and is self-contained, but I find the TeX syntax hard to use.

Ideally, there would be some way to use AsciiMath to produce something KaTeX can use. I believe the AsciiMath project already has such a script at: https://github.com/asciimath/asciimathml/tree/master/asciimath-based

However, it's been a long time since I've done any real web development, much less TiddlyWiki. I presume for it to work any AsciiMath-to-LaTeX plugin would need to parse the AsciiMath, produce the LaTeX code and then somehow pass that on to the KaTeX plugin. I have no idea if that would be easy or difficult.

I'm hoping that someone more experienced with TiddlyWiki might be able to indicate if this is likely to be difficult to do or not. If it's going to be difficult then I'll just stick with MathJax and deal with the online requirement. If it's easy I might brush off my JavaScript and have a go.

Thanks in advance for any help or guidance....

Andrew

@TiddlyTweeter

unread,
Jan 5, 2020, 4:06:12 AM1/5/20
to TiddlyWikiDev
I can't answer you question directly but you may find this thread useful to read to maye get clues: https://groups.google.com/d/msg/tiddlywiki/4MlVWlrxl6A/Tequ7KrUAwAJ

BTW there is another plugin, texZilla, that might also be worth looking at to see if AsciiMath might be added to it.

Best wishes
TT

andrewg_oz

unread,
Jan 6, 2020, 9:11:35 AM1/6/20
to TiddlyWikiDev
Thanks. I've had texZilla pointed out to me, but it doesn't work with Chrome. I'm currently fiddling with some plugin code (https://tiddlywiki.com/dev/#How%20to%20create%20plugins%20in%20the%20browser) but can't even get a console.log() to work :-( I'm probably doing something silly, just need to figure out what...

andrewg_oz

unread,
Feb 2, 2020, 9:40:40 AM2/2/20
to TiddlyWikiDev
I've figured out why my console logs weren't working... TiddlyWiki only executes plugin tiddlers marked with module-type parser or widget. There might be other types that will also work.

Slow progress! (this is just a spare time thing...)

Ton Gerner

unread,
Feb 2, 2020, 9:56:11 AM2/2/20
to TiddlyWikiDev
Hi,


On Monday, January 6, 2020 at 3:11:35 PM UTC+1, andrewg_oz wrote:
Thanks. I've had texZilla pointed out to me, but it doesn't work with Chrome. I'm currently fiddling with some plugin code (https://tiddlywiki.com/dev/#How%20to%20create%20plugins%20in%20the%20browser) but can't even get a console.log() to work :-( I'm probably doing something silly, just need to figure out what...

I don't know anything about AsciiMath, KaTex etc. but triggered by the link above, are you aware of the Tinka plugin for creating plugins?

Cheers,

Ton

Reply all
Reply to author
Forward
0 new messages