| 1 |
% Copyright 2007 by Till Tantau |
| 2 |
% |
| 3 |
% This file may be distributed and/or modified |
| 4 |
% |
| 5 |
% 1. under the LaTeX Project Public License and/or |
| 6 |
% 2. under the GNU Public License. |
| 7 |
% |
| 8 |
% See the file LICENSE.md for more details. |
| 9 |
|
| 10 |
\DeclareOptionBeamer{headheight}{\beamer@boxheadheight=#1} |
| 11 |
\DeclareOptionBeamer{footheight}{\beamer@boxfootheight=#1} |
| 12 |
|
| 13 |
\newdimen\beamer@boxheadheight |
| 14 |
\newdimen\beamer@boxfootheight |
| 15 |
\beamer@boxheadheight=10pt |
| 16 |
\beamer@boxfootheight=10pt |
| 17 |
|
| 18 |
\ProcessOptionsBeamer |
| 19 |
|
| 20 |
% For example: |
| 21 |
%\addheadboxtemplate{\color{black}}{\hfill\color{white}\insertshorttitle\hskip0.3cm} |
| 22 |
%\addheadboxtemplate{\color{structure}}{\hskip0.3cm\color{white}\insertshortauthor} |
| 23 |
|
| 24 |
%\addfootboxtemplate{\color{black}}{\hfill\color{white}\insertshortinstitute\hskip0.3cm} |
| 25 |
%\addfootboxtemplate{\color{structure}}{} |
| 26 |
%\addfootboxtemplate{\color{black}}{\hfill\color{white}\insertframenumber\hskip0.3cm} |
| 27 |
|
| 28 |
|
| 29 |
\mode<presentation> |
| 30 |
|
| 31 |
|
| 32 |
% Head |
| 33 |
\newcount\beamer@headboxes |
| 34 |
\newdimen\beamer@headboxsizes |
| 35 |
\newcount\beamer@currentbox |
| 36 |
\def\addheadboxtemplate#1#2{ |
| 37 |
\expandafter\def\csname beamer@headbox\the\beamer@headboxes\endcsname{#2} |
| 38 |
\expandafter\def\csname beamer@headbg\the\beamer@headboxes\endcsname{#1} |
| 39 |
\advance\beamer@headboxes by 1\relax |
| 40 |
\beamer@headboxsizes=\paperwidth |
| 41 |
\divide\beamer@headboxsizes by\beamer@headboxes |
| 42 |
} |
| 43 |
|
| 44 |
\def\addheadbox#1#2{\addheadboxtemplate{\usebeamercolor[bg]{#1}}{\usebeamercolor[fg]{#1}\usebeamerfont{#1}#2}} |
| 45 |
|
| 46 |
|
| 47 |
\defbeamertemplate*{headline}{boxes theme} |
| 48 |
{% |
| 49 |
\leavevmode |
| 50 |
\beamer@currentbox=0\relax% |
| 51 |
\loop% |
| 52 |
\ifnum\beamer@currentbox<\beamer@headboxes% |
| 53 |
\hbox to\beamer@headboxsizes{% |
| 54 |
% Background |
| 55 |
{% |
| 56 |
\csname beamer@headbg\the\beamer@currentbox\endcsname% |
| 57 |
\vrule width\beamer@headboxsizes height\beamer@boxheadheight% |
| 58 |
\hskip-\beamer@headboxsizes% |
| 59 |
}% |
| 60 |
% Box |
| 61 |
{% |
| 62 |
\setbox\beamer@tempbox=\hbox to\beamer@headboxsizes{% |
| 63 |
\csname beamer@headbox\the\beamer@currentbox\endcsname\hfil}% |
| 64 |
\dp\beamer@tempbox=0pt% |
| 65 |
\setbox\beamer@tempbox=\hbox{\vbox{\box\beamer@tempbox\vskip3pt}}% |
| 66 |
\ht\beamer@tempbox=\beamer@boxheadheight% |
| 67 |
\dp\beamer@tempbox=0pt% |
| 68 |
\box\beamer@tempbox% |
| 69 |
}}% |
| 70 |
\advance\beamer@currentbox by 1% |
| 71 |
\repeat% |
| 72 |
}% |
| 73 |
|
| 74 |
|
| 75 |
% Foot |
| 76 |
\newcount\beamer@footboxes |
| 77 |
\newdimen\beamer@footboxsizes |
| 78 |
\def\addfootboxtemplate#1#2{ |
| 79 |
\expandafter\def\csname beamer@footbox\the\beamer@footboxes\endcsname{#2} |
| 80 |
\expandafter\def\csname beamer@footbg\the\beamer@footboxes\endcsname{#1} |
| 81 |
\advance\beamer@footboxes by 1\relax |
| 82 |
\beamer@footboxsizes=\paperwidth |
| 83 |
\divide\beamer@footboxsizes by\beamer@footboxes |
| 84 |
} |
| 85 |
|
| 86 |
\def\addfootbox#1#2{\addfootboxtemplate{\usebeamercolor[bg]{#1}}{\usebeamercolor[fg]{#1}\usebeamerfont{#1}#2}} |
| 87 |
|
| 88 |
\defbeamertemplate*{footline}{boxes theme} |
| 89 |
{% |
| 90 |
\leavevmode |
| 91 |
\beamer@currentbox=0\relax% |
| 92 |
\loop% |
| 93 |
\ifnum\beamer@currentbox<\beamer@footboxes% |
| 94 |
\hbox to\beamer@footboxsizes{% |
| 95 |
% Background |
| 96 |
{% |
| 97 |
\csname beamer@footbg\the\beamer@currentbox\endcsname% |
| 98 |
\vrule width\beamer@footboxsizes height\beamer@boxfootheight% |
| 99 |
\hskip-\beamer@footboxsizes% |
| 100 |
}% |
| 101 |
% Box |
| 102 |
{% |
| 103 |
\setbox\beamer@tempbox=\hbox to\beamer@footboxsizes{% |
| 104 |
\csname beamer@footbox\the\beamer@currentbox\endcsname\hfil}% |
| 105 |
\dp\beamer@tempbox=0pt% |
| 106 |
\setbox\beamer@tempbox=\hbox{\vbox{\box\beamer@tempbox\vskip3pt}}% |
| 107 |
\ht\beamer@tempbox=\beamer@boxfootheight% |
| 108 |
\dp\beamer@tempbox=0pt% |
| 109 |
\box\beamer@tempbox% |
| 110 |
}% |
| 111 |
}% |
| 112 |
\advance\beamer@currentbox by 1% |
| 113 |
\repeat% |
| 114 |
}% |
| 115 |
|
| 116 |
|
| 117 |
\mode |
| 118 |
<all> |