# Display characters with accent properly in MathJax

**URL:** <https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048>\
**Category:** Help\
**Created:** [September 15, 2026, 2:37pm UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048 "2026-09-15T14:37:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsar](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jsar](https://forums.ankiweb.net/u/jsar)\
**Post date:** [September 15, 2026, 2:37pm UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/1 "2026-09-15T14:37:03Z")

</div>

- _Software version : Anki 26.09 (and previous)_
- _OS : Windows 11 (25h2), Intel processor_
- _Add-ons installed :_
  - _Anki Spell Checker_
  - _AnkiWebView Inspector_
  - _Customize Keyboard Shortcuts_
  - _Editor Live Preview_
  - _Symbols as you type_

Hi!

First, please excuse me for my bad english.

I’m a daily user of Anki, but I’ve got an annoying issue with mathjax. When I try to input a character with accent (such as é, à, ê, and so on), Mathjax displays the letter in another font, and tinier than the others, leading to an awful result (cf. screenshot below).

I’ve tried many macros, but none of them worked for me. I even tried to change the MathJax font (following advices from messages in many forums and some LLMs). I tried in safe mode, too.

Did someone find a way to solve this ?

Thank you in advance to any one who may be able to give me some ideas.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/a/6/a65655a9b5ef34efcef6fe0082b1b7363ea822a9.png)

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [September 17, 2026, 8:20pm UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/2 "2026-09-17T20:20:40Z")

</div>

1. It looks like you’ve got examples of 2 different accent methods mixed together in your screenshot. If one is the problem, is there a reason not to just use the other one?

2. Please include your MathJax string _ **as text** _ instead of a screenshot – ``in a preformatted-text/code-block`` (by putting backticks before/after).

3. MathJax in Anki should work similarly to MathJax anywhere else, so are these characters that you’re able to display correctly elsewhere?

