diff options
author | Karl Berry <karl@freefriends.org> | 2017-07-14 22:16:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-07-14 22:16:30 +0000 |
commit | 46e95f178cfedc9839460ee35880698050f7644a (patch) | |
tree | 730f540a21d7047a243e929c74e4158674675814 /Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty | |
parent | 44af1a53bf28c922f525bd635c417b22f3b99b39 (diff) |
beamer (14jul17)
git-svn-id: svn://tug.org/texlive/trunk@44798 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty | 269 |
1 files changed, 119 insertions, 150 deletions
diff --git a/Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty b/Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty index 488d7557563..57dfffeeaba 100644 --- a/Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty +++ b/Master/texmf-dist/tex/latex/beamer/beamerbasemodes.sty @@ -1,7 +1,7 @@ % Copyright 2003--2007 by Till Tantau % Copyright 2010 by Vedran Mileti\'c % Copyright 2012,2013,2015 by Vedran Mileti\'c, Joseph Wright -% Copyright 2016 Joseph Wright +% Copyright 2016,2017 by Joseph Wright % % This file may be distributed and/or modified % @@ -10,23 +10,23 @@ % % See the file doc/licenses/LICENSE for more details. -% -% Global Declarations used by beamer in all modes -% +% Force e-TeX and provide \patchcmd +\RequirePackage{etoolbox} + +% Booleans for options available for both beamer and beamerarticle +\newif\ifbeamer@blocks \beamer@blockstrue +\newif\ifbeamer@ams \beamer@amstrue +\newif\ifbeamer@amssymb \beamer@amssymbtrue +\newif\ifbeamer@countsect \beamer@countsectfalse % A no-op but for clarity +\newif\ifbeamer@keywords \beamer@keywordstrue + +% Scratch space \newbox\beamer@tempbox -\newif\ifbeamer@blocks -\newif\ifbeamer@ams -\newif\ifbeamer@amssymb -\newif\ifbeamer@countsect -\newif\ifbeamer@keywords -\beamer@blockstrue -\beamer@amstrue -\beamer@amssymbtrue -\beamer@countsectfalse -\beamer@keywordstrue \newcount\beamer@tempcount -\newcounter{beamerpauses} +% The pauses counter is public and global, and required by both +% beamer and beamerarticle +\newcounter{beamerpauses} \RequirePackage{beamerbasedecode} @@ -44,52 +44,59 @@ \newif\ifbeamer@inpresentation \beamer@inpresentationtrue -\def\beamer@makeinnocent#1{\catcode`#1=12 } \def\beamer@startcomment{% - \begingroup% - \let\do\beamer@makeinnocent\dospecials% - \beamer@makeinnocent\^^L% and whatever other special cases - \endlinechar`\^^M \catcode`\^^M=12 \beamer@processline} - -{\catcode`\^^M=12\endlinechar=-1% + \begingroup + \let\do\@makeother\dospecials + \catcode`\^^L=12 % and whatever other special cases + \endlinechar`\^^M % + \catcode`\^^M=12 % + \beamer@processline} + +\begingroup + \catcode`\^^M=12\relax\endlinechar=-1\relax% \long\gdef\beamer@processline#1^^M{% \def\beamer@test{#1}% \ifx\beamer@test\beamer@stopmodestar% \let\next=\beamer@modeoutsideframe% \else% - \ifx\beamer@test\beamer@stopmode% - \let\next=\mode% - \else% - \ifx\beamer@test\beamer@stoparticle% - \let\next=\article% + \ifx\beamer@test\beamer@stopmode% + \let\next=\mode% \else% - \ifx\beamer@test\beamer@stoppresentation% - \let\next=\presentation% + \ifx\beamer@test\beamer@stoparticle% + \let\next=\article% \else% - \ifx\beamer@test\beamer@stopcommon% - \let\next=\common% + \ifx\beamer@test\beamer@stoppresentation% + \let\next=\presentation% \else% - \ifx\beamer@test\beamer@stopdocument% - \let\next=\beamer@enddocument% - \else - \ifx\beamer@test\beamer@begindocument% - \let\next=\beamer@startdocument% + \ifx\beamer@test\beamer@stopcommon% + \let\next=\common% + \else% + \ifx\beamer@test\beamer@stopdocument% + \let\next=\beamer@enddocument% \else - \let\next=\beamer@processline% + \ifx\beamer@test\beamer@begindocument% + \let\next=\beamer@startdocument% + \else + \let\next=\beamer@processline% + \fi% \fi% \fi% \fi% \fi% \fi% \fi% - \fi% \next} -} +\endgroup \def\beamer@enddocument{\beamer@closer\end{document}} -\def\beamer@startdocument{\beamer@closer\begin{document}\def\beamer@closer{}\common} +\def\beamer@startdocument{% + \beamer@closer + \begin{document}% + \gdef\beamer@closer{}% + \mode<all>} \def\beamer@closer{} -{\escapechar=-1\relax% +\begingroup + \escapechar=-1\relax \xdef\beamer@stopmode{\string\\mode} \xdef\beamer@stopmodestar{\string\\mode*} \xdef\beamer@stoparticle{\string\\article} @@ -97,14 +104,18 @@ \xdef\beamer@stopcommon{\string\\common} \xdef\beamer@stopdocument{\string\\end\string\{document\string\}} \xdef\beamer@begindocument{\string\\begin\string\{document\string\}} -} +\endgroup + \newbox\beamer@commentbox \def\beamer@startcommentinframe{% - \begingroup% - \edef\beamer@closer{\egroup\beamer@closer}% - \setbox\beamer@commentbox=\vbox\bgroup\leavevmode} + \begingroup + \xdef\beamer@closer{\egroup\beamer@closer}% + \setbox\beamer@commentbox=\vbox\bgroup\leavevmode} \def\beamer@outsidemode{\afterassignment\beamer@treat\let\beamer@nexttoken=} + +% Deals with the various tokens that need to be 'active' even when skipping +% material outside frames \def\beamer@treat{% \ifx\beamer@nexttoken\frame\let\next=\beamer@stopoutsidemode\fi \ifx\beamer@nexttoken\lecture\let\next=\beamer@stopoutsidemode\fi @@ -126,69 +137,83 @@ \def\beamer@stopoutsidemode{\beamer@nexttoken} \def\beamer@checkenddoc#1{% \def\beamer@temp{#1}% - \ifx\beamer@temp\beamer@enddoc% - \let\next=\beamer@enddocument% - \else% - \let\next=\beamer@outsidemode% - \fi% + \ifx\beamer@temp\beamer@enddoc + \let\next=\beamer@enddocument + \else + \let\next=\beamer@outsidemode + \fi \next} \def\beamer@enddoc{document} \def\beamer@checkbeginframe#1{% \def\beamer@temp{#1}% - \ifx\beamer@temp\beamer@frametext% - \let\next=\beamer@beginframeenv% - \else% - \let\next=\beamer@outsidemode% - \fi% + \ifx\beamer@temp\beamer@frametext + \let\next=\beamer@beginframeenv + \else + \let\next=\beamer@outsidemode + \fi \next} \def\beamer@beginframeenv{\begin{frame}} \def\beamer@modeoutsideframe{% - \beamer@closer% + \beamer@closer + \gdef\beamer@closer{}% \gdef\beamer@mode{\beamer@modeoutsideframe}% - \ifbeamer@inpresentation% - \let\next=\beamer@outsidemode% - \gdef\beamer@closer{}% - \else% - \let\next=\relax% - \gdef\beamer@closer{}% + \ifbeamer@inpresentation + \let\next=\beamer@outsidemode + \else + \let\next=\relax \fi% \next} - -%obsolete, do note use: -\def\presentation{\mode<presentation>} -\def\article{\mode<article>} -\def\common{\mode<all>} +% Obsolete, do not use! +\newrobustcmd*\presentation{\mode<presentation>} +\newrobustcmd*\article{\mode<article>} +\newrobustcmd*\common{\mode<all>} % % Mode command % -\def\mode{\@ifstar\beamer@modeoutsideframe\beamer@@@mode} -\def\beamer@@@mode<#1>{\beamer@closer\@ifnextchar\bgroup{\beamer@modeinline<#1>}{\beamer@switchmode<#1>}} +\newrobustcmd*\mode{\@ifstar\beamer@modeoutsideframe\beamer@@@mode} +\def\beamer@@@mode<#1>{% + \beamer@closer + \@ifnextchar\bgroup + {\beamer@modeinline<#1>}% + {\beamer@switchmode<#1>}} \long\def\beamer@modeinline<#1>#2{% \gdef\beamer@closer{}% - \def\beamer@doifnotinframe{\@gobble}\def\beamer@doifinframe{\@firstofone}% - {\beamer@saveanother\beamer@slideinframe=1\relax% - \beamer@masterdecode{#1}% - \beamer@restoreanother}\beamer@donow{#2}% + \gdef\beamer@doifnotinframe{\@gobble}% + \def\beamer@doifinframe{\@firstofone}% + \begingroup + \beamer@saveanother + \beamer@slideinframe=1\relax% + \beamer@masterdecode{#1}% + \beamer@restoreanother + \endgroup + \beamer@donow{#2}% \beamer@mode\par} \def\beamer@switchmode<#1>{% \gdef\beamer@mode{\beamer@switchmode<#1>}% - \def\beamer@doifnotinframe{% - \let\next=\beamer@startcomment% + \gdef\beamer@doifnotinframe{% + \let\next=\beamer@startcomment \gdef\beamer@closer{\endgroup}% }% \def\beamer@doifinframe{% - \let\next=\relax% + \let\next=\relax \gdef\beamer@closer{}% - }% - {\beamer@saveanother\beamer@slideinframe=1\relax% - \beamer@masterdecode{#1}% - \beamer@restoreanother}\beamer@donow% + }% + \begingroup + \beamer@saveanother + \beamer@slideinframe=1\relax% + \beamer@masterdecode{#1}% + \beamer@restoreanother + \endgroup + \beamer@donow \next} +\def\beamer@saveanother{\let\beamer@savedif=\ifbeamer@anotherslide} +\def\beamer@restoreanother{\global\let\ifbeamer@anotherslide=\beamer@savedif} + \mode <all> @@ -203,79 +228,23 @@ \def\beamer@savemode{\expandafter\beamer@pushmode\expandafter{\beamer@mode}} \def\beamer@resumemode{\beamer@popmode} - - % % Stuff needed in both article and presentation version % -\def\jobnamebeamerversion{}% - -\def\includeslide{\@ifnextchar[{\@includeslide}{\@includeslide[]}} -\def\@includeslide[#1]#2{% - \ifx\jobnamebeamerversion\@empty% - \ClassError{beamer}{Invoke macro "setjobnamebeamerversion" first}{}% - \else% - \edef\beamer@args{[{#1,page=\csname beamer@slide#2\endcsname}]{\jobnamebeamerversion}}% - \expandafter\pgfimage\beamer@args% - \fi} - -\def\setjobnamebeamerversion#1{% - \def\jobnamebeamerversion{#1}% - {\makeatletter - \@input{\jobnamebeamerversion.snm}} -} - - - -% -% Check whether we should initiate transfer to another class (obsolete) -% +\newcommand*\jobnamebeamerversion{} -% Extract class name, if present -\def\beamer@classname{} -\def\beamer@classoptions{} -\def\beamer@classnamename{class} -\def\beamer@eq{=,} -\def\beamer@findclassname#1=#2,#3!{ - \def\beamer@temp{#1} - \ifx\beamer@temp\beamer@classnamename - \def\beamer@classname{#2} - \beamer@stripsign#3! - \fi} -\def\beamer@stripsign#1!{% - \def\beamer@temp{#1} - \ifx\beamer@temp\beamer@eq - % nothing to do +\newrobustcmd*\includeslide[2][]{% + \ifx\jobnamebeamerversion\@empty + \ClassError{beamer}{Invoke macro "setjobnamebeamerversion" first}\@ehc \else - \beamer@@stripsign#1! - \fi -} -\def\beamer@@stripsign#1,=,!{ - \def\beamer@classoptions{#1} - } - -\def\beamer@transfer{% - % Prepare... - \def\beamer@slide##1##2{\expandafter\gdef\csname - beamer@slide##1\endcsname{##2}} - - \beamer@inpresentationfalse - - \def\beamer@currentmode{article} - - \common - - \edef\beamer@classwhat{[\beamer@classoptions]{\beamer@classname}} - \expandafter\LoadClass\beamer@classwhat - \endinput - } - -\expandafter\beamer@findclassname\@classoptionslist,=,! -\ifx\beamer@classname\@empty - \let\beamer@transferifnecessary=\relax -\else - % Need to transfer to another class soon - \let\beamer@transferifnecessary=\beamer@transfer -\fi -\endinput + \edef\beamer@args + {[{#1,page=\csname beamer@slide#2\endcsname}]{\jobnamebeamerversion}}% + \expandafter\pgfimage\beamer@args + \fi} +\newrobustcmd*\setjobnamebeamerversion[1]{% + \gdef\jobnamebeamerversion{#1}% + \begingroup + \makeatletter + \@input{\jobnamebeamerversion.snm}% + \endgroup} |