Macro editor for KaTeX plugin

107 views
Skip to first unread message

8d1h

unread,
Aug 5, 2021, 8:46:10 AM8/5/21
to TiddlyWiki
Hi,

I made a custom macro editor for the official KaTeX plugin, so one can create macros like \bZ -> \mathbf{Z} or \dd#1#2 -> \frac{d#1}{d#2} which are then available globally, without needing to edit the source code of the plugin. It can be found under the configuration tab of the plugin.

Here is a screenshot and a demo html file if you want to try it. I hope it'd be useful for some :) Suggestions and comments are very welcome! I already submitted a pull request on GitHub.
katex.png
katexdemo.zip

PMario

unread,
Aug 5, 2021, 11:56:55 AM8/5/21
to TiddlyWiki
Hi folks,

I want to add, that this is _NOT PRODUCTION READY_ at the moment. The PR at github looks good, but there is still some discussion going on.

So it will be nice to get your feedback here or at github!

-mario

Mohammad Rahmani

unread,
Aug 5, 2021, 12:19:24 PM8/5/21
to tiddl...@googlegroups.com
@Mario,

 Is it possible to update KaTex to 0.13.13! I am not sure if this PR is affected by the update or not! but TW KaTex needs to be updated from 0.12 (Jul 2020) to 0.13.13 (Jun 2021)



Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ba3a8f4b-3d8d-4bfd-a831-b6edd4e2b5c9n%40googlegroups.com.

Mohammad Rahmani

unread,
Aug 5, 2021, 12:29:24 PM8/5/21
to tiddl...@googlegroups.com
@8d1h

Many thanks! I like this improvement!
One question: how do you compare the KaTex macro with the TW macro?
You may aware that you can call TW macro like below

\define dd(a, b)  
$$
 \frac{$a$}{$b$}
$$
\end


<<dd "x+1" "sin(x)-1">>




Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

8d1h

unread,
Aug 5, 2021, 12:44:35 PM8/5/21
to TiddlyWiki
Hi,

Just for information, I manually updated my local KaTeX to the latest version (simply copy the files to the correct location) and everything seems to work nicely.

8d1h

unread,
Aug 5, 2021, 12:58:11 PM8/5/21
to TiddlyWiki
Hi,

Personally I'd prefer the KaTeX macro since I'm more used to them, and they can be reused if you ever want to copy them to a LaTeX file.

And with the new improvement, the macro defined are available globally so you don't need to worry if they are in the scope or not.

Also I mapped \bA-Z, \cA-Z, \fA-Z to \mathbf{A}, \mathcal{A}, \mathfrak{A} respectively, and many other operators, e.g. \Id to \operatorname{Id}, which is really convenient.

But based on usage, TW macro may also be very useful (e.g. you can create multiple equations, and even texts and other stuff, within a single TW macro.
Reply all
Reply to author
Forward
0 new messages