最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to change equations color in MathJax - Stack Overflow

programmeradmin2浏览0评论

I'm using the following snippet to display equations on my blog

<script src='.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 equations color to white because my background is somewhat dark, how can this be done?

I'm using the following snippet to display equations on my blog

<script src='http://www.mathjax/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 equations color to white because my background is somewhat dark, how can this be done?

Share Improve this question edited Aug 24, 2012 at 9:09 Zerium 17.4k32 gold badges118 silver badges187 bronze badges asked Oct 16, 2010 at 13:39 ubugnuubugnu 1,0822 gold badges16 silver badges31 bronze badges 1
  • Thank you for your answer, since my question dates from 2 years, I remember that I found a solution and I don't remember which it is. I suspect that it was the solution you give. Thank you again. – ubugnu Commented Aug 25, 2012 at 19:58
Add a ment  | 

2 Answers 2

Reset to default 5

Do this:

.MathJax_Display {
  color: #FFF !important;
}

It seems to work for me.

Equations should inherit styles from ancestor elements, just like any normal element. You could try something like the following:

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

评论列表(0)

  1. 暂无评论