MathJax Macros on AnkiMobile

I am considering buying Anki Mobile on iOS, but my main concern is whether my cards will work on there. I use MathJax a lot on my cards and have some macros defined in my card templates using the following code:

<script>
MathJax.config.tex.macros = {
N: "\\mathbb{N}"
};
MathJax.startup.getComponents();
</script>

Does anyone know if this will work on Anki Mobile or would anyone who has Anki Mobile be willing to test it for me please? It is quite expensive to purchase not knowing whether all my cards will break or not. Thank you!

I took the hit and bought it and luckily it worked! Answering here in case anyone else has this question in the future.

Please note that calling getComponents() multiple times can cause MathJax to bug out, so it’s best to only call it once, using something like:

if (!haveLoadedMathjax) {
  // ... do mathjax initialization
  
  var haveLoadedMathjax = true;
}

You pre-empted my next question as I was wondering why my MathJax had started disappearing - that fixed it, thank you!

1 Like

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