# Mathjax Configuration via Cards Template Not Working

**URL:** <https://forums.ankiweb.net/t/mathjax-configuration-via-cards-template-not-working/9339>\
**Category:** Help\
**Created:** [April 17, 2021, 12:29pm UTC](https://forums.ankiweb.net/t/mathjax-configuration-via-cards-template-not-working/9339 "2021-04-17T12:29:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hkr](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@hkr](https://forums.ankiweb.net/u/hkr)\
**Post date:** [April 17, 2021, 6:09pm UTC](https://forums.ankiweb.net/t/mathjax-configuration-via-cards-template-not-working/9339/2 "2021-04-17T18:09:35Z")

</div>

Maybe you read the section [Customizing MathJax](https://faqs.ankiweb.net/customizing-mathjax.html) on the Anki FAQ page, but this article seems to be for older versions of Anki, not for recent versions. The version of MathJax that ships with Anki used to be 2.x, but has been updated to 3.x in recent versions, including AnkiDroid and AnkiMobile. See the following thread on how to customize MathJax 3.x with Javascript.

> [@Configure MathJax Macros on macOS](https://forums.ankiweb.net/t/configure-mathjax-macros-on-macos/6535):
>
> I am using the built-in MathJax support to render math for a while, on both macOS desktop and iOS mobile application. Recently I would like to introduce several shortcuts, so following [this](https://www.reddit.com/r/Anki/comments/btqz3m/custom_mathjax_macros_on_desktopandroid/) I add this script at the beginning of both the front side and the back side in the card template: \<script type="text/x-mathjax-config"\> MathJax.Hub.Config({ TeX: { Macros: { R: ['{\\mathbb {R}}'] } }, }); MathJax.Hub.Configured(); \</script\> But after this typing \R in…

However, I would strongly recommend that you do NOT change the standard MathJax delimiters( `\( ... \), \[... \]` ), as described in the FAQ above.

As for changing the font size and color only for the MathJax block within a specific class, I think you can do it using CSS as you did in version 2.x. But, the HTML tags and classes used by MathJax are different between 3.x and 2.x. You can use Google Chrome to inspect the webview of the card screen so you can see what tags and classes MathJax uses.

> [Introduction - Writing Anki Add-ons](https://addon-docs.ankiweb.net/#/porting2.0?id=webview-changes)
> 
> - You can now debug the webviews using an external Chrome instance, by setting the env var QTWEBENGINE\_REMOTE\_DEBUGGING to 8080 prior to starting Anki, then surfing to localhost:8080 in Chrome.

(Sorry for my poor English. I hope that makes sense.)

---

_[View the full topic](https://forums.ankiweb.net/t/mathjax-configuration-via-cards-template-not-working/9339)._
