在 beamer 中使用汉诺威主题,我想要:
一个侧边栏用于标题框,
所有其他框架都使用一个侧边栏,
所以我尝试了以下 MWE
\documentclass[table]{beamer}
\usetheme[width=.250\paperwidth]{Hannover}
\makeatletter
\setbeamertemplate{sidebar}{\includegraphics[height=\paperheight]{mysidebar-title}}
\setbeamertemplate{sidebar left}{\includegraphics[height=\paperheight]{mysidebar-generic}}
\makeatother
\setbeamercolor{frametitle}{bg=white}
\title[Title]{Title of the presentation (which may run over more than one line)}
\date[]{Very soon,\\ somewhere}
\author[]{Me and my colleagues}%
\institute{\centering Nice Lab logo }
\begin{document}
\frame{\titlepage}
\begin{frame}
\frametitle{Short slide title}
First slide
\end{frame}
\begin{frame}
\frametitle{Very very veryyyyyyyyyyyyyyyyyyyyyyyy looooooooooooooooooooooong title}
Last slide
\end{frame}
\end{document}
用于标题框侧边栏 (mysidebar-title)
\documentclass[border = 0.0cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[fill=cyan] (0,0) rectangle (7,21.0);
\end{tikzpicture}
\end{document}
以及其他框架侧边栏(mysidebar-generic)
\documentclass[border = 0.0cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[fill=cyan!50!white] (0,0) rectangle (7,21.0);
\end{tikzpicture}
\end{document}
我从 Beamer 的用户指南中获得了使用 {sidebar} 和 {sidebar left} 的想法,但显然有些地方我不明白,因为它不起作用,而且我在所有幻灯片上都看到相同的滑动条。
答案1
\documentclass[table]{beamer}
\usetheme[width=.2\paperwidth]{Hannover}
\setbeamertemplate{sidebar left}{\includegraphics[height=\paperheight,width=.2\paperwidth]{example-image-a}}
\begin{document}
\frame{\titlepage}
\setbeamertemplate{sidebar left}{\includegraphics[height=\paperheight,width=.2\paperwidth]{example-image-b}}
\begin{frame}
\frametitle{Short slide title}
First slide
\end{frame}
\begin{frame}
\frametitle{Very very very very loooooong slide title}
Second slide
\end{frame}
\begin{frame}
\frametitle{Very very veryyyyyyyyyyyyyyyyyyyyyyyy looooooooooooooooooooooong title}
Last slide
\end{frame}
\end{document}