- 假设我有一个
itemize
列表,我想按顺序呈现它。我用[<+->]
它来实现这一点。 - 我想用粗体突出显示当前(最近添加的)项目。为此,我将以下内容替换
[<+->]
为[<+-|alert@+>]
并更改alert
颜色和字体这个答案:
\setbeamercolor{alerted text}{fg=black} %change the font color
\setbeamerfont{alerted text}{series=\bfseries} %make alerted text bold
- 此外,我只想将最近添加到列表中的项目的形状从圆形更改为三角形。以下这个答案,我修改了
alert
itemize 中的行为:
\AtBeginEnvironment{itemize}{%
\renewenvironment{alertenv}{\only{\setbeamertemplate{items}[triangle]}}{}}
但是,自从我重新定义了alert
环境后,当前项目的粗体不再起作用:
梅威瑟:
\documentclass{beamer}
\usetheme{metropolis}
\begin{document}
% redefining alert action only for itemize
\AtBeginEnvironment{itemize}{%
\renewenvironment{alertenv}{\only{\setbeamertemplate{items}[triangle]}}{}}
\begin{frame}{Future work}
\begin{itemize}[<+-|alert@+>]
\setbeamercolor{alerted text}{fg=black} %change the font color
\setbeamerfont{alerted text}{series=\bfseries} %make alerted text bold
\item Fix the global warming
\item Prove P $\ne$ NP
\item Sofa in the office
\end{itemize}
\end{frame}
\end{document}
答案1
您可以使用\alt
宏来提供替代符号:
\documentclass{beamer}
\usetheme{moloch}% modern fork of the metropolis theme
\setbeamertemplate{itemize item}{\usebeamerfont*{itemize item}\alt<.>{\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}{\textbullet}}
\begin{document}
\begin{frame}{Future work}
\begin{itemize}[<+-|alert@+>]
\setbeamercolor{alerted text}{fg=black} %change the font color
\setbeamerfont{alerted text}{series=\bfseries} %make alerted text bold
\item Fix the global warming
\item Prove P $\ne$ NP
\item Sofa in the office
\end{itemize}
\end{frame}
\end{document}