Latex and cloze cards

Hello,

I have created some cards with Latex for my students. I share them with an .apkg file, with “add media files” checked when exporting. The problem is that some cards make errors (no render) on the Anki desktop version, Ankiweb, and Ankidroid of some students. But on my computer and phone, everything is ok. It’s only when people import my desk. I’ve seen an issue on GitHub about this problem but it seems not to be fixed. Problem Latex cloze Ankidroid · Issue #7994 · ankidroid/Anki-Android · GitHub
I checked and it seems that only cloze cards with Latex make trouble. I used to write with the “[latex]” tag but I also tried with the “[$]” tag.
Moreover, I used to preview all cards before exporting the deck, as a consequence, I can’t use the “render Latex” method explained on the GitHub issue (the button is hidden).
Here are some tests I’ve done to try to understand :

Don’t work at all :

  1. [latex] Pour tout $x\in \mathbb{R}$, {{c1:: $\exp(-x)$ }} $=$ {{c2:: $\dfrac{1}{ \exp(x) }$ }} [/latex]

2) [latex] $\mbox{Pour tout } x\in \mathbb{R}$, {{c1:: $\exp(-x)$ }} $=$ {{c2:: $\dfrac{1}{ \exp(x) } $ }} [/latex]

→ [latex] tag doesn’t work with cloze card. But it works with basic ones.

  1. Pour tout [$]x\in \mathbb{R}[/$], [$] {{c1:: \exp(-x) }} = {{c2:: \dfrac{1}{ \exp(x) } }} [/$] print the first part but not the exp formula

  2. [$]\mbox{Pour tout } x\in \mathbb{R}[/$], [$] {{c1:: \exp(-x) }} = {{c2:: \dfrac{1}{ \exp(x) } }}[/$] print the first part but not the exp formula

→ tag must be inside the {{c1:: }}. Not very handy, I think.

  1. [$]\mbox{Pour tout } x\in \mathbb{R}[/$], {{c1:: [$]\exp(-x)[/$] }} [$]=[/$] {{c2:: [$]\dfrac{1}{ \exp(x) } [/$] }} the “x in R” doesn"t work (strange ?) but the exp formula does.

Work :
Pour tout [$]x\in \mathbb{R}[/$], {{c1:: [$]\exp(-x) [/$] }} = {{c2:: [$] \dfrac{1}{ \exp(x) }[/$] }} but there is no vertical alignement with the french part.

→ try to add the mbox tag to get vertical alignement

[$]\mbox{Pour tout } x\in \mathbb{R}[/$], {{c1:: [$]\exp(-x)[/$] }} [$]=[/$] {{c2:: [$]\dfrac{1}{ \exp(x) } [/$] }} works well but not very handy…

Is “render Latex” button a mandatory method ? Do we have to split the formula in many slices, and add the mbox tag to get alignment or is there a different way to use cloze cards ?
Thanks !

Please start by following When problems occur - Anki FAQs

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.