7
    \documentclass{beamer}
   \usepackage[T1]{fontenc}
    %-----
   \usepackage{amsmath,amssymb,amsfonts} %math
    \usepackage{color}
    \usetheme{Madrid}

   \begin{document}

   \begin{frame}{}
   \begin{exampleblock}{theorem}
   test
   \end{exampleblock}
  \begin{alertblock}{proposition}
   \end{alertblock}
   \begin{block}{Definition}

  \end{block}
  \begin{block}{lemma}

  \end{block}    
   \end{frame}

 \end{document}

enter image description here Thank you!

My goal is to get the block wich has the title definition with a new color like brown.

2
6

Beamer has a build in environment for definitions. It's colour is the same as for a normal block, but you can make them different by changing the block colour before and after a definition. Same for theorem, lemma etc.

\documentclass{beamer}

%\usepackage{graphicx}
%\usepackage{color} 

\usetheme{Madrid}

% Definition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{studentbrown}{RGB}{124,71,50}

\BeforeBeginEnvironment{definition}{%
    \setbeamercolor{block title}{fg=white,bg=studentbrown}
    \setbeamercolor{block body}{fg=black, bg=studentbrown!20!white}
}
\AfterEndEnvironment{definition}{
        \setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!75!black}
        \setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}
}

% Theorem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\BeforeBeginEnvironment{theorem}{
    \setbeamercolor{block title}{use=example text,fg=white,bg=example text.fg!75!black}
    \setbeamercolor{block body}{parent=normal text,use=block title example,bg=block title example.bg!10!bg}
}
\AfterEndEnvironment{theorem}{
        \setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!75!black}
        \setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}
}

% Proposition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{proposition}{Proposition}
\BeforeBeginEnvironment{proposition}{
        \setbeamercolor{block title}{use=alerted text,fg=white,bg=alerted text.fg!75!black}
        \setbeamercolor{block body}{parent=normal text,use=block title alerted,bg=block title alerted.bg!10!bg}
}
\AfterEndEnvironment{proposition}{
        \setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!75!black}
        \setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}
}

\begin{document}

\begin{frame}

\begin{theorem}
test
\end{theorem}

\begin{proposition}
test
\end{proposition}

\begin{definition}
test
\end{definition}

\begin{lemma}
test
\end{lemma}    

\end{frame}

\end{document} 

enter image description here

6

Not the answer you're looking for? Browse other questions tagged or ask your own question.