我使用以下命令來更改逐項清單中不同層級的項目的字體大小:
\makeatletter
\newcommand\ChangeItemFont[3]{%
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{##1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\advance\@itemdepth\@ne
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{\def\makelabel####1{%
{%
\hss\llap{{%
\usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}####1}}%
}%
}%
\ifnum\@itemdepth=1\relax
#1%
\else
\ifnum\@itemdepth=2\relax
#2%
\else
\ifnum\@itemdepth=3\relax
#3%
\fi%
\fi%
\fi%
}
\fi%
\beamer@cramped%
\raggedright%
\beamer@firstlineitemizeunskip%
}}
\makeatother
但是,這不會影響枚舉清單。我需要執行哪些更改才能更改不同層級的枚舉的字體大小?
答案1
你不提供一個完整的MWE,所以這可能根本不是您正在尋找的,但看起來您正在使用投影儀。如果是這樣,那麼您可以透過鍵系列來更改 enumerate 和 itemize 環境的字體大小,itemize/enumerate body begin
如下所示:
\documentclass{beamer}
\setbeamertemplate{itemize/enumerate body begin}{\tiny}
\setbeamertemplate{itemize/enumerate subbody begin}{\normalsize}
\setbeamertemplate{itemize/enumerate subsubbody begin}{\huge}
\begin{document}
\begin{frame}
\begin{enumerate}
\item Item 1
\item Item 2
\begin{enumerate}
\item Subitem 2.1
\item Subitem 2.2
\begin{enumerate}
\item subsubitem 2.2.1
\item subsubitem 2.2.2
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{frame}
\end{document}
其產生: