I have a good reasons for not using Mathjax:
- I want LaTeX on mobile. IDK if there is such a thing as mathjax on android, but it is probably longer to setup than juste compile the whole collection on computer;
- I may have equations that are computation-heavy. You may know that LaTeX compilation may take up to some seconds when you are compiling long equations, and I don’t want to wait that long on each note;
- I have already setup LaTeX configuration (the real binary, not the Anki’s LaTeX config) for custom packages, etc. so I don’t want to do that again with Mathjax.
I think that this technical reason is not that valid. I mean, yes, Anki would have to parse all templates. And then, how is that a problem? Just put in a loop. I don’t really see why is it complicated. The number of templates is very small comparing to the number of notes, and even the number of cards is of the order of fields in the note (usually – one might think of degenerate cases in which the number of cards is not θ(nb of fields), but rather Ο(2^(max nb of fields per card)*nb of cards), but I think one safely might assume the number of fields per card is (a small) constant).
Finally, I have an other issue with your solution, and it is that one cannot have LaTeX code that does not depend on the field content, without generating it on-the-fly, and this is ridiculous: if there is one thing that would be efficient, it would be render all the static parts for a given note type once and for all! You might argue that there is almost never the need of such static content, but I actually have . Think about when you create a specific template that adds a bit of context to some notes, so that you don’t have to fill in every field with that context (for example, consider a deck with primitive questions: your note types might have two fields, one for the function to primitive, and the other with the answer. Your template might have one card with \int {{Derivative}} dx
as a question, and {{Primitive}}
as answer, and an other card with \frac{d}{dx}{{Primitive}}
as a question, and {{Derivative}}
as the answer. How could I have the same result, with the same amount of work – almost none– without allowing latex on templates?).
PS: the last example is a bit of a fraude in the sense that the content is not exactly static, and could not be pre-compiled, but it still IMO points out a flaw. I am quite sure you could find a similar example with real-static content.
Finally, I might say that if some users really don’t like the idea of a per-card media checking, you might just add a checkbox in the options to turn on this feature (maybe a per deck option, or a per note type option, IDK).
EDIT: just thought of an example of static content: a \qed at the end of proofs.