当在 beamer 中创建的脚注包含深度太大的框时,beamer 会在带有脚注的幻灯片前插入一个空白幻灯片。
平均能量损失
\documentclass{beamer}
\setbox0=\hbox{}
\dp0=1.131ex
\begin{document}
\begin{frame}
\footnote{\box0 }
\end{frame}
\end{document}
如果我将其更改1.131ex
为1.130ex
,则只有一张幻灯片。
我的实际问题与具有人工深度的空盒子无关(当然)。我可以通过将深度过大的材料放入盒子并将其设置\dp
为 来解决此问题0pt
,但这似乎总体上是错误的解决方案。
在这种情况下,防止插入额外幻灯片的正确方法是什么?
答案1
这在 beamer v3.55 中曾短暂地起作用,可以从中查看https://github.com/josephwright/beamer/releases/tag/v3.55
beamer v3.54 或更早版本的解决方法:
\documentclass{beamer}
\setbox0=\hbox{}
\dp0=1.131ex
\makeatletter
\long\def\beamer@doseveralframes#1{%
\ifx\beamer@againname\@empty\else%
% Again stuff
\expandafter \gdef\csname beamer@again@\beamer@againname\endcsname{{#1}}%
\fi%
\beamer@slideinframe=1\relax%
\loop%
\beamer@anotherslidefalse%
\gdef\beamer@doifnotinframe{}%
\def\beamer@doifinframe{\begin{beamer@frameslide}%
#1%
\end{beamer@frameslide}}%
\beamer@masterdecode{\beamer@whichframes}%
\beamer@donow%
\ifbeamer@twoscreenstext%
\beamer@dosecondscreennow{#1}% two screen stuff
\fi%
\ifbeamer@anotherslide
\advance\beamer@slideinframe by 1\relax
\repeat%
\beamer@writeslidentry%
\beamer@reseteecodes}
\makeatother
\begin{document}
\begin{frame}
\footnote{\box0 }
\end{frame}
\end{document}
beamer v3.56 或更新版本的解决方法:
\documentclass{beamer}
\setbox0=\hbox{}
\dp0=1.131ex
\makeatletter
% The main decoding macro tolerates a range of active characters, which
% require a little set up. In particular, as an active space is allowed
% all of the lines here have to be terminated with "%". The two-step
% setup for \beamer@@@temp makes sure everything is expanded and removes
% all of the spaces at this stage.
\newbox\beamer@decode@box
\begingroup
\catcode`\|=\active
\catcode`\:=\active
\catcode`\,=\active
\catcode`\.=\active
\catcode`\+=\active
\catcode`\-=\active
\catcode`\(=\active
\catcode`\)=\active
\catcode`\ =\active
\xdef\beamer@masterdecode#1{%
\noexpand\beamer@localanotherslidefalse%
\setbox0=\hbox{%
\unexpanded{%
\ifnum\catcode`\|=\active\edef|{\string|}\fi%
\ifnum\catcode`\:=\active\edef:{\string:}\fi%
\ifnum\catcode`\,=\active\edef,{\string,}\fi%
\ifnum\catcode`\.=\active\edef.{\string.}\fi%
\ifnum\catcode`\+=\active\edef+{\string+}\fi%
\ifnum\catcode`\-=\active\edef-{\string-}\fi%
\ifnum\catcode`\(=\active\edef({\string(}\fi%
\ifnum\catcode`\)=\active\edef){\string)}\fi%
\ifnum\catcode`\ =\active\edef {\string }\fi}%
\edef\noexpand\beamer@@@temp{#1\string|stop\string:0\string|}%
\edef\noexpand\beamer@@@temp{\unexpanded{\expandafter\zap@space\beamer@@@temp}%
\space\noexpand\@empty}%
\unexpanded{\expandafter\beamer@decode\beamer@@@temp%
\ifbeamer@localanotherslide\aftergroup\beamer@localanotherslidetrue\fi}%
}%
}%
\endgroup
\makeatother
\begin{document}
\begin{frame}
\footnote{\box0 }
\end{frame}
\end{document}