8
$\begingroup$

[Question edited on 5/28/16] I have read this link. But I still don't understand how to color the text a sentence. Can one actually do that?

  • Could anyone give an example for coloring the text? a sentence?
  • Where should I go when I have the similar formatting question?
$\endgroup$
2

2 Answers 2

7
$\begingroup$

$\color{blue}{\textrm{One can color text}}$ by writing

$\color{blue}{\textrm{One can color text}}$

$\endgroup$
5
  • 2
    $\begingroup$ This is a poor way to do it. If you now already felt the need to bump this old thread for adding this answer you could at least include a solution that does not use a font different from the one used for actual text. $\endgroup$
    – quid Mod
    May 29, 2016 at 1:26
  • 2
    $\begingroup$ Actually, I don't understand the discussion under the answer of Mariano. And neither your comment. What do you mean by "a font different from the one used for actual text"? $\endgroup$
    – user9464
    May 29, 2016 at 1:29
  • $\begingroup$ It is not the same font. What is unclear about this. Look closely and you will see it is not the same. And on the "text": you included a math environment, this is not text anymore. $\endgroup$
    – quid Mod
    May 29, 2016 at 1:32
  • 5
    $\begingroup$ Ah, so the point is that the answer depends on how I phrase my question. If one wants to color some words, then he/she can use the math environment. But no way to color text. I have never understood this until today. Thanks a lot for your comment! $\endgroup$
    – user9464
    May 29, 2016 at 1:41
  • $\begingroup$ Yes. Coloring text is not supported. However, using MathJax it is possible to introduce color "through the backdoor." There are however several disadvantages to using it in this way, it is therefore discouraged to do what you recommend in your answer. A slightly better way is explained in meta.math.stackexchange.com/questions/20503 But one still should not used it to insert color all over. $\endgroup$
    – quid Mod
    May 29, 2016 at 1:45
3
$\begingroup$

You cannot color text. That can be deduced from the post you linked to.

$\endgroup$
9
  • 23
    $\begingroup$ $\rm \color{red}{BUT}\color{green}{\ YOU}\color{blue}{\ CAN!} $ $\endgroup$ Jul 9, 2011 at 1:25
  • $\begingroup$ @Bill: I made the same point a few hours ago. But in order not to encourage it I removed my comment. (I agree that Mariano's answer invites such a comment but I'd be surprised if he hadn't known about that trick) $\endgroup$
    – t.b.
    Jul 9, 2011 at 2:09
  • 1
    $\begingroup$ I even object to \rm, in fact :) A mismatch set of fonts is never nice on the eye... let alone if they are randomly colored! $\endgroup$ Jul 9, 2011 at 2:11
  • 4
    $\begingroup$ @Bill: Mariano explicitly stated "text". You did not color "text". :) $\endgroup$ Jul 9, 2011 at 10:16
  • $\begingroup$ @Willie But it is TeXt! For the rare occasions one needs such, this kludge usually suffices. $\endgroup$ Jul 9, 2011 at 13:24
  • $\begingroup$ @Mar RGB is not random. Nor is anyone recommending fruit salad text or "mismatched" fonts. $\endgroup$ Jul 9, 2011 at 13:31
  • 1
    $\begingroup$ @Bill: Did you do that in the $$ environment? $\endgroup$
    – user9464
    Jul 21, 2011 at 0:28
  • 4
    $\begingroup$ @Jack Yes, I used the LaTeX \color command. $\endgroup$ Jul 21, 2011 at 1:27
  • $\begingroup$ $\rm\color{pink} {\pi} $ $\endgroup$ Jul 16, 2020 at 15:18

You must log in to answer this question.