3

I am trying to make all itemization symbols and description items in the current text color. While this works for itemize and enumerate, it does not work for description. What am I missing here?

\documentclass{beamer}

\setbeamercolor{item}{fg=.} %\setbeamercolor{item}{fg=magenta}

\begin{document} \begin{frame}{Description Test} \color{red} \begin{description} \color{blue} \item[Label] Test \item[Label] Test \end{description} \begin{itemize} \color{orange} \item Test \end{itemize} \end{frame} \end{document}

My expectation would be that the label gets colored in blue, but it does not: enter image description here

If I change the fg=. to fg=magenta, it becomes magenta, so it is the right template I am using, but it does not apply correctly.

TobiBS
  • 5,240

3 Answers3

2

The definition for the description label explicitly resets the color (and the font) first to the normal color to ensure that you get something independent to surrounding settings. You could redefine this:

\documentclass{beamer}

\setbeamercolor{item}{fg=.} \makeatletter \long\def\beamer@descriptionitem#1{% \GetTitleString{#1}% \let@currentlabelname\GetTitleStringResult \def\insertdescriptionitem{#1}% \hfil\hspace\labelsep{\usebeamertemplate{description item}}} %* instead of ** \makeatother \begin{document}

\begin{frame}{Description Test} \color{red} \begin{description} \color{blue} \item[Label] Test \item[Label] Test \end{description} \begin{itemize} \color{orange} \item Test \end{itemize} \end{frame} \end{document}

enter image description here

Ulrike Fischer
  • 327,261
0

You can do that:

\documentclass{beamer}

\setbeamercolor{item}{fg=.} %\setbeamercolor{item}{fg=magenta}

\begin{document}

\begin{frame}{Description Test}
    \begin{description}
        \color{blue}
        \item[\color{blue} Label] Test
        \item[\color{blue} Label] Test
    \end{description}
    \begin{itemize}
        \color{orange}
        \item Test
    \end{itemize}
\end{frame}

\end{document}

Is this you want? I guess you can renewcommand the command that controls the color of the label in description environment so the label would be blue and then renew it again to be black or whatever color you want.

miltos
  • 2,605
  • 1
    Sure I can do that, but it is inconvenient and requires manual intervention in every single description list, not handy for a template. – TobiBS Aug 26 '22 at 09:12
-1

If you load `enumitem, the problem disappears (one has to redefine the bullet for itemize):

        \documentclass{beamer}
        \usepackage{enumitem}
        \setbeamercolor*{item}{fg=.}
        %\setbeamercolor*{item}{fg=magenta}
    \begin{document}

    \begin{frame}{Description Test}
    \color{red}
    {\begin{description}
     \color{blue}
     \item[Label] Test
     \item[Label] Test
    \end{description}}
    \begin{itemize}[label=$\blacktriangleright$]
    \color{orange}
        \item Test
    \end{itemize}
    \end{frame}

    \end{document} 

enter image description here

Bernard
  • 271,350
  • Interesting, however I am always a bit reluctant loading a package I don't really need and "accidentally" fixing something. Surely enumitem must redefine the description environment and this "fixes" the issue. – TobiBS Aug 26 '22 at 09:13
  • 1
    you shouldn't load enumitem in beamer. – Ulrike Fischer Aug 26 '22 at 10:30
  • 1
    @UlrikeFischer; why that? When I tested, I had no error message nor warning, and it yields what the OP expects. – Bernard Aug 26 '22 at 12:47
  • @Bernard see https://tex.stackexchange.com/questions/356795/enumitem-breaks-beamers-itemize-despite-fixes – Ulrike Fischer Aug 26 '22 at 12:55