summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerouterthemepureminimalistic.sty
blob: 0e501bf5aa69335b5123df672f0f4ce351460cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
% A pure minimalistic LaTeX-Beamer theme for everyone to use.
% Copyright (C) 2020 Kai Norman Clasen

% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.

% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.

% You should have received a copy of the GNU General Public License
% along with this program.  If not, see <https://www.gnu.org/licenses/>.

% This file is part of beamerthemepureminimalistic.

% If problems/bugs are found or enhancements are desired, please contact
% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic

\ProvidesPackage{beamerouterthemepureminimalistic}[v1.2.4]
\RequirePackage{ifthen}
\RequirePackage{etoolbox}
\RequirePackage{calc}

\mode<presentation>

\newboolean{showmaxslides}
\setboolean{showmaxslides}{false}

\newboolean{nofooter}
\setboolean{nofooter}{false}

\DeclareOptionBeamer{showmaxslides}{\setboolean{showmaxslides}{true}}
\DeclareOptionBeamer{nofooter}{\setboolean{nofooter}{true}}

\ProcessOptionsBeamer

% invertcolor is already processed in colortheme
\ifthenelse{\boolean{darkmode}}{%
  \newcommand{\headerpath}{logos/header_logo_darkmode}
  \newcommand{\institutepath}{logos/institute_logo_darkmode}
}{%
  \newcommand{\headerpath}{logos/header_logo}
  \newcommand{\institutepath}{logos/institute_logo}
}
% The header shares the horizontal space with the frame title in normal mode
% a relative width value between .5 and .8 should usually be the best
\newcommand{\logoheader}{\includegraphics[width=.5\linewidth]{\headerpath}}
% For the title page, the logo is embedded in the total frame, meaning that \linewidth
% here refers to the complete \paperwidth, small width values of < .4 are usually best.
\newcommand{\logotitle}{\includegraphics[width=.2\linewidth]{\headerpath}}
% The footer will only use part of the space under the line. Usually almost the
% full linewidth should be used
\newcommand{\logofooter}{\includegraphics[width=.8\linewidth]{\institutepath}}

\defbeamertemplate*{frametitle}{largetitle}{
    \logotitle
}

\newlength{\myleftmargin}
\setlength{\myleftmargin}{.0625\paperwidth}
\newlength{\myrightmargin}
\setlength{\myrightmargin}{.0625\paperwidth}
\newlength{\mytextlength}
\setlength{\mytextlength}{\paperwidth - \myleftmargin - \myrightmargin}
\newlength{\myfooterheight}
\setlength{\myfooterheight}{.08\paperheight}

\setbeamersize{text margin left=\myleftmargin, text margin right=\myrightmargin}

\defbeamertemplate*{frametitle}{pureminimalistictitle}{
  \vskip 10pt
  \leavevmode
  \begin{beamercolorbox}[sep=0ex, wd=.65\paperwidth, left]{frametitle}
    \usebeamerfont{frametitle}%
    \insertframetitle%
  \end{beamercolorbox}%
  \begin{beamercolorbox}[sep=0pt, wd=.2\paperwidth, right]{headline}
    \logoheader
  \end{beamercolorbox}
}%

\defbeamertemplate*{footline}{pureminimalisticfooter}{%
  \ifthenelse{\boolean{nofooter}}{}{%
    \leavevmode
    \begin{beamercolorbox}[sep=0pt, wd=\myleftmargin, ht=\myfooterheight, dp=1ex]{footline}
    \end{beamercolorbox}%
    \begin{beamercolorbox}[sep=0pt, wd=\mytextlength, ht=\myfooterheight, dp=1ex]{footline}
      \parbox{\linewidth}%
      % Don't ask me why I had to insert a space/character after \usebeamercolor
      % for it to have an effect on \hrule. Same goes for \color{white} \hrule
      { \usebeamercolor[fg]{normal text}\ \hrule }
      \leavevmode
      \begin{beamercolorbox}[sep=0mm, wd=.6\paperwidth, ht=\myfooterheight]{footline}%
        \usebeamerfont{footline}%
        \vbox to\myfooterheight{%
        \vfil%
        \insertshorttitle{} $~|~$ %
        \insertshortauthor{} $\quad$ %
        \insertshortsubtitle{}\par%
        Page \insertframenumber\ifthenelse{%
        \boolean{showmaxslides}}%
        {/\inserttotalframenumber}%
        {}\par%
        \vfil%
        \vfil%
        }%
      \end{beamercolorbox}%
      \begin{beamercolorbox}[sep=0mm, wd=.275\paperwidth,right, ht=\myfooterheight]{footline}
        \vbox to\myfooterheight{%
        \vfil%
        \logofooter
        \vfil%
        \vfil%
        }%
      \end{beamercolorbox}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[sep=0pt, wd=\myrightmargin, dp=1ex, ht=\myfooterheight]{footline}
    \end{beamercolorbox}
    }
  }
  
\mode<all>