Browse Source

patch instead of completely redefine beamer@frameslide

master
Jonathan Spratte 6 months ago
parent
commit
604f25d4f9
1 changed files with 9 additions and 103 deletions
  1. 9
    103
      MRTbeam/beamerouterthemeMRTbeam.sty

+ 9
- 103
MRTbeam/beamerouterthemeMRTbeam.sty View File

@@ -1,5 +1,7 @@
1 1
 \mode<presentation>
2 2
 
3
+\RequirePackage{etoolbox}
4
+
3 5
 \setbeamertemplate{background}{%>>=
4 6
   \begin{tikzpicture}
5 7
     \useasboundingbox (0,0) rectangle(\paperwidth,\paperheight);
@@ -62,117 +64,21 @@
62 64
 
63 65
 %% Invoke `noframetitle` if no frametitle was given >>=
64 66
 %% Code based on https://tex.stackexchange.com/a/389258/117050
65
-\renewenvironment{beamer@frameslide}{%
66
-  \ifbeamer@autobreak\else%
67
-    \ifx\beamer@againname\@empty%
68
-      {\let\@elt\beamer@restorecounter\beamer@overlaycounterresets}%
69
-    \else%
70
-      {\let\@elt\beamer@labelrestorecounter\beamer@overlaycounterresets}%
71
-    \fi%
72
-  \fi%
73
-  \global\c@beamerpauses=1\relax%
74
-  \expandafter\ifblank\expandafter{\beamer@framestartpage}{%
75
-    \stepcounter{subsectionslide}%
76
-    \xdef\beamer@framestartpage{\the\c@page}% only first time
77
-  }{\clearpage\beamer@notesactions}% cleanup from previous slide
78
-  \hypersetup{pdfpagetransition=R}%
79
-  \hypersetup{pdfpageduration=}%
80
-  \@ifundefined{thispdfpagelabel}{}{%
81
-  \thispdfpagelabel{\insertframenumber}}%
82
-  \xdef\beamer@frameendpage{\the\c@page}% every time
83
-  \beamer@setuplinks%
84
-  \beamer@displaybreak%
85
-  \global\setbox\beamer@zoombox=\box\voidb@x%
86
-  \def\beamer@zoomer{}%
87
-  \beamer@slidehaszoomfalse%
88
-  \gdef\insertframetitle{}%
89
-  \gdef\insertframesubtitle{}%
90
-  \gdef\beamer@frametitle{}%
91
-  \gdef\beamer@shortframetitle{}%
92
-  \gdef\beamer@framesubtitle{}%
93
-  \let\beamer@startcomment=\beamer@startcommentinframe%
94
-  % Start slide:
95
-  \beamer@framenotesbegin%
96
-    \global\setbox\beamer@framebox=\vbox\bgroup%
97
-    \beamer@inframetrue%
98
-    \let\frame=\framelatex% inside frames, use LaTeX's \frame command
99
-    \begin{beamer@framepauses}%
100
-      \refcounter{framenumber}%use frame number for  \label
101
-      \ifbeamer@shrink%
102
-        \hsize=\beamer@shrinkfactorinv\hsize%
103
-        \textwidth=\beamer@shrinkfactorinv\textwidth%
104
-        \linewidth=\beamer@shrinkfactorinv\linewidth%
105
-      \fi%
106
-      % Insert labels if necessary:
107
-      \ifx\beamer@againname\@empty\else%
108
-        \nointerlineskip\vbox to0pt{\vss%
109
-        \label<\the\beamer@slideinframe>{\beamer@againname<\the\beamer@slideinframe>}%
110
-        \ifnum\beamer@slideinframe=1\relax%
111
-          \label<1>{\beamer@againname}%
112
-        \fi%
113
-        }\nointerlineskip%
114
-      \fi%
115
-      \ifx\beamer@framehypertargets\@empty\else%
116
-        \nointerlineskip\vbox to0pt{\vss%
117
-          \beamer@framehypertargets%
118
-          \global\let\beamer@framehypertargets\@empty%
119
-        }\nointerlineskip%
120
-      \fi%
121
-      \vskip-\parskip\vbox{}%
122
-      \ifbeamer@plainframe\nointerlineskip\fi%
123
-    \beamer@checkframetitle}%
124
-    {\par
125
-    \end{beamer@framepauses}%
126
-  \egroup%
127
-  \ifx\beamer@frametitle\@empty%
67
+\patchcmd\endbeamer@frameslide
68
+  {\setbox\beamer@frametitlebox=\box\voidb@x\else}
69
+  {%
128 70
     \setbox\beamer@frametitlebox=\vbox{%
129 71
       \vbox{}%
130 72
       {\parskip0pt\usebeamertemplate***{noframetitle}\vskip0.25em}%
131 73
     }%
132
-  \else%
74
+    \else
133 75
     \def\MRTbeam@temp{*}%
134 76
     \ifx\beamer@frametitle\MRTbeam@temp%
135 77
       \def\insertframetitle{}%
136 78
     \fi%
137
-    \setbox\beamer@frametitlebox=\vbox{%
138
-      \vbox{}%
139
-      {\parskip0pt\usebeamertemplate***{frametitle}\vskip0.25em}%
140
-    }%
141
-  \fi%
142
-  \ifbeamer@plainframe%
143
-    \beamer@frametextheight=\paperheight%
144
-  \else%
145
-    \beamer@frametextheight=\textheight%
146
-  \fi%
147
-  \advance\beamer@frametextheight by-\ht\beamer@frametitlebox%
148
-  \advance\beamer@frametextheight by-\dp\beamer@frametitlebox%
149
-  \advance\beamer@frametextheight by-\beamer@frametopskip%
150
-  \ifbeamer@shrink%
151
-    \beamer@shrinkframebox%
152
-  \fi%
153
-  \ifx\beamer@zoomer\@empty
154
-    \setbox\beamer@framebox=\vbox{%
155
-      \nobreak\vbox{}\nobreak\par\nobreak\beamer@entrycode\nobreak%
156
-      \nointerlineskip\unvbox\beamer@frametitlebox%
157
-      \nobreak%
158
-      \ifbeamer@autobreak%
159
-        \vskip\beamer@frametopskipautobreak%
160
-      \else%
161
-        \vskip\beamer@frametopskip%
162
-      \fi%
163
-      \nobreak%
164
-      \nointerlineskip\box\beamer@zoombox\nointerlineskip%
165
-      \nobreak%
166
-      \ifbeamer@slidehaszoom\box\beamer@framebox\else\unvbox\beamer@framebox\fi%
167
-      % bottom skip is added in autobreakframebox
168
-    }%
169
-    \beamer@autobreakframebox%
170
-  \else%
171
-    \beamer@zoomer%
172
-  \fi%
173
-  \beamer@undolabels%
174
-  \beamer@framenotesend%
175
-  \box\beamer@framebox}
79
+  }
80
+  {}
81
+  {\PackageError{MRTbeam}{Failed to patch beamer's frameslide}{}}
176 82
 %=<<
177 83
 
178 84
 \setbeamertemplate{footline}{%>>=

Loading…
Cancel
Save