0

I want the list bullets in alerted blocks to be red and the otherwise in blue. The problem is that I don't manage to get the right colours.

Here is what comes before

\documentclass[t]{beamer}
\usepackage{xcolor}
\definecolor{red}{HTML}{DC322F}
\definecolor{blue}{HTML}{268BD2}
\colorlet{bullet-list-color}{blue}
\colorlet{alert-list-color}{red}
\colorlet{block-headings-color}{blue}
\colorlet{alert-headings-color}{red}

And the test frame

\begin{frame}
\begin{alertblock}{Alert}
\begin{description}
\item[Alert 1] some explanations.
\item[Alert 2] some explanations.
\end{description}
\end{alertblock}

\begin{block}{Block}
\begin{description}
\item[Block 1] some explanations.
\item[Block 1] some explanations.
\end{description}
\end{block}
\end{frame}

If I add

\setbeamercolor{description item}{fg=bullet-list-color}
\setbeamercolor{description item alerted}{fg=alert-list-color}

I obtain this because the first selector takes precedence over the second. MWE

If I modify it as

\setbeamercolor{normal description item}{fg=bullet-list-color}
\setbeamercolor{description item alerted}{fg=alert-list-color}

now the block list is not selected any more. enter image description here

I tried to correct it with

\setbeamercolor{normal description item}{fg=bullet-list-color}
\setbeamercolor{description item block}{fg=bullet-list-color}
\setbeamercolor{description item alerted}{fg=alert-list-color}

without success.

Can someone please tell me how to modify the colour of the list inside the block?

  • Your test frame is faulty, it gives a capacity exceeded error. – Ulrike Fischer Oct 16 '16 at 13:58
  • I corrected it. – Ronan Oct 16 '16 at 14:09
  • 1
    @ernesto: When I compile your preamble and the test frame I get the red list in alert and the blue list in the regular block. That seems to be what you're after. – Werner Oct 16 '16 at 15:18
1
\documentclass[t]{beamer}
\definecolor{red}{HTML}{FC322F}
\definecolor{blue}{HTML}{268BD2}
\colorlet{bullet-list-color}{blue}
\colorlet{alert-list-color}{red}
\colorlet{block-headings-color}{blue}
\colorlet{alert-headings-color}{red}

\setbeamercolor{description item}{fg=bullet-list-color}

\usepackage{etoolbox}

\AtBeginEnvironment{alertblock}{%
    \setbeamercolor{description item}{fg=alert-list-color}  
}

\setbeamercolor{block title}{fg=block-headings-color}
\setbeamercolor{block title alerted}{fg=alert-headings-color}

\begin{document}

\begin{frame}
\begin{alertblock}{Alert}
\begin{description}
\item[Alert 1] some explanations.
\item[Alert 2] some explanations.
\end{description}
\end{alertblock}

\begin{block}{Block}
\begin{description}
\item[Block 1] some explanations.
\item[Block 1] some explanations.
\end{description}
\end{block}
\end{frame}
\end{document}

enter image description here

  • Thank you for the quick answer. I think such a feature should be in the original design of beamer... – Ronan Oct 17 '16 at 9: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.