投影仪颜色处理不一致:如何为特定幻灯片层设置颜色?

投影仪颜色处理不一致:如何为特定幻灯片层设置颜色?

以下 MWE 可用于设置项目符号的颜色,但不能设置\item文本的颜色(顶层除外,顶层会将所有内容变为灰色)。当我浏览幻灯片时,我希望活动的“要点”(顶层项目)的文本为黑色。

\documentclass[compress,red,notes]{beamer}

\begin{document}

\frame{
\frametitle{Test color transition in beamer enumerations}

{\setbeamercolor{local structure}{fg=gray}
\setbeamercolor{itemize/enumerate body}{fg=gray!65}
\begin{itemize}
  {\only<1>{\setbeamercolor{local structure}{fg=red}
            \setbeamercolor{itemize/enumerate body}{fg=black}}
  \item Major point 1
  \begin{itemize}
    \scriptsize
    \item Minor point 1
    \item Minor point 2
  \end{itemize}
  } % end of \only<1>
  {\only<2>{\setbeamercolor{local structure}{fg=red}
            \setbeamercolor{itemize/enumerate body}{fg=black}}
  \item Major point 2
  \begin{itemize}
    \scriptsize
    \item Minor point 1
    \item Minor point 2
  \end{itemize}
  } % end of \only<2>
  {\only<3>{\setbeamercolor{local structure}{fg=red}
            \setbeamercolor{itemize/enumerate body}{fg=black}}
  \item Major point 3
  \begin{itemize}
    \scriptsize
    \item Minor point 1
    \item Minor point 2
  \end{itemize}
  } % end of \only<3>
  {\only<4>{\setbeamercolor{local structure}{fg=red}
            \setbeamercolor{itemize/enumerate body}{fg=black}}
  \item Major point 4
  \begin{itemize}
    \scriptsize
    \item Minor point 1
    \item Minor point 2
  \end{itemize}
  } % end of \only<4>
\end{itemize}
} % end of \color{gray}
} % end of \frame

\end{document}

假设这可以工作,将代码\only<x>{ ... }放在它自己的命令中也是不错的。我对\command<parameter>{main param}(如在\only<parameter>{...}\command[parameter]{main param}(如在 beamer 之外的几乎所有其他命令中看到的那样)之间的区别有点困惑。< > 和 [ ] 之间有什么区别?

答案1

也许您可以使用以下\alert命令:

\documentclass[compress,show notes]{beamer}
\colorlet{myred}{red!70!black}
\usecolortheme[named=myred]{structure}
\usepackage{lmodern}
\begin{document}

\frame{
  \frametitle{Test color transition in beamer enumerations}
  {%
    \setbeamercolor{local structure}{fg=gray}
    \setbeamercolor{itemize/enumerate body}{fg=gray!65}
    \setbeamertemplate{alerted text begin}{%
      \setbeamercolor{local structure}{fg=red}\setbeamercolor{alerted text}{fg=black}
    }
    \begin{itemize}
      \alert<1>{\item Major point 1
      \begin{itemize}
        \scriptsize
        \item Minor point 1
        \item Minor point 2
      \end{itemize}}
      \alert<2>{\item Major point 2
      \begin{itemize}
        \scriptsize
        \item Minor point 1
        \item Minor point 2
      \end{itemize}}
      \alert<3>{\item Major point 3
      \begin{itemize}
        \scriptsize
        \item Minor point 1
        \item Minor point 2
      \end{itemize}}
      \alert<4>{\item Major point 4
      \begin{itemize}
        \scriptsize
        \item Minor point 1
        \item Minor point 2
      \end{itemize}}
    \end{itemize}
  }
}
\end{document}

请注意,类选项rednote在 3.33 版本中已过时,请改用颜色主题structure和选项show notes

包含<>覆盖规范。

在此处输入图片描述

相关内容