How to change the text color with LaTex

  • #1
133
44

Summary:

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

Answers and Replies

  • #2
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
16,343
6,539
how about xy
 
  • Informative
Likes mcastillo356
  • #3
robphy
Science Advisor
Homework Helper
Insights Author
Gold Member
5,672
941
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 jim mcnamara and mcastillo356

Related Threads on How to change the text color with LaTex

Replies
1
Views
7K
Replies
2
Views
883
Replies
2
Views
14K
  • Last Post
Replies
2
Views
7K
  • Last Post
Replies
2
Views
40K
Replies
11
Views
14K
  • Last Post
Replies
5
Views
22K
  • Last Post
Replies
1
Views
6K
Replies
3
Views
17K
Top