How to change the color of equations in MathJax

I use the following snippet to display equations on my blog

<script src='http://www.mathjax.org/mathjax/MathJax.js' type='text/javascript'> 
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
    tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
  });
</script> 

and I would like to change the color of the equations to white because my background is somewhat dark, how can this be done?

+3
source share
2 answers

Do it:

.MathJax_Display {
  color: #FFF !important;
}

It seems to work for me.

+5
source

Equations must inherit styles from ancestor elements, like any normal element. You can try something like the following:

<head>
 <style>.equation { color: white; }</style>
</head>
<body>
 <span class="equation">$ax^2+bx+c$</span>
</body>
0
source

Source: https://habr.com/ru/post/1769874/


All Articles