# Is there simple way to color latex equations?

Is there simple way to color background, highlight some parts of background, equation or some parts of equation? something like these Latex codes:

1. {\bgcolor{color name}{equation}} or {\bg{color name}{equation}} for background

and

1. {\color{color name}{equation}} or {\mathcolor{color name}{equation}} to color equations

examples:

• by this code $a^2 + {\color{red} b^2}=c^2$ b^2 must become red

• and by this one $a^2 + {\bg{red}b^2}=c^2$ its background must become red.

• Why not work with these very LaTeX codes? Do they bother you to use them? Don't know about 1 but 2 renders output. – user36790 Jul 11 '16 at 16:31
• @MAFIA36790 they don't work for background $\color{red} a^2$ – Achmed Jul 11 '16 at 17:02
• use \color{red}{a^2}; you need to complete the brace. – user36790 Jul 11 '16 at 17:10
• @MAFIA36790 ok I'll check for that, how about background, How to highlight whole or a part of background? – Achmed Jul 11 '16 at 17:14
• @MAFIA36790 I checked it but don't work for mathematical equations – Achmed Jul 11 '16 at 17:21
• What were your codes? \color{red}{a^2} works fine at any MathJax-enabled site of SE. – user36790 Jul 11 '16 at 17:27
• Also, as I said earlier, you need to complete the braces. – user36790 Jul 11 '16 at 17:29