我使用以下方法来更改项目列表中不同级别的项目的字体大小:
\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,所以这可能根本不是你想要的,但看起来你正在使用投影机如果是这样,那么您可以通过键系列更改枚举和项目化环境的字体大小,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}
生成结果: