Mathjax does not render properly


A common problem I face almost everyday is Anki not rendering MathJax properly, that is \( … \) will be shown as text. The problem is not unique to me, and is caused by HTML formatting being included between \( \). A partial workaround to this problem is using this add-on Correct mathjax by removing HTML formatting - AnkiWeb, but it is not perfect. In order to use the add-on one has to first add a card, and then go to the browser. This is not optimal as when dealing with long mathematical expressions it is usually necessary to preview the card to detect any mistakes before adding it.

As I use MathJax everyday, I often face this problem and it is incredibly frustrating.

Is there a way to solve this for good? I know that using Latex should solve the problem, but Latex looks terrible on a Anki card, really ugly.

By the way, I am using Anki 2.1.40. If this was already solved in recent versions of Anki, please let me know. I have not updated fearing losing some add-ons.

If this was not solved in recent versions, I hope the developers are aware of this and try to find a solution, I don’t think I am the only one in this situation.

Thank you.

That’s correct, but why are there any HTML tags within your Tex commands in the first place?


  • Do not format the text (e.g. background-color, bold, italic etc.), because this will result in HTML tags being added into your commands.

  • Ctrl/Cmd + R will strip the formatting of any text you have selected.

Your problem will not be solved by updating. Anki has updated to MathJax 3 some time ago and there are some MathJax 2 features that are not yet implemented in MathJax 3. But it renders faster.


Thank you for your answer.

There are no reasons for HTML tags to be within my Tex commands, because I am not formatting the text within \(… \). It happens randomly, sometimes MathJax works, sometimes it doesn’t.