-
Notifications
You must be signed in to change notification settings - Fork 2
/
beamerthemematerial.sty
168 lines (153 loc) · 4.37 KB
/
beamerthemematerial.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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
\mode<presentation>
% ~~~~~~~~~
% ~ Theme ~
% ~~~~~~~~~
\usepackage{src/material_colors}
\usepackage{src/beamerinnerthemematerial}
\usepackage{src/beamerouterthemematerial}
\usepackage{src/beamercolorthemematerial}
% Customize list appearance
\newcommand{\myitem}{\item[\textcolor{primary-color-text}\textbullet]}
% Add command to add source for pictures (credits)
\newcommand{\source}[1]{\begin{textblock*}{4cm}(1cm,8.6cm)
\begin{beamercolorbox}[ht=0.5cm,left]{imagesource}
\usebeamerfont{imagesource}\usebeamercolor[fg]{imagesource} Source: {#1}
\end{beamercolorbox}
\end{textblock*}}
% Create a side by side slide with arguments:
% #1: optional argument specifying the ratio
% #2: left side content
% #3: right side content
% #4: left side tcolorbox options
% #5: right side tcolorbox options
\newcommand{\sidebysideleft}[5][0.49]{
\begin{minipage}[t]{#1\textwidth}
\begin{tcolorbox}[
enhanced,
colback=primary-color,
coltext=primary-color-text,
sharp corners,
boxrule=0mm,
toprule=-0.4mm,
bottomrule=-1.1mm,
leftrule=-10mm,
left=6mm, right=6mm, top=2.6mm, bottom=2mm, % text padding
fuzzy shadow={0mm}{-0.4mm}{-1mm}{0.2mm}{fill=shadow!40!bgcolor-03},
width=\textwidth,
height=\textheight, #4]
#2
\end{tcolorbox}
\end{minipage}
\noindent
\begin{minipage}[t]{\dimexpr0.99\textwidth - #1\textwidth}
\begin{tcolorbox}[
empty,
coltext=secondary-color-text,
sharp corners,
boxrule=0mm,
toprule=-0.4mm,
bottomrule=-1.1mm,
rightrule=-15mm,
left=6mm, right=6mm, top=2.6mm, bottom=2mm, % text padding
width=\textwidth,
height=\textheight, #5]
#3
\end{tcolorbox}
\end{minipage}
}
\newcommand{\sidebysideright}[5][0.49]{
\begin{minipage}[t]{\dimexpr0.99\textwidth - #1\textwidth}
\begin{tcolorbox}[
empty,
coltext=secondary-color-text,
sharp corners,
boxrule=0mm,
toprule=-0.4mm,
bottomrule=-1.1mm,
leftrule=-10mm,
left=6mm, right=6mm, top=2.6mm, bottom=2mm, % text padding
width=\textwidth,
height=\textheight, #4]
#2
\end{tcolorbox}
\end{minipage}
\noindent
\begin{minipage}[t]{#1\textwidth}
\begin{tcolorbox}[
enhanced,
colback=primary-color,
coltext=primary-color-text,
sharp corners,
boxrule=0mm,
toprule=-0.4mm,
bottomrule=-1.1mm,
rightrule=-15mm,
left=6mm, right=6mm, top=2.6mm, bottom=2mm, % text padding
fuzzy shadow={0mm}{-0.4mm}{-1mm}{0.2mm}{fill=shadow!40!bgcolor-03},
width=\textwidth,
height=\textheight, #5]
#3
\end{tcolorbox}
\end{minipage}
}
% Create a new topic-introduction frame with primary background color and the topic name as title (given as argument)
\newcommand{\topicFramePrimary}[2][\unskip]{
{
\colorlet{bgcolor-03}{primary-color}
\colorlet{secondary-color-text}{primary-color-text}
\usebeamercolor*{normal text}
\begin{frame}
\begin{center}
{\LARGE#2}
\ifx\hfuzz#1\hfuzz
% EMPTY
\else
\\
\vspace{1em}
#1%
\fi
\end{center}
\end{frame}
}
}
\newcommand{\topicFrameSecondary}[2][\unskip]{
{
\colorlet{bgcolor-03}{secondary-color}
\usebeamercolor*{normal text}
\begin{frame}
\begin{center}
{\LARGE#2}
\ifx\hfuzz#1\hfuzz
% EMPTY
\else
\\
\vspace{1em}
#1%
\fi
\end{center}
\end{frame}
}
}
% ~~~~~~~~~~~~~~~~~~~~
% ~ Default Settings ~
% ~~~~~~~~~~~~~~~~~~~~
\directlua{
local settings = require("src/settings")
local Utils = require("src/Utils")
Utils.defineHTMLColor("primary-color", settings.PrimaryColor)
Utils.defineHTMLColor("primary-color-light", settings.PrimaryColorLight)
Utils.defineHTMLColor("primary-color-dark", settings.PrimaryColorDark)
Utils.defineHTMLColor("primary-color-text", settings.PrimaryTextColor)
Utils.defineHTMLColor("secondary-color", settings.SecondaryColor)
Utils.defineHTMLColor("secondary-color-light", settings.SecondaryColorLight)
Utils.defineHTMLColor("secondary-color-dark", settings.SecondaryColorDark)
Utils.defineHTMLColor("secondary-color-text", settings.SecondaryTextColor)
Utils.defineHTMLColor("accent-color", settings.AccentColor)
Utils.defineHTMLColor("shadow", settings.Shadow)
Utils.defineHTMLColor("bgcolor-01", settings.BackgroundColor1)
Utils.defineHTMLColor("bgcolor-02", settings.BackgroundColor2)
Utils.defineHTMLColor("bgcolor-03", settings.BackgroundColor3)
Utils.defineHTMLColor("bgcolor-04", settings.BackgroundColor4)
}
\setbeamercolor*{alerted text}{fg=accent-color,bg=}
\mode<all>