更改 Beamer 中新定义块中的项目符号颜色

更改 Beamer 中新定义块中的项目符号颜色

我定义了几个具有不同颜色的不同块。现在的问题是,当我想使用 \itemize 时,项目符号的颜色仍然与 Beamer 预定义的颜色相同,都是蓝色。谢谢。

    \documentclass{beamer}
    \setbeamertemplate{caption}[numbered]% <-- added, for other option see beamer manual, page 124
    \usepackage{subcaption}

\setbeamersize{text margin left=8mm,text margin right=8mm} 
\titlegraphic{\includegraphics[width=3cm]{NTHU_Logo_Gray.pdf}}
\usepackage{amsthm,amssymb,amsmath,dsfont} % in new xepersian package, 
\usepackage{textpos}

\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{FFFD}{\colorbox{Blue}{\color{white}?}}

\usepackage{array}




\newenvironment<>{examplefirst}[1]{%
\centering
    \setbeamercolor{itemize item}{fg=green}
     \setbeamercolor{block title}{fg=white,bg=green!40!black}%
  \begin{block}#2{#1}}{\end{block}}

\newenvironment<>{examplefirst2}[1]{%
\centering
\setbeamercolor{itemize item}{fg=red}
\setbeamercolor{block title}{fg=white,bg=red!90!black}%
  \begin{block}#2{#1}}{\end{block}}



\usetheme{Frankfurt}
\usecolortheme{whale}
    \begin{document}
    \begin{frame}
            \onslide<+->{\begin{examplefirst}{case 1}
            \begin{itemize}
                \item 1
                \item 2
            \end{itemize}
        \end{examplefirst}}
        \onslide<+->{\begin{examplefirst2}{case 2}
            \begin{itemize}
                \item 1
                \item 2
            \end{itemize}
        \end{examplefirst2}}

    \end{frame}
    \end{document}

答案1

您可以使用以下方式更改项目符号的颜色\setbeamercolor{itemize item}{fg=red}

\documentclass{beamer}

\newenvironment<>{examplefirst2}[1]{%
\setbeamercolor{itemize item}{fg=red}
\setbeamercolor{block title}{fg=white,bg=red!90!black}%
  \begin{block}#2{#1}}{\end{block}}

\begin{document}

\begin{frame}

\begin{block}{bla}
    \begin{itemize}
    \item item
    \end{itemize}
\end{block}

\begin{examplefirst2}{bla}
    \begin{itemize}
    \item item
    \end{itemize}
\end{examplefirst2}


\end{frame}

\end{document}

在此处输入图片描述

相关内容