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 have a question: Is there any way to have math (everything between $s) in different colour than text (for example, green) in beamer?

share|improve this question
5  
Please have a look at How do I get different colors for math and for text. I suggest closing this question as a duplicate, at least if the beamer class would not make a difference. –  Stefan Kottwitz Dec 8 '11 at 9:52
7  
beamer has its own internal way of changing the colour for mathematics which is detailed in Section 17.3 of the manual. If this worked for what you have in mind then this would be an easier method than that given in the question that Stefan links to. –  Loop Space Dec 8 '11 at 9:59
    
Michal: Did Andrew's comment help answer your question? –  Torbjørn T. Dec 10 '11 at 20:42
    
@AndrewStacey: That looks like an answer to me... –  Peter Grill Dec 22 '11 at 3:40
add comment

1 Answer 1

Beamer has this functionality already built in. The beamer colours math text and its children math text inlined, math text displayed, and normal text in math text control the colour of mathematics in a beamer document. Section 17.3 of the beamer manual (version 3.12) has more details, note that they come with two warnings: one a "consider not doing it" warning and the other a "the implementation might break" warning.

An alternative method which is more robust but interacts less well with beamer's internal colour stuff is to use the unicode-math package (needs lualatex or xelatex) to load a font for mathematics with a specified colour. See Will Robertson's answer to my question Can I change the font and colour of a letter permanently? for details. Where the weakened interaction shows is with things like partially visible text in beamer: this is done by mixing colours at the time that the text is parsed, but with unicode-math then the colour is set once-for-all at the start and so can't be faded later on. (This is the solution that I use for this, by the way. To get round this interaction issue - which I don't encounter very often - I fade things by overlaying a partially transparent block instead of by mixing colours.)

share|improve this answer
add comment

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.