I would like to create Anki cards by entering mathematical formulas in the Latex environment. When I select “Latex” when creating an Anki-card, "[latex][/latex] is inserted. When I enter my content, I get the following error message: “LaTeX image generation is disabled in the preferences.” and my content is not compiled. But if I enter mathematical formulas using the command “\(” and “\)”, they are compiled correctly. I installed Texmaker and Miktex. What could be the reason that Latex isn’t working?
I couldn’t find more about the introduction of that Prefs toggle than that pull request. I was surprised that the toggle is off by default, because it changes the behavior LaTeX users are used to.
Am I understanding correctly that some security restrictions needed to be removed – making LaTeX image generation less secure? And that’s why the toggle needs to default to “off” – so that users need to opt-in to using LaTeX in what is now a less-secure way? I’m predicting more questions about this – so I want to understand what I can.
@Danika_Dakika we had some existing code that tried to prohibit malicious LaTeX, but it turned out not to be comprehensive. There are some legitimate use cases for the commands we were blocking, so it didn’t make much sense to continue to block them when we have this new option.
A global toggle is not without its own downsides. There’s a risk users will toggle it accidentally, or enable it, forget about it, and download shared decks months later. But given that it doesn’t seem to be practical to guard against all malicious LaTeX, or invoke LaTeX in a sandbox across all the platforms, I didn’t see many alternative options other than dropping LaTeX completely.