Debian Codegraph @

texmf-dist/source/latex/beamertheme-saintpetersburg/beamerthemeSaintPetersburg.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2017 by Ivan Gankevich <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3c
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.3c or later is part of all distributions of LaTeX
14 % version 2005/12/01 or later.
15 %
16 % \fi
17 % \iffalse
18 %<*package>
19 \NeedsTeXFormat{LaTeX2e}
20 \ProvidesPackage{beamerthemeSaintPetersburg}[2017/11/20 SaintPetersburg Beamer theme]
21 %</package>
22 % \fi
23 % \CheckSum{0}
24 % \StopEventually{}
25 % \iffalse
26 %<*package>
27 % \fi
28 % \subsection{SaintPetersburg theme}
29 % Define theme options.
30 % \begin{macrocode}
31 \newif\if@spbuPoster
32 \newif\if@spbuLogo
33 \@spbuPosterfalse
34 \@spbuLogotrue
35 \DeclareOption{poster}{\@spbuPostertrue}
36 \DeclareOption{nologo}{\@spbuLogofalse}
37 \ProcessOptions
38 % \end{macrocode}
39
40 % Load corresponding font theme.
41 % \begin{macrocode}
42 \mode<presentation>
43
44 \usefonttheme{SaintPetersburg}
45 % \end{macrocode}
46
47 % Define slide background template.
48 % \begin{macrocode}
49 \RequirePackage{graphicx}
50 \RequirePackage{tikz}
51 \makeatletter%
52 \usebackgroundtemplate{%
53 \ifnum\thepage=1\relax%
54 \hspace{\beamer@leftmargin}%
55 \begin{beamercolorbox}[wd=\paperwidth,ht=\paperheight,dp=0pt]{background canvas}%
56 \begin{tikzpicture}[remember picture,overlay]%
57 % background CoA
58 \node[anchor=south east,opacity=0.1] at (current page.south east) {%
59 \IfFileExists{\detokenize{CoA_Medium.eps}}%
60 {\includegraphics[width=0.7\paperwidth,trim=0 55 10 0,clip]{CoA_Medium.eps}}%
61 {}
62 };%
63 \end{tikzpicture}%
64 \end{beamercolorbox}%
65 \else%
66 \usebeamercolor[bg]{background canvas}\rule{\paperwidth}{\paperheight}%
67 \fi%
68 }
69 \makeatother%
70 % \end{macrocode}
71
72 % Define helper macro to insert a field using theme colors and font.
73 % \begin{macrocode}
74 \newcommand*{\spbuInsertField}[1]{%
75 \usebeamerfont{#1}%
76 \usebeamercolor[fg]{#1}%
77 \expandafter\relax\csname insert#1\endcsname%
78 \par%
79 }
80 % \end{macrocode}
81
82 % Show every field on the title page.
83 % \begin{macrocode}
84 \setbeamertemplate{title page}{%
85 \centering%
86 \vspace{0.2\textheight}\spbuInsertField{title}%
87 \vskip0.5\baselineskip\ifx\insertsubtitle\empty\else%
88 \spbuInsertField{subtitle}%
89 \fi%
90 \vskip\baselineskip\spbuInsertField{author}%
91 \vfill\spbuInsertField{institute}%
92 \vfill\inserttitlegraphic%
93 \vfill\spbuInsertField{date}%
94 }
95 % \end{macrocode}
96
97 % Show simple frame title without a background.
98 % \begin{macrocode}
99 \setbeamertemplate{frametitle}{%
100 \spbuInsertField{frametitle}
101 \ifx\insertframesubtitle\empty\else%
102 \spbuInsertField{framesubtitle}
103 \fi%
104 }
105 % \end{macrocode}
106
107 % Disable navigation symbols.
108 % \begin{macrocode}
109 \setbeamertemplate{navigation symbols}{}
110 \beamertemplatenavigationsymbolsempty
111 % \end{macrocode}
112
113 % Set black-on-white speaker notes
114 % \begin{macrocode}
115 \setbeamertemplate{note page}{%
116 % TODO fix textwidth
117 \begin{minipage}{0.85\paperwidth}%
118 \spbuInsertField{note}%
119 \end{minipage}%
120 }
121 % \end{macrocode}
122
123 % Define block environment. Here and in al other blocks we use
124 % \texttt{flushright} to properly align columns inside blocks.
125 % \begin{macrocode}
126 \setbeamertemplate{block begin}{
127 \vspace{-\baselineskip}%
128 \begin{flushright}
129 \begin{beamercolorbox}[colsep*=.75ex]{block title}%
130 \usebeamerfont*{block title}\insertblocktitle
131 \end{beamercolorbox}%
132 {\parskip0pt\nointerlineskip\par}%
133 \usebeamerfont{block body}%
134 \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}%
135 }
136 \setbeamertemplate{block end}{
137 \end{beamercolorbox}
138 \end{flushright}
139 }
140 % \end{macrocode}
141
142 % Define alert block environment.
143 % \begin{macrocode}
144 \setbeamertemplate{block alerted begin}{
145 \vspace{-\baselineskip}%
146 \begin{flushright}
147 \begin{beamercolorbox}[colsep*=.75ex]{block title alerted}%
148 \usebeamerfont*{block title alerted}\insertblocktitle
149 \end{beamercolorbox}%
150 {\parskip0pt\nointerlineskip\par}%
151 \usebeamerfont{block body alerted}%
152 \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body alerted}%
153 }
154 \setbeamertemplate{block alerted end}{
155 \end{beamercolorbox}
156 \end{flushright}
157 }
158 % \end{macrocode}
159
160 % Define example block environment.
161 % \begin{macrocode}
162 \setbeamertemplate{block example begin}{
163 \vspace{-\baselineskip}%
164 \begin{flushright}
165 \begin{beamercolorbox}[colsep*=.75ex]{block title example}%
166 \usebeamerfont*{block title example}\insertblocktitle
167 \end{beamercolorbox}%
168 {\parskip0pt\nointerlineskip\par}%
169 \usebeamerfont{block body example}%
170 \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body example}%
171 }
172 \setbeamertemplate{block example end}{
173 \end{beamercolorbox}
174 \end{flushright}
175 }
176 % \end{macrocode}
177
178 % Define QED symbol
179 % \begin{macrocode}
180 \setbeamertemplate{qed symbol}{$\blacksquare$}
181 % \end{macrocode}
182
183 % Theorem/corollary etc. and proof environments are simply blocks.
184 % \begin{macrocode}
185 \setbeamertemplate{theorem begin}{%
186 \inserttheoremheadfont%
187 \begin{\inserttheoremblockenv}{%
188 \inserttheoremname%
189 \ifx\inserttheoremaddition\empty\else\ (\inserttheoremaddition)\fi%
190 }%
191 }
192 \setbeamertemplate{theorem end}{\end{\inserttheoremblockenv}}
193
194 \setbeamertemplate{proof begin}{%
195 \inserttheoremheadfont%
196 \begin{\inserttheoremblockenv}{%
197 \proofname%
198 }%
199 }
200 \setbeamertemplate{proof end}{\end{\inserttheoremblockenv}}
201 % \end{macrocode}
202
203 % Remove bibliography item marker.
204 % \begin{macrocode}
205 \setbeamertemplate{bibliography item}{}
206 % \end{macrocode}
207
208 % Define abstract template (mainly for poster).
209 % \begin{macrocode}
210 \setbeamertemplate{abstract title}{%
211 \usebeamerfont{abstract title}%
212 \usebeamercolor[fg]{abstract title}%
213 \abstractname.%
214 }
215 % \end{macrocode}
216
217
218 % Define additional poster templates.
219 % \begin{macrocode}
220 \makeatletter%
221 \if@spbuPoster%
222 % \end{macrocode}
223
224 % Make abstract text justified.
225 % \begin{macrocode}
226 \setbeamertemplate{abstract begin}{%
227 \begin{minipage}{\linewidth}%
228 \justifying%
229 }
230 \setbeamertemplate{abstract end}{%
231 \end{minipage}%
232 }
233 % \end{macrocode}
234
235 % Define a commands for the logo on the right hand side.
236 % \begin{macrocode}
237 \newcommand*{\othergraphic}[1]{\gdef\@othergraphic{#1}}%
238 \newcommand*{\@othergraphic}[1]{}%
239 \newcommand*{\insertothergraphic}{\@othergraphic{}}%
240 % \end{macrocode}
241
242 % Define a command for each headline column width.
243 % Left column width.
244 % \begin{macrocode}
245 \newcommand*{\leftcolumnwidth}[1]{\gdef\@leftcolumnwidth{#1}}%
246 \newcommand*{\@leftcolumnwidth}[1]{.2\linewidth}%
247 \newcommand*{\insertleftcolumnwidth}{\@leftcolumnwidth{}}%
248 % \end{macrocode}
249
250 % Right column width.
251 % \begin{macrocode}
252 \newcommand*{\rightcolumnwidth}[1]{\gdef\@rightcolumnwidth{#1}}%
253 \newcommand*{\@rightcolumnwidth}[1]{.2\linewidth}%
254 \newcommand*{\insertrightcolumnwidth}{\@rightcolumnwidth{}}%
255 % \end{macrocode}
256
257 % Middle column width.
258 % \begin{macrocode}
259 \newcommand*{\middlecolumnwidth}[1]{\gdef\@middlecolumnwidth{#1}}%
260 \newcommand*{\@middlecolumnwidth}[1]{.6\linewidth}%
261 \newcommand*{\insertmiddlecolumnwidth}{\@middlecolumnwidth{}}%
262 % \end{macrocode}
263
264 % Define headline template with three columns: left and right are for logos
265 % and a large middle column for the title and the authors.
266 % \begin{macrocode}
267 \setbeamertemplate{headline}{%
268 \vskip2cm%
269 \begin{columns}%
270 \begin{column}{\insertleftcolumnwidth}%
271 \centering%
272 \inserttitlegraphic%
273 \end{column}%
274 \begin{column}{\insertmiddlecolumnwidth}%
275 \centering%
276 {\usebeamercolor[fg]{title in head/foot}\textbf{\huge{\inserttitle}}}%
277 \vskip 1.5cm%
278 {\usebeamercolor{author in head/foot}\Large{\insertauthor}}%
279 \vskip\baselineskip%
280 {\usebeamercolor{institute in head/foot}\large{\insertinstitute}}%
281 \vskip2cm%
282 \end{column}%
283 \begin{column}{\insertrightcolumnwidth}%
284 \centering%
285 \insertothergraphic%
286 \end{column}%
287 \vspace{1cm}%
288 \end{columns}%
289 }
290 % \end{macrocode}
291
292 % Define footline template with a horizontal line and a short title.
293 % \begin{macrocode}
294 \setbeamertemplate{footline}{
295 \vskip2cm%
296 \begin{center}%
297 \begin{minipage}[c][3cm][c]{0.95\textwidth}%
298 \centering%
299 \begin{flushleft}%
300 \vskip-1cm%
301 \begin{tikzpicture}[remember picture,overlay]%
302 \fill [spbuTerracotta] (0,0) rectangle (\textwidth,0.1cm);%
303 \end{tikzpicture}%
304 \end{flushleft}%
305 \vskip1cm%
306 {\usebeamercolor{normal text}\textbf{\large{\insertshorttitle}}}%
307 \end{minipage}%
308 \end{center}%
309 \vskip1cm%
310 }
311 % \end{macrocode}
312
313 % Define section and subsection commands.
314 % \begin{macrocode}
315 \renewcommand{\section}[1]{%
316 \vskip\baselineskip%
317 \begin{center}%
318 {\textcolor{spbuTerracotta}{\textbf{\Large #1}}}%
319 \vskip0.4\baselineskip%
320 \end{center}%
321 \justifying%
322 \setlength{\parindent}{1.5cm}%
323 }
324
325 \renewcommand{\subsection}[1]{%
326 \vskip0.8\baselineskip%
327 \begin{center}%
328 {\textcolor{spbuTerracotta}{\textbf{\textsl{\large #1}}}}%
329 \vskip0.3\baselineskip%
330 \end{center}%
331 \justifying%
332 \setlength{\parindent}{1.5cm}%
333 }
334 % \end{macrocode}
335
336 % Set numbered bibliography.
337 % \begin{macrocode}
338 \setbeamertemplate{bibliography item}[text]
339 % \end{macrocode}
340
341 % End of poster-specific definitions.
342 % \begin{macrocode}
343 \fi%
344 \makeatother%
345 % \end{macrocode}
346
347 % Load corresponding color theme.
348 % \begin{macrocode}
349 \usecolortheme{SaintPetersburg}
350 % \end{macrocode}
351
352 % Provide string translations to Russian.
353 % \begin{macrocode}
354 \newtranslation[to=russian]{Part}{Часть}
355 \newtranslation[to=russian]{Section}{Раздел}
356 \newtranslation[to=russian]{Subsection}{Подраздел}
357 \newtranslation[to=russian]{Theorem}{Теорема}
358 \newtranslation[to=russian]{Proof}{Доказательство}
359 \newtranslation[to=russian]{Corollary}{Следствие}
360 \newtranslation[to=russian]{Definition}{Определение}
361 \newtranslation[to=russian]{Definitions}{Определения}
362 \newtranslation[to=russian]{Fact}{Утверждение}
363 \newtranslation[to=russian]{Lemma}{Лемма}
364 \newtranslation[to=russian]{Example}{Пример}
365 \newtranslation[to=russian]{Examples}{Примеры}
366
367 \mode<all>
368 % \end{macrocode}
369
370 % \iffalse
371 %</package>
372 % \fi
373 % \Finale
374 \endinput