4

I use Beamer with XeLaTeX. I don't use any Beamer themes because it is more useful to specify some parameters manually. I used some colors for all blocks and all blocks have these colors... except the blocks for "Example" environment.

  1. Why Example environment do not use my colors?
  2. How can I fix it?

System: Windows 7, MikTeX.

\documentclass[pdf,10pt,unicode]{beamer}
\usefonttheme{professionalfonts}
\usepackage{hyperref}

\usepackage{polyglossia}
\usepackage{tikz}

\setromanfont{Times New Roman}
\newfontfamily\cyrillicfontrm{Times New Roman}
\setsansfont[Mapping=tex-text]{Calibri}
\newfontfamily\cyrillicfontsf[Mapping=tex-text]{Calibri}
\setmonofont{Courier New}
\newfontfamily\cyrillicfonttt{Courier New}
\setmainfont{Cambria}
\newfontfamily\cyrillicfont{Cambria}

\usepackage{unicode-math}
\setmathfont{Cambria Math}

\setdefaultlanguage{english}

\defaultfontfeatures{Mapping=tex-text}
\usepackage{amsmath, amsthm}

\setbeamertemplate{blocks}[rounded][shadow=true]

\definecolor{LightViolet}{RGB}{230,220,255}
\setbeamercolor{frametitle}{bg=LightViolet}

\definecolor{NormalBlue}{RGB}{200,200,255}
\setbeamercolor{block title}{bg=NormalBlue}

\definecolor{LightBlue}{RGB}{220,220,255}
\setbeamercolor{block body}{bg=LightBlue}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]

\setbeamertemplate{itemize items}[ball] 
\setbeamertemplate{enumerate items}[circle]

\parskip=0.5em

\begin{document}

\begin{frame}
\frametitle{Frametitle}
\begin{definition}
This is a definition
\end{definition}

\begin{theorem}
This is a theorem
\end{theorem}

\begin{block}{Block}
This is a regular block
\end{block}

\begin{example}
This is a example block
\end{example}
\end{frame}

\end{document}

MWE: mwe.tex, mwe.pdf

5

Example and alert blocks use their own colours, which you can set separately.

\documentclass[pdf,10pt,unicode]{beamer}

\setbeamertemplate{blocks}[rounded][shadow=true]

\definecolor{LightViolet}{RGB}{230,220,255}
\setbeamercolor{frametitle}{bg=LightViolet}

\definecolor{NormalBlue}{RGB}{200,200,255}
\setbeamercolor{block title}{bg=NormalBlue}

\definecolor{LightBlue}{RGB}{220,220,255}
\setbeamercolor{block body}{bg=LightBlue}

\setbeamercolor{block body example}{bg=red!20!white}
\setbeamercolor{block title example}{fg=red, bg=red!40!white}

\begin{document}

\begin{frame}
\frametitle{Frametitle}
\begin{definition}
This is a definition
\end{definition}

\begin{theorem}
This is a theorem
\end{theorem}

\begin{block}{Block}
This is a regular block
\end{block}

\begin{example}
This is a example block
\end{example}
\end{frame}

\end{document}

enter image description here

  • @oslutsky Good to hear that the answer helped you. If you are satisfied with the solution, please consider accepting it (by clicking on the checkmark ✓, see How do you accept an answer?). This shows others that the question is solved and will remove it from the list of unanswered questions. As a bonus, this will not only give a reward to the answer, but you will get 2 reputation points, too. – samcarter_is_at_topanswers.xyz Nov 21 '16 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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