3

I'm working with the Beamer theme Torino (see http://blog.barisione.org/2007-09/torino-a-pretty-theme-for-latex-beamer/), I' doing presentations using it, but changing the colors defined by default.

It happens that (although I do not change colors that you can see in the code), in this theme, using the itemize and enumerate environments in alertblock and exampleblock, the colors of the bullets are not red or green, respectively, but take the main color defined for "title block" (It's not like in native beamer themes):

\documentclass[10pt,compress,table]{beamer}
\mode<presentation>{
\usetheme[bullet=circle,alternativetitlepage=true,height=1cm]{Torino}
\usefonttheme[onlymath]{serif}
}
\setbeamertemplate{blocks}[rounded][shadow=false]
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}  
\usepackage{ragged2e}
\justifying
\theoremstyle{definition}
\definecolor{purple}{RGB}{153,0,51}
\definecolor{maroon}{RGB}{132,89,107}
\definecolor{glade}{RGB}{51,0,51}
\definecolor{tan}{RGB}{181,138,165}
\definecolor{DarkGreen}{RGB}{0,100,0}
\setbeamercolor*{palette primary}{fg=white,bg=tan} 
\setbeamercolor*{palette secondary}{fg=white,bg=maroon} 
\setbeamercolor*{palette tertiary}{fg=white,bg=glade} 
\setbeamercolor*{palette quaternary}{fg=white,bg=purple} 
\setbeamercolor*{titlelike}{bg=purple}
\setbeamercolor*{frametitle}{bg=purple,fg=white}
\setbeamercolor*{part title}{bg=black,fg=tan}
\setbeamercolor*{item}{fg=purple}
\setbeamercolor*{block title}{bg=purple,fg=white}
\setbeamercolor*{block body}{bg=purple!15,fg=black}
\setbeamercolor*{block title alerted}{bg=red,fg=white}
\setbeamercolor*{block body alerted}{bg=red!15,fg=black}
\setbeamercolor*{block title example}{bg=DarkGreen,fg=white}
\setbeamercolor*{block body example}{bg=DarkGreen!15,fg=black}
\setbeamercolor*{separation line}{}
\setbeamercolor*{fine separation line}{}

\begin{document}
\begin{frame}[t]{Lorem Ipsum}
\begin{exampleblock}{Lorem Ipsum}
\begin{itemize}
 \item Aut consilio aut ense
  \item Post tenebras Lux
\end{itemize}
\end{exampleblock}
\begin{alertblock}{Lorem Ipsum}
\begin{itemize}
  \item Aut consilio aut ense
  \item Post tenebras Lux
\end{itemize}
\end{alertblock}
\begin{alertblock}{Lorem Ipsum}
\begin{enumerate}
 \item Aut consilio aut ense
  \item Post tenebras Lux
\end{enumerate}
\end{alertblock}
\begin{exampleblock}{Lorem Ipsum}
\begin{enumerate}
  \item Aut consilio aut ense
  \item Post tenebras Lux
\end{enumerate}
\end{exampleblock}
\end{frame}
\end{document} 

Using the etoolbox package and this answer, I achieved to change the colors in the manner desired by adding to the preamble:

\usepackage{etoolbox}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize item}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize subitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize subsubitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate item}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate subitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate subsubitem}{fg=red}}

\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize item}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize subitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize subsubitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate item}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate subitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate subsubitem}{fg=DarkGreen}}

differences without etoolbox/with etoolbox
The problem I have is that when I want to change the style of numbering using \useinnertheme{circles}, the color of the items in the numbered list is again the same as without etoolbox. When used \useinnertheme{rounded}, the problem gets worse as it also affects the itemized list: enter image description here

3

The problem is that when one of the circles or rounded inner themes is used, some different templates/colors/fonts are used, so you need to change item projected, subitem projected and subsubitem projected, as in (just for the first level, but is the same idea for the other levels):

