我想更改fg
中的项目符号的颜色beamer
。在 中normal text
它应该是黄色,但在 或 中exampleblock
它alertblock
应该从 继承block title.fg
。这是一个具有项目颜色默认定义的 NWE。
\documentclass{beamer}
\setbeamercolor{item}{parent=local structure}
\begin{document}
\begin{frame}
\begin{itemize}
\item xyz
\end{itemize}
\begin{block}{abc}
\begin{itemize}
\item xyz
\end{itemize}
\end{block}
\begin{exampleblock}{abc}
\begin{itemize}
\item xyz
\end{itemize}
\end{exampleblock}
\begin{alertblock}{abc}
\begin{itemize}
\item xyz
\end{itemize}
\end{alertblock}
\end{frame}
\end{document}
答案1
begin
您可以向环境的模板中添加颜色设置命令block
,exampleblock
如下alertblock
所示:
\addtobeamertemplate{block begin}{\setbeamercolor{item}{fg=block title.fg}}{}
\addtobeamertemplate{block example begin}{\setbeamercolor{item}{fg=block title example.fg}}{}
\addtobeamertemplate{block alerted begin}{\setbeamercolor{item}{fg=block title alterted.fg}}{}
假设您希望它们与相应块标题的颜色相匹配。然后它们将否决您在这些环境中为项目颜色设置的任何全局值。
\documentclass{beamer}
\setbeamercolor{item}{fg=yellow}
\addtobeamertemplate{block begin}{\setbeamercolor{item}{fg=block title.fg}}{}
\addtobeamertemplate{block example begin}{\setbeamercolor{item}{fg=block title example.fg}}{}
\addtobeamertemplate{block alerted begin}{\setbeamercolor{item}{fg=block title alerted.fg}}{}
\begin{document}
\begin{frame}
\begin{itemize}
\item xyz
\end{itemize}
\begin{block}{abc}
\begin{itemize}
\item xyz
\end{itemize}
\end{block}
\begin{exampleblock}{abc}
\begin{itemize}
\item xyz
\end{itemize}
\end{exampleblock}
\begin{alertblock}{abc}
\begin{itemize}
\item xyz
\end{itemize}
\end{alertblock}
\end{frame}
\end{document}