I found it's tricky to colorize a sub-expression of an expression that changes to a different expression when it is evaluated.
For example, if I replace s with Style[s,Red]
in
$$
\sum_{k=1}^{n}k^{-s}
$$, I get HarmonicNumber[n,s]
with s colored red.
The solution I found is to evaluate Style[s,Red]
in another line and use copy-paste to replace the s in the original expression.
Is there any better way?
k
's to red: i.stack.imgur.com/QWZtP.png or i.stack.imgur.com/RxJN3.png -- I suppose you did this: i.stack.imgur.com/hBxLA.png -- but it has the same problem as @BobHanlon's answer. $\endgroup$