> [@jsar](#):
>
> I’ve tried many macros, but none of them worked for me.

1. It’s probably most useful if you tell us what you’ve tried, so no one duplicates the same advice.

---

<div class="post-metadata">

**Author:** ![jsar](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jsar](https://forums.ankiweb.net/u/jsar)\
**Post date:** [September 18, 2026, 1:10pm UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/3 "2026-09-18T13:10:36Z")

</div>

Hi @Danika_Dakika,

Thanks for your suggestions. I’m a new-coming user, so I’m not used to the way I should write my questions.

1. Sorry, I’ve shown two different methods to input accents : the first one (`\text{Prévalence}`) is the way I usually do, and the second (`Nombre\ de\ cas\ r\acute{e}pertori\acute{e}s\ \grave{a}\ un\ instant\ T`) is the main solution I’ve found on internet forums (for example stackexchange). I find the second result ugly, especially with grave accents, and it’s not as simple to type for me as a g.o. `\text{}` command.
2. Here’s the complete code shown in the screenshot (example) : `\text{Prévalence} = \frac{Nombre de\ cas\ r\acute{e}pertori\acute{e}s\ \grave{a}\ un\ instant\ T} {\text{Population générale à cet instant } T}`
3. I’m not used to MathJax, except in Anki. I tried many viewers online, and some of them works fine (for example https://saxarona.github.io/mathjax-viewer/) and others don’t (for example https://latexeditor.lagrida.com/) (cf. screenshots).
4. For the macros, I asked Mistral and Gemini AI (free versions), so I can’t exactly find what macros they gave me. But it was mainly about changing the text font. I can ask them again if needed.

Thanks again, and have a nice day,

Jsar

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/5/c5e0b17bcbd6821bd6ad333ce0f97923e79dd36f.png)  
_Lagrida_

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/7/0/705611777f63e6887dfdedee663b3a82d05aecd1.png)  
_Saxarona_

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [September 18, 2026, 2:23pm UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/4 "2026-09-18T14:23:46Z")

</div>

I don’t think this is an Anki issue. Instead, it seems to be a MathJax issue. As I understand it, MathJax chooses the fonts it uses, specifically changing the font size of accent characters and accents to fit in with the surrounding text.

I tried to experiement MathJax’s `minScaleAdjust` [per this discussion](https://github.com/mathjax/MathJax/issues/122#issuecomment-1274138) and `matchFontHeight` variables, but I was having difficulty in Anki when following the [Customizing MathJax instructions in the Anki FAQ](https://faqs.ankiweb.net/customizing-mathjax.html). Specifically, every time I copied the `<script>` code block into the HTML editor Anki and tried to save, the text would disappear.

Actually, when I manually try to enter a `<script></script>` block in the Anki HTML editor, it disappears!

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [September 18, 2026, 3:46pm UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/5 "2026-09-18T15:46:43Z")

</div>

MathJax customization is not supported in the editor (at least without add-ons).

I wonder if MathJax 4 has improvements here. There’s an [open issue](https://github.com/ankitects/anki/issues/4277) but not much progress for a year.

> [@BenJamesBen](#):
>
> Actually, when I manually try to enter a `<script></script>` block in the Anki HTML editor, it disappears!

Script execution in the editor is not allowed for security reasons.

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [September 19, 2026, 2:19am UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/6 "2026-09-19T02:19:04Z")

</div>

Thanks. It looks like that the Anki FAQ needs to be updated to remove the Customizing MathJax section.

I don’t think there is any way to style MathJax output easily. Looking at the DOM, I see that MathJax hardcodes a lot of its styling. For example from the OP’s example equation, this is the DOM for the letters “Prév”. You can see that the font-size is hardcoded to 84% for the “é”:

 ![Screenshot 2026-09-18 at 7.06.22 PM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/4/b4c246d077d9752c9c7f3979b2d8eb98411f58b5.png)

And, this is the DOM for the “à” in the top numerator:

 ![Screenshot 2026-09-18 at 7.05.11 PM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/a/7/a7286ff6e1554a4a05dd880aa38fc00be15a0a34.png)

I suppose you could add CSS styling for various “mjx-\*” classes to try to affect how things look. However, I think it would be a lot of tedious micromanaging, possibly requiring changes on a card-by-card basis, just to tweak how the equations look.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [September 19, 2026, 8:32am UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/7 "2026-09-19T08:32:04Z")

</div>

> [@BenJamesBen](#):
>
> It looks like that the Anki FAQ needs to be updated to remove the Customizing MathJax section.

The FAQ only shows customizing the macros though, and that should still be working?

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [September 19, 2026, 8:37am UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/8 "2026-09-19T08:37:28Z")

</div>

> [@BenJamesBen](#):
>
> It looks like that the Anki FAQ needs to be updated to remove the Customizing MathJax section.

It sounds like you were trying to put those scripts in the note field instead of the card template.

---

<div class="post-metadata">

**Author:** ![BenJamesBen](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@BenJamesBen](https://forums.ankiweb.net/u/BenJamesBen)\
**Post date:** [September 20, 2026, 2:35am UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/9 "2026-09-20T02:35:48Z")

</div>

Thank you, all. I didn’t understand what the instructions in the FAQ were telling me to do.

@jsar , I have a suggested combination of 2 steps which might help to make MathJax appear the way you say you prefer:

1. Put this in your card template, to have MathJax not try to make the font smaller for accented characters:

```auto
<script>
MathJax.config.chtml['matchFontHeight'] = false;
if (typeof is_already_run == 'undefined') {
  is_already_run = true
  MathJax.startup.getComponents();
}
</script>

```

1. Don’t use the `\acute{}` and `\grave{}` commands to try to have MathJax construct accented characters. Instead, use the actual accented characters. From my testing, actual accented characters look better than the constructed ones.

Below are some examples from my testing, using this modified example MathJax equation:

```html
<anki-mathjax>\text{Prévalence} = \frac{Nombre\ de\ cas\ r\acute{e}épertori\acute{e}és\ \grave{a}à\ un\ instant\ T} {\text{Population générale à cet instant }\acute{e}é\grave{e}è\grave{a}à\acute {a}á \ T}</anki-mathjax>

```

 ![Screenshot 2026-09-19 at 7.11.35 PM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/f/2/f27104a452a60427f74c13b2ccb71f5a51fbf31b.png)  
 ![Screenshot 2026-09-19 at 7.12.14 PM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/2/4/241a8886d70b465573945ea1cb7c324eaba75b76.png)

(I note that the fonts are smaller when matchFontHeight=false, though I’m not exactly sure why.)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [October 20, 2026, 2:35am UTC](https://forums.ankiweb.net/t/display-characters-with-accent-properly-in-mathjax/71048/10 "2026-10-20T02:35:54Z")

</div>

Closed on October 20, 2026, 2:35am UTC

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