How to change the text color with LaTex

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 9K views
mcastillo356
Gold Member
Messages
666
Reaction score
365
TL;DR
I want to edit and introduce color, to correct a misleading detail
Isn't it $$\color{red}x\color{black}y$$
 
Physics news on Phys.org
Rather than define the colors of the highlighted text and then respecify the normal colors of the original text [which can be tedious]
as you did in
Code:
\color{red}x\color{black}y
use braces around the highlighted text to change that to the highlighted color.
Code:
\color{red}{(x+1)} y
[itex] \color{red}{(x+1)} y[/itex]

or to be fancy
[itex]\color{red}{ \stackrel{\rm incorrect} {(x+1)}} y[/itex]
(right-click to see the code)
 
Last edited:
  • Like
Likes   Reactions: jim mcnamara and mcastillo356