# How to change the text color with LaTex

## Summary:

I want to edit and introduce color, to correct a misleading detail
Isn't it $$\color{red}x\color{black}y$$

Related MATLAB, Maple, Mathematica, LaTeX News on Phys.org
phinds
Gold Member
2019 Award

mcastillo356
robphy
Homework Helper
Gold Member
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
$\color{red}{(x+1)} y$

or to be fancy
$\color{red}{ \stackrel{\rm incorrect} {(x+1)}} y$
(right-click to see the code)

Last edited:
jim mcnamara and mcastillo356