Jwrede / Anki-KaTeX-Markdown

Creates a new Basic and a new Cloze Note Type that support Markdown and KaTeX
74 stars 5 forks source link

Where to store persistent KaTex macros #6

Closed toomey8 closed 3 years ago

toomey8 commented 3 years ago

This is fantastic! Apologies as this is something of an edge case but I make extensive use of KaTex macros.

I can define them on the cards themselves, i.e. placing $\gdef{\foo}{x^2}$ on the card itself, but wonder if you know where in the template one could store these (I have 40 or so I make regular use of) and if it's possible to extend support for macros in general.

For reference:

I'm having trouble parsing if these should be in a script tag, wrapped in $...$ in a \gdef etc. Any pointers?

Thanks again, this is a fantastic plugin!

Jwrede commented 3 years ago

image I marked the region where you can put your macros, remember to always put a double backslash!

One problem is that you'll have to do a copy of the card template because if I update the Add-on the Card template will change. That's one thing I'll definitly have to improve, maybe I'll add a text file to the add-on where you can add macros, there are some other bugs i'll have to fix as well but I've got a pretty intense uni phase right now so this'll probably take one or two weeks, I hope this is enough for now. If you need help with creating a copy of the template please tell me!

toomey8 commented 3 years ago

thanks! this works like a charm. I was able to get this to work. I'm not sure how much of an edge case defining macros but I agree that it would be nice to have an external plain text file for them. That's what I'm maintaining anyway, and it's not too much of a bother.

Thanks, again, this is perfect!

Jwrede commented 3 years ago

Perfect, please consider rating the add-on as this is sadly the only way by which Anki ranks add-ons on its page! If you got any other bugs / got any other suggestion on how to further improve the add-on please add another issue, I'll collect them and do a slightly bigger update soon.