Document Classesbeamer | Change Color of Theorem Block

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

beamer | Change Color of Theorem Block

Post by omer21 »

How can I change the background colors at 1 and 2 in the attached picture.

Thanks.
Attachments
beamer-theorem-block.jpg
beamer-theorem-block.jpg (16.02 KiB) Viewed 26913 times
Last edited by localghost on Tue Jan 08, 2013 8:11 pm, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

beamer | Change Color of Theorem Block

Post by Stefan Kottwitz »

Theorems use the block title and block body colors. You can change it via \setbeamercolor, for example:

Code: Select all

\documentclass{beamer}
\usetheme{Madrid}
\setbeamercolor{block title}{use=structure,fg=white,bg=red!75!black}
\setbeamercolor{block body}{use=structure,fg=black,bg=red!20!white}
\begin{document}
\begin{frame}
\begin{theorem}
Text
\end{theorem}
\end{frame}
\end{document}
Stefan
LaTeX.org admin
omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

Re: beamer | Change Color of Theorem Block

Post by omer21 »

Thank you Mr. Stefan, it works.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

beamer | Change Color of Theorem Block

Post by paulosousa »

...and how is possible to change the block body in only one or two frames?
Stefan_K wrote:Theorems use the block title and block body colors. You can change it via \setbeamercolor, for example:

Code: Select all

\documentclass{beamer}
\usetheme{Madrid}
\setbeamercolor{block title}{use=structure,fg=white,bg=red!75!black}
\setbeamercolor{block body}{use=structure,fg=black,bg=red!20!white}
\begin{document}
\begin{frame}
\begin{theorem}
Text
\end{theorem}
\end{frame}
\end{document}
Stefan
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

beamer | Change Color of Theorem Block

Post by Stefan Kottwitz »

paulosousa wrote:...and how is possible to change the block body in only one or two frames?
You could call \setbeamercolor just in that frame, so the change is local and not in effect at the next frame:

Code: Select all

\begin{frame}
  \setbeamercolor{block title}{use=structure,fg=white,bg=red!75!black}
  \setbeamercolor{block body}{use=structure,fg=black,bg=red!20!white}
  \begin{theorem}
    Text
  \end{theorem}
\end{frame}
Stefan
LaTeX.org admin
Post Reply