更改 Beamer, Copenhagen 中的 \headheight

更改 Beamer, Copenhagen 中的 \headheight

我想增加哥本哈根 Beamer 的 \headheight。

我试过了,\setlength{\headheight}{10in}似乎没有用。

答案1

编辑: 我之前的回答实际上对 Sidebar 外部主题有效,但对于 Copenhagen 使用的 Split 则不那么简单。它解释了您遇到的错误,因为\beamer@headheightSplit 中未定义。

回答:

您可以使用以下

\makeatletter
\newdimen\beamer@headheight
\beamer@headheight=10in

\setbeamertemplate{headline}{
  \leavevmode%
  \@tempdimb=2.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifnum\@tempdimb<\beamer@headheight
    \setlength{\@tempdimb}{\beamer@headheight}
  \fi
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.125ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
  \fi%  
}
\makeatother

您可以定义一个可以轻松修改的新长度\beamer@headheight。这是对 Split 外部主题的修改,它将检查您的新头部高度是否大于 Beamer 设置的高度;如果是,它将使用这个新长度。如果不是,它不会改变任何东西以避免弄乱标题。如果您总是想强制标题具有高度\beamer@headheight,您可以简单地使用

\makeatletter
\newdimen\beamer@headheight
\beamer@headheight=20pt

\setbeamertemplate{headline}{
  \leavevmode%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=\beamer@headheight]{section in head/foot}%
    \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=\beamer@headheight]{subsection in head/foot}%
    \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
  \end{beamercolorbox}%
}
\makeatother

相关内容