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.

In beamer, there are some predefined (colour) styles like plain, theorem, definition and remark. My first question is where can I find the list of these styles? and the second one is how can I create my own style? For instance, I want to apply orange colour for remarks.

share|improve this question
1  
Have a look at the end of the file beamerinnerthemedefault.sty –  percusse Jul 14 '13 at 8:53
add comment

1 Answer

up vote 4 down vote accepted

Here's how you can easily define new customized theorem-like blocks; the idea is to define a new style with customized settings, and then use this new style for your structures:

\documentclass{beamer}
\usetheme{Warsaw}

\makeatletter
\def\th@mystyle{%
    \normalfont % body font
    \setbeamercolor{block title example}{bg=orange,fg=white}
    \setbeamercolor{block body example}{bg=orange!20,fg=black}
    \def\inserttheoremblockenv{exampleblock}
  }
\makeatother
\theoremstyle{mystyle}
\newtheorem*{remark}{Remark}

\begin{document}

\begin{frame}
\begin{theorem}[An important theorem]
    Some text
\end{theorem}

\begin{remark}[Some important remark]
    Some text
\end{remark}
\end{frame}

\end{document}

enter image description here

Relevant settings for definition of theorem-like structures:

In the file beamerbasetheorems.sty you find:

\def\th@example{\th@remark}

and

\ifbeamer@countsect
  \newtheorem{theorem}{\translate{Theorem}}[section]
\else
  \newtheorem{theorem}{\translate{Theorem}}
\fi
\newtheorem{corollary}[theorem]{\translate{Corollary}}
\newtheorem{fact}[theorem]{\translate{Fact}}
\newtheorem{lemma}[theorem]{\translate{Lemma}}
\newtheorem{problem}[theorem]{\translate{Problem}}
\newtheorem{solution}[theorem]{\translate{Solution}}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{\translate{Definition}}
\newtheorem{definitions}[theorem]{\translate{Definitions}}

\theoremstyle{example}
\newtheorem{example}[theorem]{\translate{Example}}
\newtheorem{examples}[theorem]{\translate{Examples}}

which means that the example style is the same as the remark style; the plain style is used for theorems, corollaries, lemmas, problems, solutions. The definition style applies to definitions, and the example style, to examples.

Also relevant might be the lines

\def\inserttheoremheadfont{\the\thm@headfont}
  \def\inserttheoremblockenv{block}

  \def\th@example{%
    \normalfont % body font
    \def\inserttheoremblockenv{exampleblock}
  }

which show basically that for the example style, exampleblock is used, but for all other theorem-like structures block is used.

In beamerbaseauxtemplates.sty one finds:

\defbeamertemplate{theorem begin}{ams style}
{%
  \begin{\inserttheoremblockenv}
    {%
      \inserttheoremheadfont
      \inserttheoremname
      \inserttheoremnumber
      \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
      \inserttheorempunctuation
    }%
}

\defbeamertemplate{theorem end}{ams style}
{\end{\inserttheoremblockenv}}


\defbeamertemplate{theorem begin}{numbered}
{%
  \begin{\inserttheoremblockenv}
    {%
      \inserttheoremname
      \inserttheoremnumber
      \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
    }%
}

\defbeamertemplate{theorem end}{numbered}
{\end{\inserttheoremblockenv}}


\defbeamertemplate{theorem begin}{normal font}
{
  \normalfont
  \begin{\inserttheoremblockenv}
  {%
    \inserttheoremname
    \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
  }%
}

\defbeamertemplate{theorem end}{normal font}
{\end{\inserttheoremblockenv}}
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.