Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am editing a LaTeX paper with Emacs. Sometimes, just for myself, I want to make a block of texts less obvious (or less important to see). Instead of totally hide them, I still want them to be there. So I am wondering if there is an easy way to embed them in something so that it changes color (to grey for instance) and looks less important.

Could anyone help?

By the way, besides changing color, do you have other suggestions for this kind of need (making easily a block of texts look less important)?

share|improve this question

1 Answer 1

up vote 51 down vote accepted

You can use the xcolor package. It provides \textcolor{<color>}{<text>} as well as \color{<color>} to switch the color for some give text or until the end of the group/environment. You can get different shades of gray by using black!x as a color where x is a number from 0 to 100, taken as a percentage.

share|improve this answer
    
great, \color{<color>} is what i need, thank you very much! –  SoftTimur May 1 '11 at 18:13
    
Just one thing, what if my block of code is embedded in \begin{align*} and \end{align*}, which is under math mode. \textcolor... or \color... work on a single word, but not on a block of words... –  SoftTimur May 1 '11 at 23:27
2  
No, \textcolor{green}{a couple of words} colors the entire second argument. \color{green} is a declaration, which changes the text color of everything that follows (in that scope, or group as its called in TeX). It is analogous to \textbf versus \bfseries. \color should also work in math mode. But some of the amsmath environments do rather complicated things in order to work (reading the contents several times, for example). But then you could try `{\color{green} \begin{align*} blabla \end{align*} } (note the outer braces). –  Villemoes May 2 '11 at 0:40
    
@SoftTimur: Like Villemoes said, \color should work in mathmode. It would be best if you give an example so we can see where the problem lies. You could edit your question for this. –  Martin Scharrer May 2 '11 at 8:39
    
I am using this right now and the color is not changing back even though I a using the form that should color only a few words. –  Elliot Apr 22 '13 at 18:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.