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.

Hello I'm writing a beamer presentation and I would like to change the colour of the text in the theorem block from one place and it will affect my whole presentation.

Is this possible?

My example:

\documentclass{beamer}

 \usetheme{Madrid}

 \usecolortheme[RGB={201,20,35}]{structure} 
 \setbeamercolor{background canvas}{bg=black}
 \setbeamercolor{normal text}{fg=white} 
 \setbeamercolor{theorem text}{fg=black} 

 %\useoutertheme{shadow}
 \useinnertheme{rounded}

 \usepackage[utf8]{inputenc}
 \usepackage{default}

 \begin{document}

 \begin{frame}{Primul Slide}

 Bla bla bla 

 Bla bla bla 
 \begin{theorem}
 This is a theorem it is very important!!
 \end{theorem}

 \end{frame}

 \end{document}
share|improve this question
1  
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Claudio Fiandrino Dec 16 '12 at 15:16

1 Answer 1

up vote 4 down vote accepted

One possibility would be to set the block body and/or block title colors to produce the desired result; since the modification must affect only theorems, the etoolbox package can be used to patch the required environments; a little example using the settings provided in the question:

\documentclass{beamer}
\usepackage{etoolbox}

 \usetheme{Madrid}

\usecolortheme[RGB={201,20,35}]{structure} 
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white} 

\AtBeginEnvironment{theorem}{%
  \setbeamercolor{block body}{fg=black,bg=blue!40}
}

\begin{document}

\begin{frame}{Primul Slide}
test text
\begin{theorem}
This is a theorem it is very important!!
\end{theorem}
\end{frame}

\end{document}

enter image description here

Notice that I suppressed

\setbeamercolor{theorem text}{fg=black} 

from the original code and changed the font color using

\setbeamercolor{block body}{fg=black,bg=blue!40}
share|improve this answer
    
Sorry when I used your code, first I can't use it before I begin the document but when I place it in the document it says it doesn't recognize \AtBeginEnvironment as a control sequence. –  George Bora Dec 16 '12 at 16:23
1  
@GeorgeBora please see my updated answer. –  Gonzalo Medina Dec 16 '12 at 19:55
    
Ok so I foolishly thought I had etoolbox installed by default on Kile, I was wrong one quick trip to Ubuntu's synaptic manager to install the package and it works, I'm betting your first answer also worked. –  George Bora Dec 17 '12 at 19:14

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.