| 1 |
% Copyright 2003-2007 by Till Tantau |
| 2 |
% Copyright 2010 by Vedran Mileti\'c |
| 3 |
% Copyright 2011-2013,2015 by Vedran Mileti\'c, Joseph Wright |
| 4 |
% Copyright 2016 by Joseph Wright |
| 5 |
% Copyright 2017,2018 by Louis Stuart, Joseph Wright |
| 6 |
% Copyright 2020-2026 by Joseph Wright, samcarter |
| 7 |
% |
| 8 |
% This file may be distributed and/or modified |
| 9 |
% |
| 10 |
% 1. under the LaTeX Project Public License and/or |
| 11 |
% 2. under the GNU Public License. |
| 12 |
% |
| 13 |
% See the file LICENSE.md for more details. |
| 14 |
|
| 15 |
\ProvidesClass{beamer} |
| 16 |
[2026/01/22 v3.77 A class for typesetting presentations] |
| 17 |
|
| 18 |
% Abort if 'new LaTeX' is active |
| 19 |
\ifdefined\IfDocumentMetadataTF |
| 20 |
\IfDocumentMetadataTF |
| 21 |
{\ClassError{beamer}{The beamer class is not compatible with \string\DocumentMetadata} |
| 22 |
{You will need either to remove \string\DocumentMetadata\space or switch to |
| 23 |
the new ltx-talk class if you require tagged output.}} |
| 24 |
{} |
| 25 |
\fi |
| 26 |
|
| 27 |
% Setup modes and check for article option |
| 28 |
% Also loads packages required by both beamer and beamerarticle |
| 29 |
\RequirePackage{beamerbasemodes} |
| 30 |
|
| 31 |
% For testing PDF versus DVI mode |
| 32 |
\RequirePackage{iftex} |
| 33 |
|
| 34 |
% |
| 35 |
% |
| 36 |
% Declarations used by beamer |
| 37 |
% |
| 38 |
% |
| 39 |
|
| 40 |
% Public |
| 41 |
\newdimen\headdp % Depth of the headline |
| 42 |
\newdimen\footheight % Height of the footline |
| 43 |
\newdimen\sidebarheight % Height of the sidebars |
| 44 |
|
| 45 |
% Private |
| 46 |
\newdimen\beamer@tempdim |
| 47 |
\newdimen\beamer@finalheight |
| 48 |
\newdimen\beamer@animht |
| 49 |
\newdimen\beamer@animdp |
| 50 |
\newdimen\beamer@animwd |
| 51 |
\newdimen\beamer@leftmargin |
| 52 |
\newdimen\beamer@rightmargin |
| 53 |
\newdimen\beamer@leftsidebar |
| 54 |
\newdimen\beamer@rightsidebar |
| 55 |
\newdimen\beamer@boxsize |
| 56 |
\newdimen\beamer@vboxoffset |
| 57 |
\newdimen\beamer@descdefault |
| 58 |
\newdimen\beamer@descriptionwidth |
| 59 |
|
| 60 |
\newskip\beamer@lastskip |
| 61 |
|
| 62 |
\newbox\beamer@areabox |
| 63 |
\newbox\beamer@animcurrent |
| 64 |
\newbox\beamer@animshowbox |
| 65 |
\newbox\beamer@sectionbox |
| 66 |
\newbox\beamer@logobox |
| 67 |
\newbox\beamer@linebox |
| 68 |
|
| 69 |
\newcount\beamer@sectioncount |
| 70 |
\newcount\beamer@subsubsectionmax |
| 71 |
\newcount\beamer@subsectionmax |
| 72 |
\newcount\beamer@sectionmax |
| 73 |
\newcount\beamer@totalheads |
| 74 |
\newcount\beamer@headcounter |
| 75 |
\newcount\beamer@partstartpage |
| 76 |
\newcount\beamer@sectionstartpage |
| 77 |
\newcount\beamer@subsectionstartpage |
| 78 |
\newcount\beamer@animationtempa |
| 79 |
\newcount\beamer@animationtempb |
| 80 |
\newcount\beamer@xpos |
| 81 |
\newcount\beamer@ypos |
| 82 |
\newcount\beamer@ypos@offset |
| 83 |
\newcount\beamer@showpartnumber |
| 84 |
\newcount\beamer@currentsubsection |
| 85 |
\newcount\beamer@coveringdepth |
| 86 |
\newcount\beamer@sectionadjust |
| 87 |
\newcount\beamer@toclastsection |
| 88 |
\newcount\beamer@tocsectionnumber |
| 89 |
|
| 90 |
\newif\ifbeamer@sansmath |
| 91 |
\newif\ifbeamer@altmode |
| 92 |
\newif\ifbeamer@notes |
| 93 |
\newif\ifbeamer@notesnormals |
| 94 |
\newif\ifbeamer@compress |
| 95 |
\newif\ifbeamer@centered |
| 96 |
\newif\ifbeamer@draftmode |
| 97 |
\newif\ifbeamer@suppressreplacements % decides whether fonts should be substituted |
| 98 |
\newif\ifbeamer@frameswithnotesonly |
| 99 |
\newif\ifbeamer@ignorenonframe |
| 100 |
\newif\ifbeamer@autopdfinfo |
| 101 |
\newif\ifbeamer@onlytextwidth |
| 102 |
\newif\ifbeamer@framefootnotes |
| 103 |
|
| 104 |
% Option management |
| 105 |
\RequirePackage{beamerbaseoptions} |
| 106 |
|
| 107 |
% |
| 108 |
% |
| 109 |
% Document options |
| 110 |
% |
| 111 |
% |
| 112 |
|
| 113 |
\beamer@suppressreplacementsfalse |
| 114 |
\beamer@altmodefalse |
| 115 |
\beamer@notesfalse |
| 116 |
\beamer@notesnormalstrue |
| 117 |
\beamer@compressfalse |
| 118 |
\beamer@draftmodefalse |
| 119 |
\beamer@frameswithnotesonlyfalse |
| 120 |
\beamer@ignorenonframefalse |
| 121 |
\beamer@autopdfinfotrue |
| 122 |
\beamer@onlytextwidthfalse |
| 123 |
\beamer@framefootnotesfalse |
| 124 |
|
| 125 |
\DeclareOptionBeamer{usepdftitle}[true]{\csname beamer@autopdfinfo#1\endcsname} |
| 126 |
\DeclareOptionBeamer{envcountsect}{\beamer@countsecttrue} |
| 127 |
\DeclareOptionBeamer{notheorems}{\beamer@blocksfalse} |
| 128 |
\DeclareOptionBeamer{noamsthm}{\beamer@blocksfalse\beamer@amsfalse} |
| 129 |
|
| 130 |
\DeclareOptionBeamer{compress}{\beamer@compresstrue} |
| 131 |
|
| 132 |
\DeclareOptionBeamer{t}{\beamer@centeredfalse} |
| 133 |
\DeclareOptionBeamer{c}{\beamer@centeredtrue} |
| 134 |
|
| 135 |
\DeclareOptionBeamer{leqno}{\input{leqno.clo}} |
| 136 |
\DeclareOptionBeamer{fleqn}{\input{fleqn.clo}} |
| 137 |
|
| 138 |
\def\beamer@currentmode{beamer} |
| 139 |
\DeclareOptionBeamer{handout}{\gdef\beamer@currentmode{handout}} |
| 140 |
\DeclareOptionBeamer{trans}{\gdef\beamer@currentmode{trans}} |
| 141 |
|
| 142 |
\DeclareOptionBeamer{pdftex}{}% Used by hyperref |
| 143 |
\DeclareOptionBeamer{nativepdf}{}% Used by hyperref |
| 144 |
\DeclareOptionBeamer{pdfmark}{}% Used by hyperref |
| 145 |
\DeclareOptionBeamer{dvips}{}% Used by hyperref |
| 146 |
\DeclareOptionBeamer{dviwindo}{}% Used by hyperref |
| 147 |
\DeclareOptionBeamer{dvipsone}{}% Used by hyperref |
| 148 |
\DeclareOptionBeamer{vtex}{}% Used by hyperref |
| 149 |
\DeclareOptionBeamer{ps2pdf}{}% Used by hyperref |
| 150 |
|
| 151 |
\DeclareOptionBeamer{ignorenonframetext}{\beamer@ignorenonframetrue} |
| 152 |
|
| 153 |
\DeclareOptionBeamer{noamssymb}{\beamer@amssymbfalse} |
| 154 |
|
| 155 |
\def\beamer@size{{size11.clo}} |
| 156 |
\DeclareOptionBeamer{bigger}{\def\beamer@size{{size12.clo}}} |
| 157 |
\DeclareOptionBeamer{smaller}{\def\beamer@size{{size10.clo}}} |
| 158 |
|
| 159 |
\DeclareOptionBeamer{8pt}{\def\beamer@size{{size8.clo}}} |
| 160 |
\DeclareOptionBeamer{9pt}{\def\beamer@size{{size9.clo}}} |
| 161 |
\DeclareOptionBeamer{10pt}{\def\beamer@size{{size10.clo}}} |
| 162 |
\DeclareOptionBeamer{11pt}{\def\beamer@size{{size11.clo}}} |
| 163 |
\DeclareOptionBeamer{12pt}{\def\beamer@size{{size12.clo}}} |
| 164 |
\DeclareOptionBeamer{14pt}{\def\beamer@size{{size14.clo}}} |
| 165 |
\DeclareOptionBeamer{17pt}{\def\beamer@size{{size17.clo}}} |
| 166 |
\DeclareOptionBeamer{20pt}{\def\beamer@size{{size20.clo}}} |
| 167 |
|
| 168 |
\DeclareOptionBeamer{draft}{\beamer@draftmodetrue} |
| 169 |
\pagenumbering{arabic} |
| 170 |
\def\insertpagenumber{\thepage} |
| 171 |
|
| 172 |
\def\beamer@activecjk{} |
| 173 |
\def\beamer@hypercjk{} |
| 174 |
|
| 175 |
\DeclareOptionBeamer{CJK}{\ExecuteOptionsBeamer{cjk}} |
| 176 |
\DeclareOptionBeamer{cjk}{% |
| 177 |
\def\beamer@hypercjk{\hypersetup{CJKbookmarks=true}} |
| 178 |
\def\beamer@activecjk{% |
| 179 |
% Activate all >=128 characters. |
| 180 |
\count@=127 % |
| 181 |
\@whilenum\count@<254 \do{% |
| 182 |
\advance\count@ by 1 % |
| 183 |
\lccode`\~=\count@ |
| 184 |
\catcode\count@=\active |
| 185 |
\lowercase{\def~{\kern1ex}}}}} |
| 186 |
|
| 187 |
\DeclareOptionBeamer{onlytextwidth}{\beamer@onlytextwidthtrue} |
| 188 |
\DeclareOptionBeamer{framefootnotes}{\beamer@framefootnotestrue} |
| 189 |
|
| 190 |
% obsolete options |
| 191 |
\DeclareOptionBeamer{notes}[show]{\csname beamer@notesaction@#1\endcsname} |
| 192 |
\def\beamer@notesaction@hide{% |
| 193 |
\ClassWarning{beamer}{This option is obsolete. Use beamer option |
| 194 |
``hide notes'' instead.}% |
| 195 |
\beamer@notesfalse} |
| 196 |
\def\beamer@notesaction@show{% |
| 197 |
\ClassWarning{beamer}{This option is obsolete. Use beamer option |
| 198 |
``show notes'' instead.}% |
| 199 |
\beamer@notestrue} |
| 200 |
\def\beamer@notesaction@only{% |
| 201 |
\ClassWarning{beamer}{This option is obsolete. Use beamer option |
| 202 |
``show only notes'' instead.}% |
| 203 |
\beamer@notestrue |
| 204 |
\beamer@notesnormalsfalse |
| 205 |
\nofiles |
| 206 |
} |
| 207 |
\def\beamer@notesaction@onlyslideswithnotes{% |
| 208 |
\ClassWarning{beamer}{This option is obsolete. Use beamer option |
| 209 |
``show only slides with notes'' instead.}% |
| 210 |
\beamer@notestrue |
| 211 |
\beamer@frameswithnotesonlytrue |
| 212 |
\nofiles |
| 213 |
} |
| 214 |
\DeclareOptionBeamer{inrow}{% |
| 215 |
\ClassError{beamer}{``inrow'' no longer supported. Use ``compress'' instead.}{}} |
| 216 |
\DeclareOptionBeamer{compressnotes}{% |
| 217 |
\ClassWarning{beamer}{``compressnotes'' is obsolete. Use |
| 218 |
\noexpand\setbeamertemplate{note page}[compressed] instead} |
| 219 |
\AtBeginDocument{\beamertemplatenotecompress}} |
| 220 |
\DeclareOptionBeamer{notesonly}{% |
| 221 |
\ClassWarning{beamer}{``notesonly'' is obsolete. Use beamer option |
| 222 |
``show only notes'' instead.} |
| 223 |
\beamer@notesaction@only} |
| 224 |
\DeclareOptionBeamer{blue}{% |
| 225 |
\ClassWarning{beamer}{``blue'' is obsolete. Use color theme structure instead} |
| 226 |
\def\beamer@loadlater{\usecolortheme[rgb={0.2,0.2,0.7}]{structure}}} |
| 227 |
\DeclareOptionBeamer{red}{% |
| 228 |
\ClassWarning{beamer}{``red'' is obsolete. Use color theme structure instead} |
| 229 |
\def\beamer@loadlater{\usecolortheme[rgb={0.7,0.2,0.2}]{structure}}} |
| 230 |
\DeclareOptionBeamer{blackandwhite}{% |
| 231 |
\ClassWarning{beamer}{``blackandwhite'' is obsolete. Use color theme structure instead} |
| 232 |
\def\beamer@loadlater{\usecolortheme[rgb={0.2,0.2,0.2}]{structure}}} |
| 233 |
\DeclareOptionBeamer{brown}{% |
| 234 |
\ClassWarning{beamer}{``brown'' is obsolete. Use color theme structure instead} |
| 235 |
\def\beamer@loadlater{\usecolortheme[rgb={0.66,0.4,0.166}]{structure}}} |
| 236 |
\DeclareOptionBeamer{slidescentered}{% |
| 237 |
\ClassWarning{beamer}{``slidescentered'' is obsolete. Use ``c'' instead} |
| 238 |
\beamer@centeredtrue} |
| 239 |
\DeclareOptionBeamer{slidestop}{% |
| 240 |
\ClassWarning{beamer}{``slidestop'' is obsolete. Use ``t'' instead} |
| 241 |
\beamer@centeredfalse} |
| 242 |
\DeclareOptionBeamer{sans}{% |
| 243 |
\ClassWarning{beamer}{``sans'' is obsolete. Just remove this option} |
| 244 |
\def\familydefault{\sfdefault} |
| 245 |
\def\mathfamilydefault{\sfdefault} |
| 246 |
\beamer@sansmathtrue |
| 247 |
} |
| 248 |
\DeclareOptionBeamer{serif}{% |
| 249 |
\ClassWarning{beamer}{``serif'' option is obsolete. Use font theme ``serif'' instead} |
| 250 |
\def\familydefault{\rmdefault} |
| 251 |
\def\mathfamilydefault{\rmdefault} |
| 252 |
\beamer@sansmathfalse |
| 253 |
} |
| 254 |
\DeclareOptionBeamer{mathsans}{% |
| 255 |
\ClassWarning{beamer}{``mathsans'' is obsolete. Use font theme ``serif'' with option ``stillsansserifmath''} |
| 256 |
\def\mathfamilydefault{\sfdefault}\beamer@sansmathtrue} |
| 257 |
\DeclareOptionBeamer{mathserif}{% |
| 258 |
\ClassWarning{beamer}{``mathserif'' is obsolete. Use font theme ``serif'' with option ``onlymath''} |
| 259 |
\def\mathfamilydefault{\rmdefault}\beamer@sansmathfalse} |
| 260 |
\DeclareOptionBeamer{professionalfont}{% |
| 261 |
\ClassWarning{beamer}{``professionalfont'' option is obsolete. Use font theme ``professionalfonts'' instead} |
| 262 |
\beamer@suppressreplacementstrue} |
| 263 |
|
| 264 |
% has to be done here for compatibility |
| 265 |
\def\familydefault{\sfdefault} |
| 266 |
\def\mathfamilydefault{\sfdefault} |
| 267 |
\beamer@sansmathtrue |
| 268 |
|
| 269 |
\PassOptionsToPackage{bookmarks=true,% |
| 270 |
bookmarksopen=true,% |
| 271 |
pdfborder={0 0 0},% |
| 272 |
pdfhighlight={/N},% |
| 273 |
linkbordercolor=[rgb]{0.5,0.5,0.5}}{hyperref} |
| 274 |
|
| 275 |
\DeclareOptionBeamer{pgf}{\PassOptionsToPackage{#1}{pgf}} |
| 276 |
\DeclareOptionBeamer{hyperref}{\PassOptionsToPackage{#1}{hyperref}} |
| 277 |
\DeclareOptionBeamer{color}{\PassOptionsToPackage{#1}{color}} |
| 278 |
\DeclareOptionBeamer{xcolor}{\PassOptionsToPackage{#1}{xcolor}} |
| 279 |
|
| 280 |
\def\beamer@loaducs{} |
| 281 |
|
| 282 |
\DeclareOptionBeamer{ucs}{% |
| 283 |
\ifpdf |
| 284 |
\PassOptionsToPackage{pdftex,unicode}{hyperref} |
| 285 |
\def\beamer@loaducs{% |
| 286 |
\RequirePackage[hyperref]{ucs}% |
| 287 |
\AtBeginDocument{\PreloadUnicodePage{0}}% |
| 288 |
\AtBeginDocument{\PreloadUnicodePage{1}}% |
| 289 |
} |
| 290 |
\else |
| 291 |
\def\beamer@loaducs{% |
| 292 |
\RequirePackage{ucs}% |
| 293 |
\AtBeginDocument{\PreloadUnicodePage{0}}% |
| 294 |
\AtBeginDocument{\PreloadUnicodePage{1}}% |
| 295 |
} |
| 296 |
\fi |
| 297 |
} |
| 298 |
\DeclareOptionBeamer{utf8x}{\ExecuteOptionsBeamer{ucs}% |
| 299 |
\g@addto@macro\beamer@loaducs{\RequirePackage[utf8x]{inputenc}}% |
| 300 |
} |
| 301 |
\DeclareOptionBeamer{utf8}{% |
| 302 |
\ClassWarning{beamer}{This option works no longer loads ucs.}% |
| 303 |
\RequirePackage[utf8]{inputenc}% |
| 304 |
\PassOptionsToPackage{unicode}{hyperref}% |
| 305 |
} |
| 306 |
|
| 307 |
% |
| 308 |
% Geometry: allows 16:10, 16:9, 14:9, 5:4 and 4:3 (default 4:3). |
| 309 |
% Default value is set right after declaring width and height |
| 310 |
% because it doesn't work otherwise. |
| 311 |
% |
| 312 |
\newlength\beamer@paperwidth |
| 313 |
\setlength\beamer@paperwidth{12.80cm} |
| 314 |
\newlength\beamer@paperheight |
| 315 |
\setlength\beamer@paperheight{9.60cm} |
| 316 |
|
| 317 |
\def\insertaspectratio{43}% |
| 318 |
\DeclareOptionBeamer{aspectratio}[43]{% |
| 319 |
\def\insertaspectratio{#1}% |
| 320 |
\ifnum#1=2013 % |
| 321 |
\setlength\beamer@paperwidth{14.00cm}% |
| 322 |
\setlength\beamer@paperheight{9.10cm}% |
| 323 |
\else\ifnum#1=1610 % |
| 324 |
\setlength\beamer@paperwidth{16.00cm}% |
| 325 |
\setlength\beamer@paperheight{10.00cm}% |
| 326 |
\else\ifnum#1=169 % |
| 327 |
\setlength\beamer@paperwidth{16.00cm}% |
| 328 |
\setlength\beamer@paperheight{9.00cm}% |
| 329 |
\else\ifnum#1=149 % |
| 330 |
\setlength\beamer@paperwidth{14.00cm}% |
| 331 |
\setlength\beamer@paperheight{9.00cm}% |
| 332 |
\else\ifnum#1=54 % |
| 333 |
\setlength\beamer@paperwidth{12.50cm}% |
| 334 |
\setlength\beamer@paperheight{10.00cm}% |
| 335 |
\else\ifnum#1=43 % |
| 336 |
\setlength\beamer@paperwidth{12.80cm}% |
| 337 |
\setlength\beamer@paperheight{9.60cm}% |
| 338 |
\else\ifnum#1=32 % |
| 339 |
\setlength\beamer@paperwidth{13.50cm}% |
| 340 |
\setlength\beamer@paperheight{9.00cm}% |
| 341 |
\else\ifnum#1=141 % |
| 342 |
\setlength\beamer@paperwidth{14.85cm}% |
| 343 |
\setlength\beamer@paperheight{10.50cm}% |
| 344 |
\else |
| 345 |
\setlength\beamer@paperheight{9.60cm}% |
| 346 |
\ifnum#1<1000% |
| 347 |
\pgfmathparse{(#1-mod(#1,10))/10.0/mod(#1,10)}% |
| 348 |
\else% |
| 349 |
\pgfmathparse{(#1-mod(#1,100))/100.0/mod(#1,100)}% |
| 350 |
\fi% |
| 351 |
\setlength\beamer@paperwidth{\pgfmathresult\beamer@paperheight}% |
| 352 |
\fi\fi\fi\fi\fi\fi\fi\fi |
| 353 |
} |
| 354 |
|
| 355 |
\RequirePackage[% |
| 356 |
papersize={\beamer@paperwidth,\beamer@paperheight}, |
| 357 |
hmargin=1cm,% |
| 358 |
vmargin=0cm,% |
| 359 |
head=0.5cm,% might be changed later |
| 360 |
headsep=0pt,% |
| 361 |
foot=0.5cm% might be changed later |
| 362 |
]{geometry} |
| 363 |
|
| 364 |
% |
| 365 |
% Process Options |
| 366 |
% |
| 367 |
|
| 368 |
% before processing beamer options for \pgfmathparse |
| 369 |
\RequirePackage{pgfmath} |
| 370 |
|
| 371 |
\ExecuteOptionsBeamer{c} |
| 372 |
\ProcessOptionsBeamer |
| 373 |
|
| 374 |
% Load corresponding size file |
| 375 |
\expandafter\input\beamer@size |
| 376 |
|
| 377 |
% Filter class option list |
| 378 |
\beamer@filterclassoptions |
| 379 |
|
| 380 |
% Low-level graphic drawing and advanced color support. |
| 381 |
\RequirePackage{pgfcore} |
| 382 |
\RequirePackage{xxcolor} |
| 383 |
|
| 384 |
% Normally loaded by hyperref but to be on the safe side ... |
| 385 |
\RequirePackage{atbegshi} |
| 386 |
% suppress the nameref beamer patches as they are now done by beamer: |
| 387 |
\def\NR@nopatch@beamer{} |
| 388 |
\RequirePackage[implicit=false]{hyperref} |
| 389 |
|
| 390 |
\hypersetup{pdfcreator={LaTeX with Beamer class}} |
| 391 |
|
| 392 |
% Encoding stuff |
| 393 |
\beamer@loaducs |
| 394 |
\beamer@hypercjk |
| 395 |
|
| 396 |
% Beamer packages required both by presentation and article modes |
| 397 |
\RequirePackage{beamerbaserequires} |
| 398 |
|
| 399 |
% Defaults |
| 400 |
\normalfont |
| 401 |
\raggedright |
| 402 |
|
| 403 |
\usetheme{default} |
| 404 |
|
| 405 |
% Compatibility stuff |
| 406 |
\csname beamer@loadlater\endcsname |