summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/epyt/beamerthemeepyt.sty
blob: d655edc3a38f4800aeaf2c97640cee6ec141f511 (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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
% -*- coding: utf-8 -*-
%
% Package epyt: a simple and clean theme for LaTeX beamer class
% Copyright (C) 2013-2015 Zou Hu <zohooo@yeah.net>
%
% Please report bugs, problems, and suggestions via
%     https://github.com/zohooo/epyt
%
% The package may be distributed and/or modified under the conditions
% of the LaTeX Project Public License, either version 1.3 of this
% license or (at your option) any later version. The latest version
% of this license is in
%     http://www.latex-project.org/lppl.txt

\ProvidesPackage{beamerthemeepyt}[2015/03/24 v0.6]

\makeatletter

\mode<presentation>

\def\beamer@epyt@color{white}
\DeclareOptionBeamer{color}[white]{\def\beamer@epyt@color{#1}}
\ProcessOptionsBeamer

%% basic settings

\setbeamersize{text margin left=1em,text margin right=1em}
%\geometry{hmargin=1em,vmargin=0em}

%% define some templates

% make "vertical shading" modifiable in the middle of the document
% see beamerbaseauxtemplates.sty for the original code

\define@key{epyt@backgroundshade}{bottom}{\def\epyt@bgsb{#1}}
\define@key{epyt@backgroundshade}{middle}{\def\epyt@bgsm{#1}}
\define@key{epyt@backgroundshade}{top}{\def\epyt@bgst{#1}}
\define@key{epyt@backgroundshade}{midpoint}{\def\epyt@bgsmp{#1}}

\defbeamertemplate{background canvas}{epyt shading}[1][]
{%
  \setkeys{epyt@backgroundshade}{middle={},midpoint=0.5}%
  \setkeys{epyt@backgroundshade}{#1}%
  \pgfdeclareverticalshading[\epyt@bgsb,\epyt@bgsm,\epyt@bgst]%
    {epyt@backgroundshading}{\the\paperwidth}%
    {color(0cm)=(\epyt@bgsb);
     color(\epyt@bgsmp\paperheight)=(\epyt@bgsm);
     color(\the\paperheight)=(\epyt@bgst)}%
  \pgfuseshading{epyt@backgroundshading}%
}

%% color theme

\definecolor{dgray}{HTML}{202020}
\definecolor{lgray}{HTML}{404040}
\definecolor{dblue}{HTML}{3333B2}
\definecolor{tblue}{HTML}{000099}
\definecolor{gblue}{HTML}{0033CC}
\definecolor{lblue}{HTML}{ABCDEF}
\definecolor{dred}{HTML}{660033}
\definecolor{dgreen}{HTML}{254535}
\definecolor{ggreen}{HTML}{214131}
\definecolor{lgreen}{HTML}{A9EFA9}
\definecolor{dorange}{HTML}{C07000}

\def\beamer@epyt@color@do@white{
  \setbeamercolor{normal text}{bg=white,fg=black}
  \setbeamertemplate{background canvas}[default]
  \setbeamertemplate{background}[default]
  \setbeamercolor{structure}{fg=blue}
  \setbeamercolor{local structure}{fg=teal}
  \setbeamercolor{footline}{bg=dblue,fg=white}
}
\def\beamer@epyt@color@do@blue{
  \setbeamercolor{normal text}{bg=dblue,fg=white}
  \setbeamertemplate{background canvas}[epyt shading][top=tblue,middle=dblue,bottom=tblue]
  \setbeamertemplate{background}[grid][step=1mm,color=gblue]
  \setbeamercolor{structure}{fg=yellow}
  \setbeamercolor{local structure}{fg=lblue}
  \setbeamercolor{footline}{bg=dred,fg=white}
  \setbeamercolor{navigation symbols}{bg=dred}
  \setbeamercolor{navigation symbols dimmed}{fg=dred}
}
\def\beamer@epyt@color@do@green{
  \setbeamercolor{normal text}{bg=dgreen,fg=white}
  \setbeamertemplate{background canvas}[default]
  \setbeamertemplate{background}[grid][step=1mm,color=ggreen]
  \setbeamercolor{structure}{fg=yellow}
  \setbeamercolor{local structure}{fg=lgreen}
  \setbeamercolor{footline}{bg=dorange,fg=white}
  \setbeamercolor{navigation symbols}{bg=dorange}
  \setbeamercolor{navigation symbols dimmed}{fg=dorange}
}
\def\beamer@epyt@color@do@black{
  \setbeamercolor{normal text}{bg=black,fg=white}
  \setbeamertemplate{background canvas}[epyt shading][top=black,middle=dgray,bottom=lgray]
  \setbeamertemplate{background}[default]
  \setbeamercolor{structure}{fg=yellow}
  \setbeamercolor{local structure}{fg=lblue}
  \setbeamercolor{footline}{bg=,fg=white}
}

\def\beamer@epyt@color@do{%
  \expandafter\let\expandafter\next
    \csname beamer@epyt@color@do@\beamer@epyt@color\endcsname
  \ifx\next\relax \let\next\beamer@epyt@color@do@white \fi
  \next
  % need this when switching color themes in the middle of the document
  \usebeamercolor[fg]{normal text}%
  %\renewcommand{\normalcolor}{\color{normal text.fg}}%
}

\beamer@epyt@color@do

\RequirePackage{xkeyval}
\define@key{epytsetup}{color}{\def\beamer@epyt@color{#1}}
\newcommand{\epytsetup}[1]{%
  \setkeys{epytsetup}{#1}%
  \beamer@epyt@color@do
}

\setbeamercolor{title}{use=structure,fg=structure.fg}
\setbeamercolor{subtitle}{use={structure,normal text},fg=structure.fg!90!normal text.bg}
\setbeamercolor{section in toc}{parent=title}
\setbeamercolor{subsection in toc}{parent=subtitle}
\setbeamercolor{frametitle}{parent=title}
\setbeamercolor{theoremname}{parent=subtitle}
\setbeamercolor{proofname}{parent=subtitle}

%% font theme

\setbeamerfont{title}{size=\LARGE}
\setbeamerfont{subtitle}{size=\large}
\setbeamerfont{author}{size=\large}
\setbeamerfont{institute}{size=\normalsize}
\setbeamerfont{date}{size=\large}
\setbeamerfont{section in toc}{size=\Large}
\setbeamerfont{subsection in toc}{size=\large}
\setbeamerfont{frametitle}{size=\large}

\usefonttheme{professionalfonts} % there is some problem with default math fonts
%\usepackage{arev}

%% inner theme

\setbeamertemplate{itemize items}[default]
\setbeamertemplate{enumerate items}[default]

\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}{}

% sections and subsections

\AtBeginSection[]{
\begin{frame}
  \begin{center}
    \usebeamerfont{section in toc}
    \tableofcontents[sectionstyle=show/hide,subsectionstyle=hide]
  \end{center}
\end{frame}
}

\AtBeginSubsection[]{
\begin{frame}
  \begin{beamercolorbox}[wd=\paperwidth,center]{subsection in toc}%
  \usebeamerfont{subsection in toc}\insertsectionnumber.\insertsubsectionnumber\hspace*{2ex}\insertsubsection%
  \end{beamercolorbox}%
\end{frame}
}

% disable block style for theorems

\setbeamertemplate{theorem begin}
{%
  \upshape%\bfseries\inserttheoremheadfont
  {\usebeamercolor[fg]{theoremname}%
  \inserttheoremname\inserttheoremnumber
  \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
  %\inserttheorempunctuation
  }%
  \quad\normalfont
}
\setbeamertemplate{theorem end}{\par}


\setbeamertemplate{proof begin}
{%
  %\bfseries
  {\usebeamercolor[fg]{proofname}\insertproofname}%
  \quad\normalfont
}
\setbeamertemplate{proof end}{\par}

%% outer theme

\setbeamertemplate{frametitle}{\noindent\usebeamerfont{frametitle}\insertframetitle\par}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}
{
  \hbox{%
  \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,left]{footline}%
    \hspace*{1ex}\usebeamerfont{footline}\Acrobatmenu{GoToPage}{\insertframenumber{}/\inserttotalframenumber}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{footline}%
    \usebeamerfont{footline}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,right]{footline}%
    \usebeamerfont{footline}%
    \Acrobatmenu{GoBack}{$\lhd$}\hspace*{1ex}\Acrobatmenu{GoForward}{$\rhd$}\hspace*{1ex}%
    \hyperlinkframeendprev{$\vartriangle$}\hspace*{1ex}\hyperlinkframestartnext{$\triangledown$}\hspace*{1ex}
  \end{beamercolorbox}%
  }%
}

\mode<handout>{
  \setbeamertemplate{background canvas}{}
  \setbeamertemplate{background}{}
  \setbeamercolor{normal text}{fg=black, bg=white}
  \setbeamercolor{title}{fg=blue}
  \setbeamercolor{subtitle}{fg=blue!70!gray}
  \setbeamercolor{section in toc}{fg=blue!90!gray}
  \setbeamercolor{subsection in toc}{fg=blue!80!gray}
  \setbeamercolor{frametitle}{fg=blue!70!gray}
  \setbeamercolor{theoremname}{fg=blue!60!gray}
  \setbeamercolor{proofname}{fg=blue!60!gray}
  \setbeamercolor{footline}{bg=white,fg=black}
}

\mode
<all>

\makeatother