-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbeamerthemeOpenNMT.sty
229 lines (194 loc) · 7.43 KB
/
beamerthemeOpenNMT.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
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
\ProvidesPackage{beamerthemeOpenNMT}
% Written by Daina Chiba (daina.chiba@gmail.com).
% It was mostly copied from two poster style files:
% beamerthemeI6pd2.sty written by
% Philippe Dreuw <dreuw@cs.rwth-aachen.de> and
% Thomas Deselaers <deselaers@cs.rwth-aachen.de>
% and beamerthemeconfposter.sty written by
% Nathaniel Johnston (nathaniel@nathanieljohnston.com)
\mode<presentation>
\usepackage{tikz} % for drawing the nice rounded boxes
\usetikzlibrary{arrows,backgrounds}
\RequirePackage{lmodern}
\RequirePackage{textcomp}
\RequirePackage{amsmath,amssymb}
\usefonttheme{professionalfonts}
\newcommand{\makeruleinbox}{{\usebeamercolor[bg]{block alerted title}\centering\hspace*{-0.7cm}\rule{\inboxrule}{0.5cm}}}
\usepackage{ragged2e}
% define some length variables that are used by the template
\newlength{\inboxwd}
\newlength{\iinboxwd}
\newlength{\inboxrule}
\makeatletter
\makeatother
%==============================================================================
% Define colors
%==============================================================================
\definecolor{riceblue}{RGB}{172,65,66}
\definecolor{ricegray}{RGB}{94,96,98}
\definecolor{backgray}{HTML}{dcdcdc}
\definecolor{myred}{HTML}{276767}
%==============================================================================
% Set colors for the blocks, header bars, etc
%==============================================================================
% set colors for alerted text
\setbeamercolor{alerted text}{fg=myred}
% set colors for alerted blocks (blocks with frame)
\setbeamercolor{block alerted title}{fg=white,bg=riceblue}
\setbeamercolor{block alerted body}{fg=black,bg=riceblue!10}
% header
\setbeamercolor{footline}{fg=black, bg=ricegray}
\setbeamerfont{footline}{size=\large,series=\tt}
\setbeamercolor{separation line}{bg=riceblue}
\setbeamercolor{headline}{bg=riceblue}
\setbeamercolor{title in headline}{fg=white}
\setbeamercolor{author in headline}{fg=white}
\setbeamercolor{institute in headline}{fg=white}
\setbeamercolor{author in head/foot}{fg=white, bg=riceblue} % fooder
\setbeamercolor{title in head/foot}{fg=white, bg=riceblue}
% Background
\setbeamercolor*{normal text}{fg=black, bg=white} % background
\setbeamercolor*{block body}{fg=black, bg=white}
\setbeamercolor*{block title}{bg=white,fg=myred} % block header bar
\setbeamerfont{block title}{size=\Large,series=\bf}
\setbeamercolor{upper separation line head}{fg=black}
\setbeamercolor*{example body}{fg=black,bg=white}
\setbeamercolor*{example text}{fg=white,bg=ricegray}
\setbeamercolor*{example title}{bg=white,fg=ricegray}
%\setbeamercolor{example text}{fg=taorange}
\setbeamercolor{structure}{fg=blue}
\setbeamercolor{caption name}{fg=riceblue}
% set colors for itemize/enumerate
\setbeamercolor{item}{fg=riceblue}
\setbeamercolor{item projected}{fg=ricegray,bg=ricegray}
\setbeamertemplate{itemize items}[triangle]
\setbeamertemplate{navigation symbols}{} % no navigation on a poster
%==============================================================================
% Normal Block
%==============================================================================
\setbeamertemplate{block begin}
{
\par\vskip\medskipamount
\begin{beamercolorbox}[colsep*=.5ex,dp={2ex},center]{block title}
\vskip-0.25cm
\usebeamerfont{block title}\large\insertblocktitle
\begin{flushleft}
\vskip-1cm
\begin{tikzpicture}[remember picture,overlay]
\shade [inner color=ricegray,outer color=white]
(0,0) rectangle (\textwidth,0.3cm);
\end{tikzpicture}
\end{flushleft}
\end{beamercolorbox}
{\parskip0pt\par}
\ifbeamercolorempty[bg]{block title}
{}
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}
\usebeamerfont{block body}
\vskip-0.5cm
\begin{beamercolorbox}[colsep*=.5ex,vmode]{block body}
\justifying
}
\setbeamertemplate{block end}
{
\end{beamercolorbox}
\vskip\smallskipamount
}
%==============================================================================
% Alert block definition (with frame)
%==============================================================================
\setbeamertemplate{block alerted begin}
{
\par\vskip\medskipamount
\begin{beamercolorbox}[sep=0ex,rounded=true,center,dp={2ex}]{block alerted title}
\vskip0.01cm
\usebeamerfont{block title}\large\insertblocktitle
\end{beamercolorbox}
{\parskip0pt\par}
\usebeamerfont{block body}
\vskip-0.8cm
\begin{beamercolorbox}[sep=.5cm, rounded=true,center]{block alerted title}
\setlength{\inboxwd}{\linewidth}
\addtolength{\inboxwd}{-1cm}
\begin{beamercolorbox}[rounded=true,wd={\inboxwd},center]{block alerted body}
\setlength{\iinboxwd}{\inboxwd}
\setlength{\inboxrule}{\inboxwd}
\addtolength{\iinboxwd}{-0.5cm}
\addtolength{\inboxrule}{0.5cm}
\begin{center}
\begin{minipage}{\iinboxwd}
\justifying
}
\setbeamertemplate{block alerted end}
{
\end{minipage}
\end{center}
\end{beamercolorbox}
\end{beamercolorbox}
\vskip\smallskipamount
}
%==============================================================================
% Header
%==============================================================================
\setbeamertemplate{headline}{
\leavevmode
\begin{beamercolorbox}[wd=\paperwidth]{headline}
\begin{columns}%[T]
\begin{column}{0.2\paperwidth}
\begin{figure}
\begin{center}
\includegraphics[width=3.5in]{figs/OpenNMTLogo}
\end{center}
\end{figure}
\end{column}
\begin{column}{0.6\paperwidth}
\vskip2cm
\centering
\usebeamercolor{title in headline}{\color{fg}\Huge{\textbf{\inserttitle}}\\[1ex]}
\usebeamercolor{author in headline}{\color{fg}\Large{\insertauthor}\\[1ex]}
\usebeamercolor{institute in headline}{\color{fg}\Large{\insertinstitute}\\[2ex]}
\end{column}
\begin{column}{0.2\paperwidth}
\begin{figure}
\begin{center}
\includegraphics{figs/logos}
\end{center}
\end{figure}
\end{column}
\end{columns}
\vskip4ex
\end{beamercolorbox}
\begin{beamercolorbox}[wd=\paperwidth]{lower separation line head}
\rule{0pt}{3pt}
\end{beamercolorbox}
}
\setbeamertemplate{footline}{
\begin{beamercolorbox}[wd=\paperwidth]{upper separation line foot}
\rule{0pt}{3pt}
\end{beamercolorbox}
\leavevmode%
\begin{beamercolorbox}[ht=4ex,leftskip=1em,rightskip=1em]{author in head/foot}%
\texttt{\conference}
\hfill
\texttt{\yourEmail}
\vskip1ex
\end{beamercolorbox}
\vskip0pt%
\begin{beamercolorbox}[wd=\paperwidth]{lower separation line foot}
\rule{0pt}{3pt}
\end{beamercolorbox}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Display a grid to help align images ... and it looks nice with this color scheme
%\beamertemplategridbackground[1cm]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<all>
% adapt height of imtemize rectangles
\setbeamertemplate{itemize items}[triangle]
\setbeamertemplate{itemize item}{\raisebox{0.12ex}{$\blacktriangleright$}\hskip0.1em}
\setbeamertemplate{itemize subitem}{\raisebox{0.12ex}{$\triangleright$}\hskip0.1em}
% or define your own template using \defbeamertemplate{itemize item}, see beameruserguide.pdf
% equal font sizes for all levels
\setbeamerfont{itemize/enumerate body}{size=\normalsize}
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize}
\setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize}