Your conclusion is correct. You can make things easier, perhaps, by
defining your own macro, such as
\newcommand{\colormath}[2]{\colorbox{#1}{\(#2\)}}
so that you can use
\colormath{yellow}{x^2}
and not have to worry about the delimiters in the second argument.
You can include this definition in your configuration by adding
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
Macros: {
colormath: ["\\colorbox{#1}{\\(#2\\)}",2]
}
}
});
</script>
in your page just before the script that loads MathJax.js itself.
Hope that helps.
Davide
On Dec 2, 2012, at 10:55 PM, <
saf....@gmail.com>