![投影仪颜色处理不一致:如何为特定幻灯片层设置颜色?](https://linux22.com/image/292200/%E6%8A%95%E5%BD%B1%E4%BB%AA%E9%A2%9C%E8%89%B2%E5%A4%84%E7%90%86%E4%B8%8D%E4%B8%80%E8%87%B4%EF%BC%9A%E5%A6%82%E4%BD%95%E4%B8%BA%E7%89%B9%E5%AE%9A%E5%B9%BB%E7%81%AF%E7%89%87%E5%B1%82%E8%AE%BE%E7%BD%AE%E9%A2%9C%E8%89%B2%EF%BC%9F.png)
以下 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}
请注意,类选项red
和note
在 3.33 版本中已过时,请改用颜色主题structure
和选项show notes
。
包含<>
覆盖规范。