我正在尝试使用中提到的代码这个答案更改某些 Beamer 框架的所有字体大小。特别是,我位于文档中间的\input
文件size12.clo
。它似乎按预期工作,但由于某种原因,下一帧的内容被移动/移位。我想知道是什么导致了这种转变,以及是否有任何方法可以消除它。
代码:
\documentclass[11pt]{beamer}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
% default font size (11pt Beamer option):
\begin{frame}[fragile]
\frametitle{Some Frame Title}
\begin{block}{Some Block Title}
Some initial text\dots
\begin{itemize}
\item Some 1st level text\dots
\begin{itemize}
\item Some 2nd level text\dots
\end{itemize}
\end{itemize}
\end{block}
\begin{lstlisting}
some source code +* = %
\end{lstlisting}
\end{frame}
% larger font size (as with 12pt Beamer option):
\let\savednewcommand\newcommand
\let\newcommand\renewcommand
\makeatletter
\input{size12.clo}
\makeatother
\let\newcommand\savednewcommand
\begin{frame}[fragile]
\frametitle{Some Frame Title}
\begin{block}{Some Block Title}
Some initial text\dots
\begin{itemize}
\item Some 1st level text\dots
\begin{itemize}
\item Some 2nd level text\dots
\end{itemize}
\end{itemize}
\end{block}
\begin{lstlisting}
some source code +* = %
\end{lstlisting}
\end{frame}
\end{document}
答案1
.clo
我不会在文档中间切换到其他文件,而是为框架使用更大的字体大小,并使用relsize
包来选择相对于当前字体的项目等的字体大小:
\documentclass[11pt]{beamer}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\usepackage{relsize}
\setbeamerfont{frametitle}{size=\larger}
\setbeamerfont{block title}{size=}
\setbeamerfont{itemize/enumerate subbody}{size=\smaller}
\setbeamerfont{itemize/enumerate subsubbody}{size=\smaller}
\begin{document}
% default font size (11pt Beamer option):
\begin{frame}[fragile]
\frametitle{Some Frame Title}
\begin{block}{Some Block Title}
Some initial text\dots
\begin{itemize}
\item Some 1st level text\dots
\begin{itemize}
\item Some 2nd level text\dots
\end{itemize}
\end{itemize}
\end{block}
\begin{lstlisting}
some source code +* = %
\end{lstlisting}
\end{frame}
\setbeamerfont{normal text}{size=\fontsize{22}{24}}
\usebeamerfont{normal text}
\begin{frame}[fragile]
\frametitle{Some Frame Title}
\begin{block}{Some Block Title}
Some initial text\dots
\begin{itemize}
\item Some 1st level text\dots
\begin{itemize}
\item Some 2nd level text\dots
\begin{itemize}
\item Some 3nd level text\dots
\end{itemize}
\end{itemize}
\end{itemize}
\end{block}
\begin{lstlisting}
some source code +* = %
\end{lstlisting}
\end{frame}
\end{document}