我有一个 beamer 项目,其中需要有一个侧边栏,但不需要幻灯片\AtBeginSection
。
我尝试查看 sidebar-theme ( kpsewhich beamerouterthemesidebar.sty
) 的定义,并定义一个新的空模板,我可以在\AtBeginSection
-block 中本地切换到该模板。这可以满足我的要求,但在本地不起作用。如果我\setbeamertemplate
在\AtBeginSection
-block 中包含,则会出错。
梅威瑟:
\documentclass{beamer}
\useoutertheme[%
width=3cm,
height=1cm,
hideothersubsections,
]{sidebar}
% This works but disables sidebar globally
\makeatletter
\defbeamertemplate{sidebar \beamer@sidebarside}{dummy}{}
\setbeamertemplate{sidebar \beamer@sidebarside}[dummy] % Comment out for local option
\makeatother
\AtBeginSection[]{
% This throws an error:
% \makeatletter
% \setbeamertemplate{sidebar \beamer@sidebarside}[dummy]
% \makeatother
\begin{frame}
{\thesection\\[.4ex]\insertsectionhead}
\end{frame}
}
\begin{document}
\section{First section}
\begin{frame}{Title}
Some content
\end{frame}
\begin{frame}{Title}
Some content
\end{frame}
\section{Second section}
\begin{frame}{Title}
Some content
\end{frame}
\begin{frame}{Title}
Some content
\end{frame}
\end{document}
答案1
我找到了一种解决方法,就是制作框架[plain]
侧边栏框架自动隐藏。
所以我的\AtBeginSection
样子是这样的:
\AtBeginSection{%
{%
\setbeamertemplate{footline}{}
\setbeamertemplate{background}{%
\begin{tikzpicture}[at=(current page.south east)]
\shadedraw[shading=axis,
left color=left,
right color=right,
shading angle=135,
middle color=right,
vertical custom shading=40
]
(0,0) rectangle (\paperwidth,\paperheight);
\fill[white] (\paperwidth,\paperheight) rectangle (\paperwidth-30.5mm,0);
\node at (\paperwidth-1.8cm,4cm) {\includegraphics[width=2.5cm]{Titelfolie}};
\node at (\paperwidth-1.6cm,\paperheight-.7cm) {\includegraphics[width=2.2cm]{Hochschule-esslingen}};
\node[font=\Huge, text=white, scale=1.5, align=left, text width=7cm] at (\paperwidth-9.5cm,\paperheight-5cm) {\thesection\\\MakeUppercase\insertsectionhead};
\end{tikzpicture}
}
\begin{frame}<article:0>[plain]
\end{frame}
}
}