答案1
您可以重新定义\insertsectionnavigationhorizontal
命令并用 parbox 包装各部分。
这是一个可以普遍实现的快速而粗略的示例:
\makeatletter
\def\insertsectionnavigationhorizontal#1#2#3{%
\hbox to #1{{%
\def\slideentry##1##2##3##4##5##6{}%
#2\hskip.3cm%
\newdimen\tmp@parbox%
\setlength\tmp@parbox{#1}%
\addtolength\tmp@parbox{-.6cm}%
\parbox{\tmp@parbox}{\raggedleft%
\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
\setbox\beamer@sectionbox=\hbox{}%
\ht\beamer@sectionbox=1.875ex%
\dp\beamer@sectionbox=0.75ex%
\hskip-1.875ex plus-1fill\dohead%
\box\beamer@sectionbox}\hfil\hskip.3cm%
#3}}}
\makeatother
这是主题的完整示例progressbar
,其中标题高度增加了。
\documentclass[compress]{beamer}
\usetheme{progressbar}
\progressbaroptions{headline=sections}
\makeatletter
\def\insertsectionnavigationhorizontal#1#2#3{%
\hbox to #1{{%
\def\slideentry##1##2##3##4##5##6{}%
#2\hskip.3cm%
\newdimen\tmp@parbox%
\setlength\tmp@parbox{#1}%
\addtolength\tmp@parbox{-.6cm}%
\parbox{\tmp@parbox}{\raggedleft%
\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
\setbox\beamer@sectionbox=\hbox{}%
\ht\beamer@sectionbox=1.875ex%
\dp\beamer@sectionbox=0.75ex%
\hskip-1.875ex plus-1fill\dohead%
\box\beamer@sectionbox}\hfil\hskip.3cm%
#3}}}
\setbeamertemplate{headline}
{%
\edef\tempa{sections}
\ifx\progressbar@headline\tempa
\leavevmode%
\begin{beamercolorbox}[ignorestructure.bg=true,wd=\paperwidth,ht=8ex,dp=1.125ex]{structure.fg}%
\insertsectionnavigationhorizontal{\paperwidth}{}{}%\hskip0pt plus1filll}{}%
\vspace*{0mm}
\end{beamercolorbox}%
\else
\leavevmode%
\begin{beamercolorbox}[wd=\paperwidth,ht=4ex,dp=1.125ex]{structure.fg}%
\end{beamercolorbox}%
\fi
}
\makeatother
\begin{document}
\section{First very long section name}
\section{Second very long section name}
\section{Third very long section name}
\section{Fourth very long section name}
\section{Fifth very long section name}
\begin{frame}{Title}
Content
\end{frame}
\end{document}