summary refs log tree commit diff
path: root/beamerthemesimple.sty
blob: 98cb9b684194aab69838a318532bdc968d34db80 (plain) (blame)
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
% Copyright 2015 by Facundo Muñoz
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%


\ProvidesPackage{beamerthemesimple}

%\def\beamer@simplecolor{gris}
%\DeclareOptionBeamer{color}{\beamer@simplecolor=#1}
%\ExecuteOptionsBeamer{gris}
%\ProcessOptionsBeamer

\usepackage{tikz}
\usetikzlibrary{arrows,shapes,trees,positioning,fadings}

\input xkeyval

\newcommand<>{\includeoverlaygraphics}[2][]
{
  \begin{tikzpicture}
    \alt#3{\node[opacity=1] {\includegraphics[#1]{#2}};}
          {\node[opacity=.15] {\includegraphics[#1]{#2}};}
  \end{tikzpicture}
}

% These define macros \KV@setwatermark@hoffset that take one argument
% which is processed by the last piece of codes into braces
\def\@hos{}
\def\@vos{}
\def\@alpha{} % This one does not work. Why?
\define@key{setwatermark}{hoffset}[\def\@hos{.}]{\def\@hos{\hspace*{#1}}} 
\define@key{setwatermark}{voffset}[\def\@vos{.}]{\def\@vos{\vspace*{#1}}} 
\define@key{setwatermark}{alpha}[\def\@alpha{0.7}]{\def\@alpha{#1}} 

\def\setwatermark{\@ifnextchar[\@setwatermark{\@setwatermark[]}}
\def\@setwatermark[#1]#2{%
  \setkeys{setwatermark}{#1}%
  \def\@watermark{#2}
}
% \newcommand{\setwatermark}[1]{\def\@watermark{#1}}
\setwatermark{}   % Empty initialization


\mode<presentation>

  % define margin
  \def\marginsize{0.4cm}

  % http://www.colorcombos.com/color-scheme-275.html
  \definecolor{destacado}{HTML}{515151} % gris oscuro
  \definecolor{normal}{HTML}{797979}  % gris medio
  \definecolor{fondo}{HTML}{e6e6e6}  % gris claro
  
  \definecolor{logo}{HTML}{8E8E8E} % el gris del logo
  
  % para el logo en el footer
  \def\logoimage{%
      \raisebox{-1.1ex}{\includegraphics[width=3.3ex,trim=2.7 2.7 2.7 2.7]{\inserttitlegraphic}}%
  }
 
  \setbeamercolor{normal text}{bg=white,fg=normal}
  \setbeamercolor*{block title}{bg=fondo,fg=destacado}
  \setbeamercolor*{block body}{bg=fondo,fg=normal}
  \setbeamercolor{alerted text}{fg=black}
  
  \usetheme{default}
%  \usecolortheme[named=gris]{structure}
  \usecolortheme[named=destacado]{structure}
  \usefonttheme{structurebold}

  % overlays semitransparentes
  \setbeamercovered{transparent}
  
  % customize title page
  \def\twitter#1{\def\@twitter{\href{https://twitter.com/#1}{@#1}}}
  \newcommand{\inserttwitter}{\@twitter}
  
  \def\titlecontent{
    \usebeamerfont{title}\usebeamercolor[destacado]{title}\inserttitle
    \par
    \usebeamerfont{subtitle}\usebeamercolor[destacado]{subtitle}\insertsubtitle
    \par
    \bigskip
    \usebeamerfont{author}\usebeamercolor[normal]{author}\insertauthor
    \par
    \usebeamerfont{author}\usebeamercolor[normal]{author}\inserttwitter
    \par
    \bigskip
    \usebeamerfont{institute}\usebeamercolor[normal]{institute}\insertinstitute
    \par
    \usebeamerfont{date}\usebeamercolor[normal]{date}\insertdate
    \par
    % webpage plug
    \usebeamerfont{url}\usebeamercolor[normal]{url}\href{https://gul.uc3m.es}{gul.uc3m.es}
    \par
  }
  
  \setbeamertemplate{title page}{%
    \hyphenpenalty 10000
    \hspace*{-\marginsize}\parbox[c][\paperheight][c]{\paperwidth}{
        \begin{center}
            \begin{tikzpicture}
                \node[opacity=0.3] {\includegraphics[height=7cm]{\inserttitlegraphic}};
                \node[align=center, text width=0.95\paperwidth]{
                    \titlecontent
                };
            \end{tikzpicture}
        \end{center}
    }
    
  }
  
  % footer (contador de diapos, nombre jornadas)
  \setbeamercolor{section in foot}{fg=fondo, bg=logo}
  \setbeamertemplate{footline}{
      \leavevmode%
      \hbox{%
      \begin{beamercolorbox}[wd=.023\paperwidth,ht=2.25ex,dp=1ex,left]{section in foot}%
        \usebeamerfont{logo in head/foot}\logoimage
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.377\paperwidth,ht=2.25ex,dp=1ex,center]{section in foot}%
        \usebeamerfont{institute in head/foot}\insertshortinstitute
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{section in foot}%
        \usebeamerfont{title in head/foot}\insertshorttitle\hspace*{3em}
      \end{beamercolorbox}}%
      \begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,center]{section in foot}%
        \usebeamerfont{title in head/foot}\insertframenumber{} / \inserttotalframenumber\hspace*{1ex}
      \end{beamercolorbox}
      \vskip0pt%
  }

  % eliminar íconos de nav.
  \setbeamertemplate{navigation symbols}{}
  
  % bloques
  \setbeamertemplate{blocks}[rounded][shadow=false]

  % especificación global para listas
  %\beamerdefaultoverlayspecification{<+-| alert@+>}
  
  % márgenes
  \setbeamersize{text margin left=\marginsize,text margin right=\marginsize}
  
  \setbeamertemplate{background}{
  \parbox[c][\paperheight]{\paperwidth}{%
    \vfill \hfill 
    \begin{tikzpicture}
      %\node[opacity=\@alpha]  % not working. why?
      \node[opacity=.03]
      {
        \@watermark
      };
    \end{tikzpicture}
    \@hos
    
    \@vos
  }
} 

\mode
<all>