Is there a way to change the itemize bullet color without effecting the default behaviour like in an alert action?

Viewed 1185

it's my first post here, so please don't mind, if I'm doing something wrong.

I'm using the default beamer theme and changed some colors, like the color of the itemize bullets. Therefore, there are many lines like \setbeamercolor{item}{fg=MyColor} in the preamble. Now, I noticed that this in particular overrides the default coloring of the bullets when using an alert action like \item<alert@1-> An alerted item. On my slides, there is only the color of the text, but not of the bullet changed to red.

I wonder if nobody already came across this issue, but I found nothing after hours of searching, especially stack overflow or reddit.

I hope that I don't do anything obviously wrong...

Your help would be greatly appreciated, so thanks in advance :)

Yes, to this point this is a copy of my post on reddit, because I though, this is probably the better place to ask for help.

What I already tried:

  • using \AtBeginEnvironment{alertenv}{\setbeamercolor{itemize item}{fg=red}} of the etoolbox package
    • this works at first sight, but the bullet color is then changed without taking overlay specifications into account, so something like \item<alert@2-> An alerted item results in a red bullet also in the first overlay

Here's my MWE:

\documentclass{beamer}

% to demonstrate the faulty behaviour I put this in the document body, usually it would be here in the preamble
% \setbeamercolor{item}{fg=cyan}

% try uncommenting these lines to see the faulty behaviour with overlay specifications
% \AtBeginEnvironment{alertenv}{\setbeamercolor{itemize item}{fg=red}}
% \AtBeginEnvironment{alertenv}{\setbeamercolor{itemize subitem}{fg=red}}
% \AtBeginEnvironment{alertenv}{\setbeamercolor{itemize subsubitem}{fg=red}}

\begin{document}

\begin{frame}{MWE Beamer item color}
    \begin{columns}
        \begin{column}{0.5\textwidth}
                \begin{itemize}
                    \item A default neutral  item
                    \item<alert@2-> An alerted item
                \end{itemize}
        \end{column}
        \setbeamercolor{item}{fg=cyan}
        \begin{column}{0.5\textwidth}
                \begin{itemize}
                    \item A default neutral  item
                    \item<alert@2-> An alerted item
                \end{itemize}
        \end{column}
    \end{columns}
\end{frame}

\end{document}
1 Answers

You can work around the problem like this:

\documentclass{beamer}

\setbeamercolor{item}{fg=cyan}

\addtobeamertemplate{alerted text begin}{\setbeamercolor{item}{fg=alerted text.fg}}{}


\begin{document}

\begin{frame}{MWE Beamer item color}
    \begin{columns}
        \begin{column}{0.5\textwidth}
                \begin{itemize}
                    \item A default neutral  item
                    \item<alert@2-> An alerted item
                \end{itemize}
        \end{column}
        \begin{column}{0.5\textwidth}
                \begin{itemize}
                    \item A default neutral  item
                    \item<alert@2-> An alerted item
                    \item A default neutral  item                    
                \end{itemize}
        \end{column}
    \end{columns}
\end{frame}

\end{document}

enter image description here

(if you are using this colour for more elements, it is usually easier to change the structure colour or directly redefine beamer@blendedblue)


Update:

This issue was fixed in https://github.com/josephwright/beamer/commit/53c13cbe1f48918703f93f310c209c5e3f7f44f5

Starting with beamer v3.65 the above workaround should no longer be necessary.

Related