我想更改特定框架的字体大小,当我使用
\fontsize{<font size>}{<value for \baselineskip>}\selectfont
按照建议这个帖子,我发现它不会改变嵌套列表中的字体大小。有没有办法相应地更改这些字体大小?
答案1
这里有一条\ChangeItemFont
命令,允许你更改 itemize 环境中三个有效嵌套级别的字体,定义方式如下beamer
;语法是
\ChangeItemFont{<font commands 1st level>}{<font commands 2nd level>}{<font commands 3rd level>}
代码和第一帧中有一些疯狂的字体大小的示例,仅用于说明:
\documentclass{beamer}
\usepackage{lmodern}
\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
\begin{document}
\begin{frame}
\frametitle{Font size changed}
\ChangeItemFont{\fontsize{30}{36}\selectfont}{\scriptsize}{\LARGE}
\begin{itemize}
\item First item.
\begin{itemize}
\item First subitem.
\begin{itemize}
\item First subsubitem.
\item Second subsubitem.
\item Third subsubitem.
\item Fourth subsubitem.
\end{itemize}
\item Second subitem.
\end{itemize}
\item Second item.
\item Third item.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Regular font size}
\begin{itemize}
\item First item.
\begin{itemize}
\item First subitem.
\begin{itemize}
\item First subsubitem.
\item Second subsubitem.
\item Third subsubitem.
\item Fourth subsubitem.
\end{itemize}
\item Second subitem.
\end{itemize}
\item Second item.
\item Third item.
\end{itemize}
\end{frame}
\end{document}
答案2
为了实现非常相似的目标,我通常使用以下方法:
\begin{frame}
\frametitle{Size changed}
\scalebox{0.8}{\begin{minipage}{1.20\textwidth}
... your content here ...
\end{minipage}}
\end{frame}
我不知道如何计算比例因子和小页面宽度的组合值,我通常会尝试几个值,直到令我满意为止。
例如以下内容:
\begin{itemize}
\item First item.
\begin{itemize}
\item First subitem.
\begin{itemize}
\item \lipsum[75]
\item \lipsum[66]
\item \lipsum[75]
\end{itemize}
\item Second subitem.
\end{itemize}
\item Second item.
\item Third item.
\end{itemize}
给出:
如果将 scale/minipage 值更改为 0.6/1.6,则可获得: