![为什么 \setbeamerfont{}{} 命令在我的 beamer 演示文稿的标题中不起作用?](https://linux22.com/image/464164/%E4%B8%BA%E4%BB%80%E4%B9%88%20%5Csetbeamerfont%7B%7D%7B%7D%20%E5%91%BD%E4%BB%A4%E5%9C%A8%E6%88%91%E7%9A%84%20beamer%20%E6%BC%94%E7%A4%BA%E6%96%87%E7%A8%BF%E7%9A%84%E6%A0%87%E9%A2%98%E4%B8%AD%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%9F.png)
我正在尝试增加演示文稿标题中节和子节的字体大小和粗细。但是,该命令似乎\setbeamerfont{section in head/foot}{series=\bfseries,size=\normalsize}
不起作用。可能的原因是什么?
平均能量损失
\documentclass{beamer}
% loading packages
\usepackage{fontspec}
% Removing Navigation Icon
\setbeamertemplate{navigation symbols}{}
%customizing headline
\setbeamertemplate{headline}
{%
\leavevmode %\bfseries\normalsize % this wrok just fine, however \setbeamerfont command does not seem to do anything.
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=10pt, dp=5pt, center]{section in head/foot}
\insertsectionhead
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=10pt, dp=5pt, center]{subsection in head/foot}
\insertsubsectionhead
\end{beamercolorbox}
}
\setbeamercolor{section in head/foot}{bg=black!30, fg=black}
\setbeamercolor{subsection in head/foot}{bg=red!30, fg=black}
\setbeamerfont{section in head/foot}{series=\bfseries,size=\normalsize} % this command is not working
\setbeamerfont{subsection in head/foot}{series=\bfseries, size=\normalsize} % this command is not working
\begin{document}
% first page (Title Page) costomization
\title{Main Title Here}
\subtitle{Subtitle Here}
\author{Author}
\institute{Institute Name}
\date{\today}
\begin{frame}[noframenumbering, plain]
\titlepage
\end{frame}
%
% Adding table of contents
\begin{frame}[noframenumbering, plain]
\tableofcontents
\end{frame}
%
\section{Section 1}
\subsection{Subsection 1.A}
\begin{frame}{How blocks are defined}
\begin{block}{Block}
This was created using block environment.
\end{block}
\begin{alertblock}{Alertblock}
This was created using alertblock environment.
\end{alertblock}
\begin{definition}
This was created using definition environment.
\end{definition}
\begin{example}
This was created using example environment.
\end{example}
\end{frame}
%
\section{Section 2}
\subsection{Subsection 2.A}
\begin{frame}{How lists are defined}
\begin{columns}
\column{0.5\paperwidth}
\begin{enumerate}
\item item 1 of enumerate
\item item 2 of enumerate
\item item 3 of enumerate
\item item 4 of enumerate
\end{enumerate}
\column{0.5\paperwidth}
\begin{itemize}
\item item 1 of itemize
\item item 2 of itemize
\item item 3 of itemize
\item item 4 of itemize
\end{itemize}
\end{columns}
\end{frame}
\end{document}
答案1
(sub-)section in head/foot
重新定义标题时,您需要实际使用字体:
\documentclass{beamer}
% loading packages
\usepackage{fontspec}
% Removing Navigation Icon
\setbeamertemplate{navigation symbols}{}
%customizing headline
\setbeamertemplate{headline}
{%
\leavevmode %\bfseries\normalsize % this wrok just fine, however \setbeamerfont command does not seem to do anything.
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=10pt, dp=5pt, center]{section in head/foot}
\usebeamerfont{section in head/foot}%
\insertsectionhead
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=10pt, dp=5pt, center]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}
\insertsubsectionhead
\end{beamercolorbox}
}
\setbeamercolor{section in head/foot}{bg=black!30, fg=black}
\setbeamercolor{subsection in head/foot}{bg=red!30, fg=black}
\setbeamerfont{section in head/foot}{series=\bfseries,size=\normalsize} % this command is not working
\setbeamerfont{subsection in head/foot}{series=\bfseries, size=\normalsize} % this command is not working
\begin{document}
% first page (Title Page) costomization
\title{Main Title Here}
\subtitle{Subtitle Here}
\author{Author}
\institute{Institute Name}
\date{\today}
\begin{frame}[noframenumbering, plain]
\titlepage
\end{frame}
%
% Adding table of contents
\begin{frame}[noframenumbering, plain]
\tableofcontents
\end{frame}
%
\section{Section 1}
\subsection{Subsection 1.A}
\begin{frame}{How blocks are defined}
\begin{block}{Block}
This was created using block environment.
\end{block}
\begin{alertblock}{Alertblock}
This was created using alertblock environment.
\end{alertblock}
\begin{definition}
This was created using definition environment.
\end{definition}
\begin{example}
This was created using example environment.
\end{example}
\end{frame}
%
\section{Section 2}
\subsection{Subsection 2.A}
\begin{frame}{How lists are defined}
\begin{columns}
\column{0.5\paperwidth}
\begin{enumerate}
\item item 1 of enumerate
\item item 2 of enumerate
\item item 3 of enumerate
\item item 4 of enumerate
\end{enumerate}
\column{0.5\paperwidth}
\begin{itemize}
\item item 1 of itemize
\item item 2 of itemize
\item item 3 of itemize
\item item 4 of itemize
\end{itemize}
\end{columns}
\end{frame}
\end{document}