So I wanted to write down a definite integral from say a to b but I want a to be red and b to be green. I tried using:
\int_{a}^{b} and it works great, but when I add color using \usepackage[dvipsnames]{xcolor} like
\int_{color{red}a}^{color{green}b} b breaks out of the integral and becomes an exponent
also when I only add color to b like
\int_{a}^{\color{green}b} a becomes green too instead of just b
does anyone know how to fix it?
\documentclass{article} \usepackage[dvipsnames]{xcolor} \begin{document} \begin{equation} \int_{\color{red}a}^{\color{green}b}f(x)dx \end{equation} \end{document} 

{{\color...}}the superscript brace does not scope the color (or use\mathcolor{red}{a})