MathJax renders differently in Review and Note Editor

On Anki Desktop Mac, MathJax code including the string ‘}}’ renders in the Note Editor, but doesn’t render in Review.

The fix for now is to space out closing curly braces: replace ‘}}’ with ‘} }’. This fix is not obvious, because the cards render fine when being edited.

It would make sense to have consistent behavior.

If it’s not possible to allow ‘}}’ within MathJax to render in Review, it would make sense to have it not render in Note Editor too, so users can notice and fix that MathJax issue while creating their cards.

Is this when you’re using cloze with MathJax? That issue is explained here – Math and Symbols - Anki Docs .

The problem with changing the functionality in the way you suggest is that the conflict doesn’t happen until the cloze card is rendered. When you’re in the field of the note, in the note editor, it’s just fine to use the double-braces. The field doesn’t know how it’s going to be used in a card template. I’m not sure there’s any way to get you the behavior you want, unless we stop allowing MathJax/LaTeX to be closed with }}, and only allow } } – which would cause errors for everyone else.

Other than just remembering this issue when you’re using cloze and MathJax together, you can try keeping Preview open next to the editor, so you can spot errors in the rendered cards. If you have a lot of cloze + MathJax notes already, you might be able to clean this up in your collection with some Find-and-Replace. But you’ll have to be very careful that you’re only putting spaces in for MathJax double-braces, not for cloze double-braces.

The next major release will have better handling of this: Fix premature closure of cloze when inside MathJax by athith-g · Pull Request #4612 · ankitects/anki · GitHub

Will this only handle this for MathJax? Or will it workfor LaTeX as well?

Only MathJax.