frametitle
我希望自定义我的和的外观framesubtitle
。但是当我尝试这样做时,只有frametitle
被渲染。这是一个示例代码:
\documentclass[20pt, aspectratio=169]{beamer}
\usetheme{default}
\setbeamertemplate{navigation symbols}{}
\usefonttheme{serif}
\setbeamertemplate{frametitle}{\color{white}\textbf{\tiny\insertframetitle}}
\setbeamertemplate{framesubtitle}{\color{white}\tiny\insertframesubtitle}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{frame}{Hello world}{Hello world subtitle}
\begin{equation*}
h_\alpha = \left\| \partial_\alpha \vec{r} \right\|
\end{equation*}
\end{frame}
\end{document}
注意,只渲染了标题。这是为什么呢?
答案1
确实,没有framesubtitle
模板,但你可以framesubtitle
使用以下方法设置独立的颜色和字体:
\setbeamerfont{framesubtitle}{<your specification>}
\setbeamercolor{framesubtitle}{<your specification>}
完整示例:
\documentclass[20pt, aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\setbeamertemplate{navigation symbols}{}
\usefonttheme{serif}
\setbeamerfont{frametitle}{size=\tiny,series=\bfseries}
\setbeamercolor{frametitle}{fg=white}
\setbeamerfont{framesubtitle}{size=\normalfont\tiny}
\setbeamercolor{framesubtitle}{fg=white}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\begin{document}
\begin{frame}{Hello world}{Hello world subtitle}
\begin{equation*}
h_\alpha = \left\| \partial_\alpha \vec{r} \right\|
\end{equation*}
\end{frame}
\end{document}
请注意,由于您只更改了的颜色和字体属性frametitle
,因此您也可以使用的颜色和字体来设置这些属性frametitle
(就像我在示例代码中所做的那样),而不是使用模板frametitle
,这对于重大更改更有意义。
答案2
似乎您没有告诉beamer
要排版framesubtitle
。我不认为这framesubtitle
是您可以设置的模板……以下方法对我有用:
\documentclass[20pt, aspectratio=169]{beamer}
\usetheme{default}
\setbeamertemplate{navigation symbols}{}
\usefonttheme{serif}
\setbeamercolor{frametitle}{fg=white}
\setbeamerfont{frametitle}{size=\tiny}
\setbeamertemplate{frametitle}{\textbf{\insertframetitle}\\\insertframesubtitle}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\usepackage{amsmath}
\begin{document}
\begin{frame}{Hello world}
\begin{equation*}
h_\alpha = \left\| \partial_\alpha \vec{r} \right\|
\end{equation*}
\end{frame}
\end{document}