I want to color some of the symbols in math mode, but not their subscripts. However, when I do this, the subscripts are broken and escapes from the text.
I have prepared a minimal example to demonstrate my problem:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
$T_i$
${\color{red}T}_i$
$\textcolor[rgb]{1,0,0}{T}_{i}$
\end{document}
The result is:
Note that, T and i are separated when T is colored. Is there a way to color properly without adding extra space on the subscript?