缺少 Framesubtitle

缺少 Framesubtitle

我的代码:

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usetheme{CambridgeUS}
\usepackage{lmodern}
\usepackage{beamerthemeshadow}
\usepackage[ngerman]{babel}
\usepackage{array}
\usepackage{etex}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usefonttheme{professionalfonts} % default family is serif
\setbeamercolor{frametitle}{fg=white,bg=blue}
\setbeamerfont{frametitle}{size=\large}
\setbeamertemplate{frametitle}{\color{black}\insertframetitle}
\setbeamerfont{framesubtitle}{size=\normalfont\tiny}
\setbeamercolor{framesubtitle}{fg=black}
\setbeamerfont{footline}{size=\fontsize{5}{2}\selectfont}
\setbeamercolor{title}{fg=white,bg=blue}
\setbeamercolor{section in head/foot}{fg=white, bg=blue}
\makeatother
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{}
\begin{document}
\title{Titel der Vorlesung} 
\subtitle{SoSe XXXX} 
\author{Max Mustermann}
\date{}
\begin{frame}
\frametitle{Deskriptive Beschreibung linearer Zusammenhänge}
\framesubtitle{Untertitel in kleiner Schrift}
\end{frame}
\end{document}

问题:

  • 框架字幕不显示
  • 我怎样才能改变框架标题到幻灯片顶部的距离?

在此处输入图片描述

答案1

您可以\setbeamertemplate{frametitle}{\color{black}\insertframetitle}覆盖默认布局以仅显示框架标题,周围无空格且无字幕。

相反,我会直接使用主题提供的 frametitle 模板,然后调整颜色以满足您的需求。这样做的好处是,不仅会自动显示字幕,还可以通过常用的颜色和字体模板控制颜色、字体等。

可以简单地通过不将标题设置为空来调整上述间距,而是将其设置为您喜欢的任何垂直空间,例如\setbeamertemplate{headline}{\vspace*{0.3cm}}

\documentclass[hyperref={pdfpagelabels=false}]{beamer}

\usepackage{lmodern}
\usepackage[ngerman]{babel}
\usepackage{array}
\usepackage{etex}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}

\usetheme{CambridgeUS}
\useoutertheme{shadow}

\usefonttheme{professionalfonts} % default family is serif
\setbeamerfont{frametitle}{size=\large}
\setbeamerfont{framesubtitle}{size=\normalfont\tiny}
\setbeamerfont{footline}{size=\fontsize{5}{2}\selectfont}

\setbeamercolor{frametitle}{fg=black,bg=white}
\setbeamercolor{frametitle right}{bg=white}
\setbeamercolor{framesubtitle}{fg=black}
\setbeamercolor{title}{fg=white,bg=blue}
\setbeamercolor{section in head/foot}{fg=white, bg=blue}
\setbeamercolor{title in head/foot}{fg=white, bg=structure.fg}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{\vspace*{0.3cm}}

\makeatletter
\AtBeginDocument{
  \pgfdeclareverticalshading{beamer@topshade}{\paperwidth}{%
    color(0pt)=(bg);
    color(4pt)=(bg)}
}
\makeatother

\title{Titel der Vorlesung} 
\subtitle{SoSe XXXX} 
\author{Max Mustermann}
\date{}

\begin{document}

\begin{frame}
\frametitle{Deskriptive Beschreibung linearer Zusammenhänge}
\framesubtitle{Untertitel in kleiner Schrift}
\end{frame}
\end{document}

在此处输入图片描述


无关:

  • \makeatother你的代码中有一个多余的
  • \usepackage{beamerthemeshadow}建议\useoutertheme{shadow}

相关内容