-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerouterthemepolimi.sty
88 lines (78 loc) · 2.56 KB
/
beamerouterthemepolimi.sty
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
\mode<presentation>
\newlength{\xshift}
\setlength{\xshift}{0.05\paperwidth}
% Header.
\defbeamertemplate*{frametitle}{polimi}
{
\begin{tikzpicture}[overlay, remember picture, text depth=.25ex]
\node at ([shift={(\xshift, -0.6)}] current page.north west) [anchor=south west, inner sep=0pt]
{
\ifhidesechead
{\small\phantom{Section}\leavevmode}
\else
{\small \insertsectionhead \ifx\insertsubsection\empty\else\ - \insertsubsectionhead\fi\leavevmode}
\fi
};
\node at ([shift={(\xshift, -1.25)}] current page.north west) [anchor=south west, inner sep=0pt]
{
\insertframetitle
};
\end{tikzpicture}
\vspace{1.1cm}
}
% Header.
\defbeamertemplate*{frametitle}{plain}{}
% Use frametitle template even if \frametitle is empty.
\patchcmd{\endbeamer@frameslide}{\ifx\beamer@frametitle\@empty}{\iffalse}{}{\errmessage{Failed to patch frametitle.}}
\defbeamertemplate{headline}{frame number}
{
\ifnum\c@framenumber>0
\begin{tikzpicture}[overlay, remember picture, text depth=.25ex]
\node at ([shift={(-0.5\xshift, -1.25)}] current page.north east) [anchor=south east, inner sep=0pt]
{
{\color{white} \tiny \insertframenumber/\inserttotalframenumber}
};
\end{tikzpicture}
\fi
}
% Footer.
\defbeamertemplate{footline}{polimi}{
\begin{minipage}[b][1cm][c]{\paperwidth}
\ifnum\c@framenumber>0
\begin{tikzpicture}[overlay, remember picture]
\node at ([shift={(\xshift, 0.5)}] current page.south west) [anchor=west, inner sep=0pt]
{
{\small\color{white} May 20, 2020}
};
\node at ([shift={(-0.5\xshift, 0.5)}] current page.south east) [anchor=east, inner sep=0pt]
{
\includegraphics[height=\baselineskip]{logo_bandiera.png}
};
\end{tikzpicture}
\fi
\end{minipage}
}
\setbeamertemplate{footline}[polimi]
% Enable nonumber option.
\BeforeBeginEnvironment{frame}{
\setbeamertemplate{background}[polimi]
\setbeamertemplate{frametitle}[polimi]
\setbeamertemplate{headline}[frame number]
}
\makeatletter
\define@key{beamerframe}{nonumber}[true]{
\setbeamertemplate{headline}{}
\addtocounter{framenumber}{-1}
}
\makeatother
% Enable plain option.
\makeatletter
\define@key{beamerframe}{plain}[true]{
\ifnum\c@framenumber>0
\setbeamertemplate{background}[footer]
\setbeamertemplate{frametitle}[plain]
\setbeamertemplate{headline}{}
\addtocounter{framenumber}{-1}
\fi
}
\makeatother