由于 Beamer 华沙主题中的子部分标题位置过高,导致垂直框溢出

由于 Beamer 华沙主题中的子部分标题位置过高,导致垂直框溢出

请考虑以下示例:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\showboxdepth=\maxdimen
\showboxbreadth=\maxdimen

\title{a}

\usetheme{Warsaw}

\begin{document}

\maketitle

\section{b}

\subsection{c}

\begin{frame}{d}
e
\end{frame}

\end{document}

Overfull \vbox (3.1309pt too high) has occurred while \output is active从幻灯片的样子来看,它传达的信息并不令人惊讶:

在此处输入图片描述

相关部分放大:

在此处输入图片描述

因此,出于某种原因,c(小节标题)的位置太高了。我不知道这么小的例子会出什么问题……

以下是日志文件的相关部分:

Overfull \vbox (3.1309pt too high) has occurred while \output is active
\vbox(11.3737+0.0)x182.09767
.\glue 0.0 plus 1.0fil
.\hbox(14.50461+0.0)x182.09767
..\vbox(14.50461+0.0)x182.09767
...\pdfcolorstack 0 push {1 g 1 G}
...\glue 1.50092
...\hbox(4.50278+2.00124)x182.09767
....\pdfstartlink(*+*)x* attr{/Border[0 0 0]/H/N/C[.5 .5 .5]} action goto name{Navigation2}
....\hbox(2.65184+0.0)x182.09767, glue set 161.89502fil
.....\glue 8.5359
.....\T1/cmss/m/n/6 c
.....\glue 0.0 plus 1.0fil
.....\glue 8.5359
....\pdfendlink
...\pdfcolorstack 0 pop
...\glue 1.50092
...\glue(\parskip) 0.0
...\glue(\baselineskip) 4.99876
...\hbox(0.0+0.0)x182.09767, glue set 91.04884fil
....\hbox(0.0+0.0)x0.0
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0 plus 1.0fil
.\glue 0.0 plus 1.0fil

我的投影机是 2017/08/22 v3.43(一切都是最新的,MikTeX 2.9)。

答案1

更新:漏洞已修复beamerv3.44,该示例现在可以正确运行。

负责生成标题的宏\insertsectionnavigation和的定义似乎存在小错误/不一致:\insertsubsectionnavigation

在中\insertsectionnavigation,我们有(beamerbasenavigation.sty,第 735-755 页)

\def\insertsectionnavigation#1{%
  \hbox to #1{%
    \vbox{{% [...]
     % [...]
     \dohead\vskip0.5625ex}}\hfil}}

\insertsubsectionnavigation对于beamerbasenavigation.sty,第 769-792 页)

\def\insertsubsectionnavigation#1{%
  \hbox to #1{%
    \vbox{{%
      % [...]
      \dohead\vskip0.5625ex}\hfil}}}

请注意,在for\hfil之外,但在 for 之内。\vbox\insertsectionnavigation\insertsubsectionnavigation

如果你修复了的定义\insertsubsectionnavigation,警告就会消失,并且标题会正确显示:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\showboxdepth=\maxdimen
\showboxbreadth=\maxdimen

\title{a}

\usetheme{Warsaw}

\makeatletter
\def\insertsubsectionnavigation#1{%
  \hbox to #1{%
    \vbox{{%
      \usebeamerfont{subsection in head/foot}\usebeamercolor[fg]{subsection in head/foot}%
      \vskip0.5625ex%
      \beamer@currentsubsection=0%
      \def\sectionentry##1##2##3##4##5{}%
      \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
        \ifnum##2>\beamer@currentsubsection%
        \beamer@currentsubsection=##2%
        \def\insertsubsectionhead{##5}%
        \def\insertsectionheadnumber{##1}%
        \def\insertsubsectionheadnumber{##2}%
        \def\insertpartheadnumber{##6}%
        \setbox\beamer@tempbox=\hbox{\beamer@link(##4){%
            \hbox to #1{\hskip0.3cm%
              \ifnum\c@subsection=##2%
                {\usebeamertemplate{subsection in head/foot}}%
              \else%
                {\usebeamertemplate{subsection in head/foot shaded}}%
              \fi\hfil\hskip0.3cm}}}%
        \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
        \box\beamer@tempbox\fi\fi\fi}%
      \dohead\vskip0.5625ex}}\hfil}} % FIXED
\makeatother

\begin{document}

\maketitle

\section{b}

\subsection{c}

\begin{frame}{d}
e
\end{frame}

放大标题部分,并正确对齐章节和小节

相关内容