Following this page, I try to set a color for a simple equation into a div container.
Here is an example on this jsfiddle link
It seems that equation (and so color) is not interpreted and I don't know how to make it rendered.
JS :
MathJax.Hub.Config({
messageStyle: "none",
TeX: { equationNumbers: {autoNumber: "all"}},
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']],
displayMath: [ ['\\begin{displaymath}','\\end{displaymath}'], ['\\begin{equation}','\\end{equation}'] ],
processEscapes: true,
preview: "none"
}});
MathJax.Hub.Config({ TeX: { extensions: ["color.js"] }});
HTML :
<div id="containerMath">
$\definecolor{energy}{RGB}{0,0,172}
\color{energy} ax+b=c$
</div>
Anyone has already experimented colors for Mathjax fonts ?
You need to specify the type of the
script
tag astext/x-mathjax-config
where you are defining you mathjax configeg:
updated fiddle: https://jsfiddle.net/18vyyvrk/28/ EDIT: in the fiddle I also changed the script to load
onDomready