我在用beamer2thesis
,即beamerthemeTorinoTh
编译我的演示文稿幻灯片的样式。这很好,但我意识到我需要做一些修改。上部标题条纹似乎没有必要,除非我把导航栏放在那里,以显示我们所在的部分。我修改了 outertheme 样式文件,
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt,center]{page header}%
\usebeamerfont{navigation} \insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1filll}{}%
\end{beamercolorbox}%
}%
导航文本位于颜色框的底部。我希望它位于框的中心,而不是这么低的位置。我需要做任何修改吗?顺便说一句,我希望颜色是白色,而不是这种交互颜色,因为它看起来不太清楚。
答案1
您可以在里面使用\vbox
和来使其内容居中:\vfil
beamercolorbox
\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{page header}%
\vbox to\headerheight{\vfil\insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1filll}{}\vfil}%
\end{beamercolorbox}
为了使部分变成白色,必须更改投影仪section in head/foot
模板section in head/foot shaded
:
\setbeamertemplate{section in head/foot}{\color{fg}\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{fg!50!bg}\insertsectionhead}
\setbeamercolor{section in head/foot}{fg=white}
完整示例代码:
\documentclass{beamer}
\usetheme{TorinoTh}
\makeatletter
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{page header}%
\vbox to\headerheight{\vfil\insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1filll}{}\vfil}%
\end{beamercolorbox}%
}%
\vskip0pt%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=\beamer@torinoth@line]{second header}%
\end{beamercolorbox}%
}
}
\makeatother
\setbeamertemplate{section in head/foot}{\color{fg}\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{fg!50!bg}\insertsectionhead}
\setbeamercolor{section in head/foot}{fg=white}
\begin{document}
\section{Introduction}
\frame{}
\section{Conclusion}
\frame{}
\end{document}
结果:
编辑:如果您只想显示标题中的当前部分,则可以使用以下命令beamercolorbox
代替上述代码:
\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt,right]{page header}%
\vbox to\headerheight{\vfil{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}\secname\hspace*{.3cm}}\vfil}%
\end{beamercolorbox}