% for inner theme circles
\AtBeginEnvironment{alertblock}{\setbeamercolor{item projected}{bg=red}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{item projected}{bg=DarkGreen}}

A complete example:

\documentclass[10pt,compress,table]{beamer}
\mode<presentation>{
\usetheme[bullet=circle,alternativetitlepage=true,height=1cm]{Torino}
\usefonttheme[onlymath]{serif}
}
\setbeamertemplate{blocks}[rounded][shadow=false]
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}  
\usepackage{ragged2e}
\usepackage{etoolbox}
\justifying
\theoremstyle{definition}
\definecolor{purple}{RGB}{153,0,51}
\definecolor{maroon}{RGB}{132,89,107}
\definecolor{glade}{RGB}{51,0,51}
\definecolor{tan}{RGB}{181,138,165}
\definecolor{DarkGreen}{RGB}{0,100,0}
\setbeamercolor*{palette primary}{fg=white,bg=tan} 
\setbeamercolor*{palette secondary}{fg=white,bg=maroon} 
\setbeamercolor*{palette tertiary}{fg=white,bg=glade} 
\setbeamercolor*{palette quaternary}{fg=white,bg=purple} 
\setbeamercolor*{titlelike}{bg=purple}
\setbeamercolor*{frametitle}{bg=purple,fg=white}
\setbeamercolor*{part title}{bg=black,fg=tan}
\setbeamercolor*{item}{fg=purple}
\setbeamercolor*{block title}{bg=purple,fg=white}
\setbeamercolor*{block body}{bg=purple!15,fg=black}
\setbeamercolor*{block title alerted}{bg=red,fg=white}
\setbeamercolor*{block body alerted}{bg=red!15,fg=black}
\setbeamercolor*{block title example}{bg=DarkGreen,fg=white}
\setbeamercolor*{block body example}{bg=DarkGreen!15,fg=black}
\setbeamercolor*{separation line}{}
\setbeamercolor*{fine separation line}{}

\useinnertheme{circles}

\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize item}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize subitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize subsubitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor*{enumerate item}{bg=cyan,fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate subitem}{fg=red}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{enumerate subsubitem}{fg=red}}

\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize item}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize subitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize subsubitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate item}{bg=red,fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate subitem}{fg=DarkGreen}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{enumerate subsubitem}{fg=DarkGreen}}

% for inner theme circles
\AtBeginEnvironment{alertblock}{\setbeamercolor{item projected}{bg=red}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{item projected}{bg=DarkGreen}}


\begin{document}
\begin{frame}[t]{Lorem Ipsum}
\begin{columns}
\column{0.5\textwidth}
\begin{exampleblock}{Lorem Ipsum}
\begin{itemize}
 \item Aut consilio aut ense
  \item Post tenebras Lux
\end{itemize}
\end{exampleblock}
\begin{alertblock}{Lorem Ipsum}
\begin{itemize}
  \item Aut consilio aut ense
  \item Post tenebras Lux
\end{itemize}
\end{alertblock}
\column{0.5\textwidth}
\begin{alertblock}{Lorem Ipsum}
\begin{enumerate}
 \item Aut consilio aut ense
  \item Post tenebras Lux
\end{enumerate}
\end{alertblock}
\begin{exampleblock}{Lorem Ipsum}
\begin{enumerate}
  \item Aut consilio aut ense
  \item Post tenebras Lux
\end{enumerate}
\end{exampleblock}
\end{columns}
\end{frame}

\end{document}

enter image description here

|improve this answer|||||
  • Thanks, it is exactly what I wanted! A small question: the line \setbeamercolor{items}{fg=red, bg=cyan} Is it really necessary? I commented with a "%" and the result was the same, but maybe there is something that makes that line and I'm omitting. – G. Aguilera Feb 23 '15 at 22:19
  • 1
    @G.Aguilera You're welcome. No, that line is superfluous (just a leftover from my tests); I've deleted it from my answer. – Gonzalo Medina Feb 23 '15 at 22:21

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.