24

Is there a "nice" way to change the color of individual bullet points? For example imagine a list like this:

\begin{itemize}
  \item A
  \begin{itemize}
    \item pro 1
    \item con 1
    \item pro 2
  \end{itemize}
  \item B
  \begin{itemize}
    \item pro 3
    \item con 2
    \item con 3
  \end{itemize}
\end{itemize}

How can I make pro bullets green and cons bullets red?

BTW.: I use the circle innertheme

28

Here's a more beamer way to do things.

The idea is to make an "action" environment that changes the bullet colour.

\documentclass{beamer}
\useinnertheme{circles}
\newenvironment{proenv}{\only{\setbeamercolor{local structure}{fg=green}}}{}
\newenvironment{conenv}{\only{\setbeamercolor{local structure}{fg=red}}}{}
\begin{document} 

\begin{frame}
  \frametitle{Some pros and cons}
    \begin{itemize}
      \item<pro@1-> A pro item
      \item<con@1-> A con item
      \item A neutral  item
    \end{itemize}
\end{frame}

\end{document}

The syntax of adding the action requires you to specify the slide range that the action will apply to; you should set this to 1- (which means slide 1 and all further slides) otherwise the colour will change back to the default colour theme if you are uncovering any parts of the slide.

output of code

  • Why is it impossible to get colored items if you add \setbeamercolor{item}{fg=blue} in the beginning of the document? Is there a way to avoid it to override everything? – s__C Apr 23 '14 at 14:57
  • @s__C I'm not quite sure the reason, but as a fix you can replace local structure with item in my code and things will work as advertised. – Alan Munn Apr 23 '14 at 15:23
  • Just one thing remaining : why is it also coloring all items that are one level below (encapsulated itemize)? – s__C Apr 23 '14 at 15:31
  • @s__C Because that semantically makes sense? :) But I'm not sure how the inheritance structure works in Beamer, so I don't have a quick answer to that, nor much time to investigate. – Alan Munn Apr 23 '14 at 15:54
9

You can define new commands based on \item and use its optional argument to obtain colored bullets; I don't know if this is "nice", though:

\documentclass{beamer}

\newcommand*\MyPitem{%
  \item[\color{green}\scalebox{0.9}{\textbullet}]}
\newcommand*\MyCitem{%
  \item[\color{red}\scalebox{0.9}{\textbullet}]}

\begin{document}

\begin{frame}
\begin{itemize}
  \item A
  \begin{itemize}
    \MyPitem pro 1
    \MyCitem con 1
    \MyPitem pro 2
  \end{itemize}
  \item B
  \begin{itemize}
    \MyPitem pro 3
    \MyCitem con 2
    \MyCitem con 3
  \end{itemize}
\end{itemize}
\end{frame}

\end{document}

  • 1
    True, but this is more a duplicate of How to define a list with custom symbols?. See my comments under the question. – Martin Scharrer Mar 27 '11 at 9:37
  • @Martin Scharrer: yes, I didn't read the question you linked; should I delete my answer? – Gonzalo Medina Mar 27 '11 at 12:48
  • 1
    No, it not really necessary. Your example includes the textbullets which some people might want. – Martin Scharrer Mar 27 '11 at 12:54
  • This answer is extremely useful in case you need to adjust symbol and color. Thanks. – Jan-Philip Gehrcke Feb 17 '13 at 10:41
8

I was with the same problem. But I figured it out you could use the "\bullet" command and change its color:

\begin{itemize}
  \item[\textcolor{green}{$\bullet$}] Pro:
  \item[\textcolor{red}{$\bullet$}] Con:
  \item[\textcolor{blue}{$\bullet$}] Neutral:
\end{itemize}

Result:

enter image description here

If you want to create a new command with this \textcolor{blue}{$\bullet$} it would be even better.

Your Answer

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