![如何在 Beamer 中拥有 2 个侧边栏(汉诺威主题)](https://linux22.com/image/377490/%E5%A6%82%E4%BD%95%E5%9C%A8%20Beamer%20%E4%B8%AD%E6%8B%A5%E6%9C%89%202%20%E4%B8%AA%E4%BE%A7%E8%BE%B9%E6%A0%8F%EF%BC%88%E6%B1%89%E8%AF%BA%E5%A8%81%E4%B8%BB%E9%A2%98%EF%BC%89.png)
在 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}