Beamer:使用较小字体的字形,但放大

Beamer:使用较小字体的字形,但放大

与大多数功能齐全的字体一样,Computer Modern 针对不同的显示尺寸提供不同的版本。较小的尺寸具有更宽的纵横比、更粗的衬线以及水平和垂直笔画之间的差异较小。这些功能使文本在小尺寸下更清晰易读。

不同尺寸的现代计算机样本。

Beamer 默认使用 11 号字体。在我看来,这个字体太大了。我希望小尺寸也能带来易读性。不过,我认为整体尺寸Beamer 的字体很好。选择\documentclass[8pt]{beamer}会导致每行字符过多。

我怎样才能告诉 Beamer 使用较小尺寸的 Computer Modern 字形,但将它们放大到(大致)与默认大小相同的大小?

答案1

考虑这个使用默认11pt字体和 a 43(或 4:3 纵横比,或12.8cmx9.6cm页面尺寸)的最小示例:

\documentclass{beamer}
  
\usetheme{Warsaw}

\begin{document}

\begin{frame}
  \frametitle{There Is No Largest Prime Number - 11pt}
  \framesubtitle{The proof uses \textit{reductio ad absurdum}.}
  \begin{theorem}
    There is no largest prime number.
  \end{theorem}
  \begin{proof}
    \begin{enumerate}
      \item<1-| alert@1> Suppose $p$ were the largest prime number.
      \item<2-> Let $q$ be the product of the first $p$ numbers.
      \item<3-> Then $q+1$ is not divisible by any of them.
      \item<1-> But $q + 1$ is greater than $1$, thus divisible by some prime number not in the first $p$ numbers.\qedhere
    \end{enumerate}
  \end{proof}
\end{frame}

\end{document}

您可以选择8pt字体选项,并调整页面大小以获得相似的纵横比,但略小(缩放系数8/11xfp):

\documentclass[8pt]{beamer}

\usepackage{xfp}
\makeatletter
% Taken from beamer.cls' default geometry settings
% http://mirrors.ctan.org/macros/latex/contrib/beamer/base/beamer.cls
\geometry{%
  papersize={\fpeval{\beamer@paperwidth*8/11}pt,\fpeval{\beamer@paperheight*8/11}pt},
  hmargin=\fpeval{8/11}cm,% 1cm
  vmargin=0cm,%
  head=\fpeval{0.5*8/11}cm,% 0.5cm
  headsep=0pt,%
  foot=\fpeval{0.5*8/11}cm% 0.5cm
}
\makeatother
  
\usetheme{Warsaw}

\begin{document}

\begin{frame}
  \frametitle{There Is No Largest Prime Number - 8pt}
  \framesubtitle{The proof uses \textit{reductio ad absurdum}.}
  \begin{theorem}
    There is no largest prime number.
  \end{theorem}
  \begin{proof}
    \begin{enumerate}
      \item<1-| alert@1> Suppose $p$ were the largest prime number.
      \item<2-> Let $q$ be the product of the first $p$ numbers.
      \item<3-> Then $q+1$ is not divisible by any of them.
      \item<1-> But $q + 1$ is greater than $1$, thus divisible by some prime number not in the first $p$ numbers.\qedhere
    \end{enumerate}
  \end{proof}
\end{frame}

\end{document}

下图粗略地展示了两者之间的区别:

在此处输入图片描述

您可能还必须更改其他长度,因为缩放不能单方面转换为与字体相关的概念。但是,从视觉上讲,显示非常相似就足够了。

答案2

最简单的方法是使用OpticalSize=字体功能(来自fontspec)和支持该功能的字体(例如 Latin Modern 或 TeX Gyre 系列)。这不会造成文档大小缩小的副作用。

确实没有理由不使用现代软件beamer,因为您不会beamer向要求您使用 PDFTeX 的出版商提交演示文稿。

\documentclass{beamer}
\tracinglostchars=2
\usetheme{Warsaw}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}

\defaultfontfeatures{ Ligatures=TeX, OpticalSize=20 }

\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmathfont{Latin Modern Math}
\setmathfont{XITS Math}[range=\QED, Scale=MatchUppercase]

\renewcommand\qedsymbol{\ensuremath{\QED}}

\begin{document}

\begin{frame}
  \frametitle{There Is No Largest Prime Number - 20pt}
  \framesubtitle{The proof uses \textit{reductio ad absurdum}.}
  \begin{theorem}
    There is no largest prime number.
  \end{theorem}
  \begin{proof}
    \begin{enumerate}
      \item<1-| alert@1> Suppose $p$ were the largest prime number.
      \item<2-> Let $q$ be the product of the first $p$ numbers.
      \item<3-> Then $q+1$ is not divisible by any of them.
      \item<1-> But $q + 1$ is greater than $1$, thus divisible by some prime number not in the first $p$ numbers.\qedhere
    \end{enumerate}
  \end{proof}
\end{frame}

\end{document}

20pt 示例

予以适当修改

8pt 示例

额外使用\setmathfont[range=...还可以获得无衬线数学字母。

相关内容