This question already has an answer here:

I’m using article class, and I want to change colour within the equation tag, multiple times. I found that using mathmode I can change colour, but I want to use equation tag instead. After having the multicolour equation I will link the file to a beamer for a presentation.

Is this possible (successfully linking changed colours from article to beamer as well)? If so, how?

So in my imagination it must be like in the visual. The visual is from

$ \color{yellow} A = \textcolor{blue}{B} \mathbin{\textcolor{red}{-}} \textcolor{green}{C} $

enter image description here However, I need for example below. This doesn’t work for me.


marked as duplicate by AboAmmar, Phelype Oleinik, Troy, Stefan Pinnow, Sebastiano May 21 '18 at 20:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.