6

I would like to obtain what I describe in the following MWE, that is the itemize symbol should be

  • black outside blocks;
  • blue in normal blocks;
  • red in alert blocks;
  • green in example blocks.

MWE:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize} 
\item Here in blue, I'd like it in black. 
\end{itemize}
\begin{block}{A block}
  \begin{itemize} 
  \item Here in blue, I'd like keep it in blue. 
  \end{itemize}
\end{block}
\begin{alertblock}{An alert block}
  \begin{itemize} 
  \item Here in red, I'd like keep it in red. 
  \end{itemize}
\end{alertblock}
\begin{exampleblock}{An example block}
  \begin{itemize} 
  \item Here in green, I'd like keep it in green. 
  \end{itemize}
\end{exampleblock}
\end{frame}
\end{document}

Minimum working example

If I look to beamercolorthemedefault.sty, I see that items are colored using the local structure color:

  • If I change the local structure to black, normal blocks become black;
  • If I change directly the item color to black, it is black in all blocks.

So what is the correct way to obtain the desired result?

6

I would set the colour of local structure to black for normal text, then change it to match the colour of structure again when you start a normal block. This can be done by adding the redefinition of the colour to the beamer templateblock begin:

\documentclass{beamer}

\setbeamercolor{local structure}{parent=normal text}
\addtobeamertemplate{block begin}{\setbeamercolor{local structure}{parent=structure}}{}

\begin{document}
\begin{frame}
\begin{itemize} 
\item Here in blue, I'd like it in black. 
\end{itemize}
\begin{block}{A block}
  \begin{itemize} 
  \item Here in blue, I'd like keep it in blue. 
  \end{itemize}
\end{block}
\begin{alertblock}{An alert block}
  \begin{itemize} 
  \item Here in red, I'd like keep it in red. 
  \end{itemize}
\end{alertblock}
\begin{exampleblock}{An example block}
  \begin{itemize} 
  \item Here in green, I'd like keep it in green. 
  \end{itemize}
\end{exampleblock}
\end{frame}
\end{document}

output of the example code with bullets coloured in black, blue, red and green

|improve this answer|||||
5

enter image description here

One possibility is to set the itemize item color to black. This will affect all of the itemize environments, but then with the help of the etoolbox package you can restore the desired colors inside the blocks:

\usepackage{etoolbox}
\setbeamercolor{itemize item}{fg=black}
\AtBeginEnvironment{block}{\setbeamercolor{itemize item}{fg=structure}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize item}{fg=block title alerted.fg}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize item}{fg=block title example.fg}}

A complete example:

\documentclass{beamer}
\usepackage{etoolbox}

\setbeamercolor{itemize item}{fg=black}
\AtBeginEnvironment{block}{\setbeamercolor{itemize item}{fg=structure}}
\AtBeginEnvironment{alertblock}{\setbeamercolor{itemize item}{fg=block title alerted.fg}}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{itemize item}{fg=block title example.fg}}

\begin{document}
\begin{frame}
\begin{itemize} 
\item Here in black, as desired. 
\end{itemize}
\begin{block}{A block}
  \begin{itemize} 
  \item Here in blue, I'd like keep it in blue. 
  \end{itemize}
\end{block}
\begin{alertblock}{An alert block}
  \begin{itemize} 
  \item Here in red, I'd like keep it in red. 
  \end{itemize}
\end{alertblock}
\begin{exampleblock}{An example block}
  \begin{itemize} 
  \item Here in green, I'd like keep it in green. 
  \end{itemize}
\end{exampleblock}
\end{frame}
\end{document}
|improve this answer|||||
  • Thanks for your answer. I choose to accept the other answer since it is simpler. – Bruno Feb 26 '15 at 8:40

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.