如何在 Beamer 中强制使用字体系列来显示普通/默认文本?

如何在 Beamer 中强制使用字体系列来显示普通/默认文本?

有人可以帮忙吗?

我设法在我的 Beamer PDF 中使用 SourceSansPro,但未能系列作为新的默认值。

这是我尝试过的:

\documentclass[ngerman,ignorenonframetext,20,aspectratio=1610]{beamer}

\usepackage[light]{sourcesanspro}

\setbeamertemplate{navigation symbols}{}

% how to enforce normal text!?
\setbeamerfont{normal text}{size*={20}{24},series=\mdseries}
\setbeamerfont{section name}{size*={20}{24},series=\mdseries}
\setbeamerfont{section page}{size*={20}{24},series=\mdseries}
\setbeamerfont{section in page}{size*={20}{24},series=\mdseries}
\setbeamerfont{section in sidebar}{size*={20}{24},series=\mdseries}
\setbeamerfont{section in head/foot}{size*={20}{24},series=\mdseries}
\setbeamerfont{projected text}{size*={20}{24},series=\mdseries}
\setbeamerfont{structure}{series=\mdseries}

\setbeamerfont{tiny structure}{series=\mdseries}
\setbeamerfont{frametitle}{size=\large,series=\mdseries} % ,series=\bfseries
\setbeamerfont{framesubtitle}{size=\footnotesize,series=\mdseries}
\setbeamerfont{footline}{size=\Tiny,series=\mdseries}
\setbeamerfont{title}{size*={16}{18},series=\bfseries}
\setbeamerfont{subtitle}{size*={10}{12},series=\mdseries}

\setbeamerfont{item}{size*={10}{12},series=\mdseries}
\setbeamerfont{item projected}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize item}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize subitem}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize subsubitem}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize/enumerate body}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize/enumerate subbody}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize/enumerate subsubbody}{size*={10}{12},series=\mdseries}


\begin{document}

\begin{frame}{Title}
  Title-bar

  \section{sec1} foo1

  \subsection{sec1sub1} foo1.1

  \subsubsection{sec1sub1sub1} foo1.1.1

  \begin{itemize}
  \item Item2
  \item Item3
  \item Item4
  \end{itemize}

\end{frame}

\end{document}

但只设置了特定的文本

在此处输入图片描述

谢谢您的启发:)

——阿克塞尔。

答案1

要将普通字体更改为您指定的字体,请将其添加\AtBeginDocument{\usebeamerfont{normal text}}到您的文档中。

完成 MWE:

\documentclass[ngerman,ignorenonframetext,20,aspectratio=1610]{beamer}

\usepackage[light]{sourcesanspro}

\setbeamertemplate{navigation symbols}{}

% how to enforce normal text!?
\setbeamerfont{normal text}{size*={20}{24},series=\mdseries}
\setbeamerfont{section name}{size*={20}{24},series=\mdseries}
\setbeamerfont{section page}{size*={20}{24},series=\mdseries}
\setbeamerfont{section in page}{size*={20}{24},series=\mdseries}
\setbeamerfont{section in sidebar}{size*={20}{24},series=\mdseries}
\setbeamerfont{section in head/foot}{size*={20}{24},series=\mdseries}
\setbeamerfont{projected text}{size*={20}{24},series=\mdseries}
\setbeamerfont{structure}{series=\mdseries}

\setbeamerfont{tiny structure}{series=\mdseries}
\setbeamerfont{frametitle}{size=\large,series=\mdseries} % ,series=\bfseries
\setbeamerfont{framesubtitle}{size=\footnotesize,series=\mdseries}
\setbeamerfont{footline}{size=\Tiny,series=\mdseries}
\setbeamerfont{title}{size*={16}{18},series=\bfseries}
\setbeamerfont{subtitle}{size*={10}{12},series=\mdseries}

\setbeamerfont{item}{size*={10}{12},series=\mdseries}
\setbeamerfont{item projected}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize item}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize subitem}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize subsubitem}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize/enumerate body}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize/enumerate subbody}{size*={10}{12},series=\mdseries}
\setbeamerfont{itemize/enumerate subsubbody}{size*={10}{12},series=\mdseries}

\AtBeginDocument{\usebeamerfont{normal text}}


\begin{document}

    \begin{frame}{Title}
        Title-bar

        \section{sec1} foo1

        \subsection{sec1sub1} foo1.1

        \subsubsection{sec1sub1sub1} foo1.1.1

        \begin{itemize}
            \item Item2
            \item Item3
            \item Item4
        \end{itemize}

    \end{frame}

\end{document}

在此处输入图片描述

相关内容