Latex with cloze

I have been using Anki for a few years and everything was working fine.
However, for some time now, when I want to create a “cloze” type card I am having a problem with Latex.
When creating on Windows PC, everything works fine. But when I export and open the card on Ankidroid, the Latex code is not recognized. I am not having this problem with a Basic card.
Can you explain me the problem ?

AFAIK, AnkiDroid can’t directly render latex. You have to generate images from the desktop client and export/sync them to AnkiDroid.

Did you check the Include media option when exporting?

I recommend using mathjax instead of latex if it’s enough for you since it works out of the box both on Anki and AnkiDroid.
Please see Anki Manual

Every time I export a package to Ankidroid, I check “include media”, so that’s not the problem.
The Latex image display problem is only for “cloze” type cards.
A few months ago, I had no problems, these cards worked but the new ones created did not.
I use Latex with Miktex to write my lessons so I would have liked to have an answer with Miktex so as not to embark with mathjax.
Thanks for the help

I think the $...$ syntax is not supported in Anki. I don’t know how this works in the Basic type. I think the default delimiters can be changed but this is not guaranteed to work AFAIK.

Does using [$]...[/$] instead work?

Also the manual section about cloze conflicts could be relevant.

It looks like an AnkiDroid bug. I suggest you move a single problem card to a different deck, export it and share it somewhere to make it easy for developers, and then maybe @ArthurMilchior might have an idea.

1 Like

Thanks dae for mentionning me. LaTeX on ankidroid is clearly a place where I may be more competent than most.
Given that @wapiti33 already reported it on our github Problem Latex cloze Ankidroid · Issue #7994 · ankidroid/Anki-Android · GitHub I’ll answer there, since it seems to be an AnkiDroid related issue

À plus sur l’autre site


When an image is missing, ankidroid renders the source as it is sent to the compiler, i.e. with $, $$, or \[. It’s a choice that can be discussed, as a mathematician used to LaTeX I find it more elegant than showing []. But it probably does not mean that "" appear directly in text (otherwise the anki screenshot would fail too)

1 Like