beamerbasedecode.sty
在类的源文件的开头beamer
,定义了两个开关:
\newif\ifbeamer@anotherslide
\newif\ifbeamer@localanotherslide
通过阅读beamerbasedecode.sty
和beamerbaseframe.sty
,我了解到\ifbeamer@anotherslide
:在每个frame
环境中,beamer
调用\beamer@masterdecode
,和\beamer@masterdecode
都会改变开关\ifbeamer@anotherslide
。虽然这是真的,但beamer
会一次又一次地调用\beamer@masterdecode
,最后生成框架中的所有幻灯片。
在里面\beamerbasedecode.sty
,似乎\ifbeamer@anotherslide
和\ifbeamer@localanotherslide
总是具有相同的值:
\global\beamer@anotherslidetrue\beamer@localanotherslidetrue
唯一的区别是\global
第一个之前的。但在主宏中\beamer@masterdecode
,第二个也是全局的。
\def\beamer@stoptexts{| stop:0| }
{
\catcode`\|=13
\catcode`\:=13
\catcode`\,=13
\catcode`\.=13
\catcode`\+=13
\catcode`\-=13
\catcode`\(=13
\catcode`\)=13
\catcode`\ =13
\gdef\beamer@masterdecode#1{% must be called within a group
\ifnum\catcode`\|=13\edef|{\string|}\fi%
\ifnum\catcode`\:=13\edef:{\string:}\fi%
\ifnum\catcode`\,=13\edef,{\string,}\fi%
\ifnum\catcode`\.=13\edef.{\string.}\fi%
\ifnum\catcode`\+=13\edef+{\string+}\fi%
\ifnum\catcode`\-=13\edef-{\string-}\fi%
\ifnum\catcode`\(=13\edef({\string(}\fi%
\ifnum\catcode`\)=13\edef){\string)}\fi%
\ifnum\catcode`\ =13\edef {\string }\fi%
\edef\beamer@@@temp{#1\beamer@stoptexts}%
\beamer@localanotherslidefalse%
\setbox0=\hbox{%
\expandafter\beamer@decode\beamer@@@temp%
\ifbeamer@localanotherslide\global\beamer@localanotherslidetrue\fi}%
}%
\ifbeamer@anotherslide
这让我很困惑:和之间有什么区别\ifbeamer@localanotherslide
? 为什么我们需要\ifbeamer@localanotherslide
?