Document ClassesAlter Colors for single Frame of Presentation

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Rustam
Posts: 22
Joined: Fri Nov 02, 2012 5:15 pm

Alter Colors for single Frame of Presentation

Post by Rustam »

How to change colors for single frame? Or a series of frames?
I would like for first slides be in one color, then next slides in other color.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Alter Colors for single Frame of Presentation

Post by Stefan Kottwitz »

Font color? Background color? Box colors? Perhaps you can explain, what you mean, the best would be some code, as usual.

Color changes done within a frame are locally to that single frame, not affecting the other frames.

Stefan
LaTeX.org admin
Rustam
Posts: 22
Joined: Fri Nov 02, 2012 5:15 pm

Alter Colors for single Frame of Presentation

Post by Rustam »

I have following definition in the beginning of the source file.

Code: Select all

\newtheorem{our_result}{Our Result}
And in one frame I use it in following way.

Code: Select all

\begin{our_result}
  Blah, blah.
\end{our_result}
I use crane color theme and I want green and greenish backgrounds in our_result, instead of yellow in yellowish.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Alter Colors for single Frame of Presentation

Post by Stefan Kottwitz »

Now it's clear that you mean theorem colors, i.e. block colors here.

As I said, to it within the frame, so the effect ends when the frame ends. For example, with the crane definitions just changed from orange/yellow to green:

Code: Select all

\documentclass{beamer}
\usecolortheme{crane}
\newtheorem{our_result}{Our Result}
\begin{document}
\begin{frame}
  \setbeamercolor{block title}{fg=craneblue,bg=green!50!white}
  \setbeamercolor{block body}{parent=normal text,use=block title,
                  bg=block title.bg!25!bg}
  \begin{our_result}
  Blah, blah.
  \end{our_result}
\end{frame}
\end{document}
It would be great, if you would post such a code example next time when describing a problem, since this saves the reader a lot of time, compared to just some description.
theorem.png
theorem.png (3.99 KiB) Viewed 14562 times
Stefan
LaTeX.org admin
Rustam
Posts: 22
Joined: Fri Nov 02, 2012 5:15 pm

Alter Colors for single Frame of Presentation

Post by Rustam »

Thank you very much.

But I would like to have lusher green colors like those in crane's own "example" theorem environment.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Alter Colors for single Frame of Presentation

Post by Stefan Kottwitz »

The color was just a quick example. Have a look at the xcolor manual, there you can see named colors and color specifications. I assume the technical issue is solved and you just need to select the color value.

Stefan
LaTeX.org admin
Post Reply