After reading section 12.4 Theorem Environments from beameruserguide I understand that all theorem like environments (theorem, lemma, corollary, ...) except example use same beamertemplate which means same block colors. Is it true?

If the answer is yes, is there any beamer (not using tcolorbox or mdframed theorems) way to customizing colors for each environment?

If the answer is no, could you show me an example?

Nex there's a little code to start with:




Theorem body

Example body

Proof body

Lemma body


To start the answer small: as you will have found in the docs, the actual environment inserted depends on the value of \inserttheoremblockenv. Unfortunately, the docs only do what the docs say:

if a theorem that has theorem style example is typeset, it will expand to exampleblock

and not what they might seem to suggest (i.e. something along the lines of "if the style is X, and environment Xblock exists, I'll use Xblock, otherwise block). The way this is done is simplistic (beamerbasetheorems.sty):

    \normalfont % body font

\th@example is the macro that stores the look and layout of theorem style example. So for a different style, you can change the environment.

Defining an environment for the color combinations you want seems to be done best in a brute-force way by adapting the definition of, e.g. exampleblock (beamerbaselocalstructure.tex):

        \setbeamercolor{local structure}{parent=example text}}%
      \usebeamertemplate{block example begin}}
      \usebeamertemplate{block example end}%

On first thought, though, this won't help you with the pre-defined theorem names, so you might want to give the class optionnotheorems to disable the predefined theorem etc. and define them yourself.

Your Answer

