0

I am trying to use the code mentioned in this answer to change the size of all fonts for some Beamer frame. In particular, I \input the size12.clo file in the middle of my document. It seems to work as intended, but the content of the next frame is moved/shifted down for some reason. I wonder what causes this shift and if there is any way of how to remove it.

Code:

\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}

The first frame: First frame

The second frame: Second frame

  • size12.closets up all page layout section headings and list spacing and other stuff for the standard article, report, book to load it mid-document will only ever work by accident, especially in a non standard class like beamer – David Carlisle Dec 14 '23 at 11:24
  • Beamer uses some sizes relative to the font size for the headline and stuff. It needs to assume that these remain constant over the course of the document. Instead of changing the .clo file, I would just change the normal font template and use the relsize package to define items and stuff relative to the current font. – samcarter_is_at_topanswers.xyz Dec 14 '23 at 11:44
  • Ok, thanks for your comments. I will not use this way then. – Daniel Langr Dec 14 '23 at 15:17

1 Answers1

1

Instead of switching to a different .clo file in the middle of the document, I would use a larger font size for your frame and use the relsize package to choose the font sizes for the items etc. relative to the current font:

\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}

enter image description here