当我们使用 beamer 指定的格式时\documentclass[compress]{beamer}
,如何在每张幻灯片的标题上方和页脚下方添加/插入一条黑线?
\documentclass[compress]{beamer}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]{}
\setbeamercolor{section in head/foot}{fg=secinhead,bg=black}
\setbeamercolor{subsection in head/foot}{fg=secinhead,bg=black}
\setbeamerfont{footline}{size=\tiny}
\usecolortheme[rgb={0,0,0}]{structure}
\useinnertheme{circles}
\newenvironment{proenv}{\only{\setbeamercolor{local structure}{fg=black}}}{}
\useoutertheme{infolines}
\usefonttheme{structurebold}
\setbeamertemplate{background canvas}[vertical shading][bottom=white,top=white]
答案1
这可以通过以下方式实现
\addtobeamertemplate{headline}{}{\rule{\paperwidth}{3pt}}
\addtobeamertemplate{footline}{\rule{\paperwidth}{3pt}}{}
使用原始代码中的相关设置的一个小示例:
\documentclass[compress]{beamer}
\usetheme{Montpellier}
\useoutertheme{infolines}
\author{The Author}
\title{The Title}
\institute{The Institute}
\addtobeamertemplate{headline}{}{\rule{\paperwidth}{3pt}}
\addtobeamertemplate{footline}{\rule{\paperwidth}{3pt}}{}
\begin{document}
\begin{frame}
test
\end{frame}
\end{document}
结果:
我在示例中选择的规则可能太粗;3pt
请选择所需的厚度值,而不是。