beamerthemeidiapbsp.sty 6.58 KB
Newer Older
Sébastien MARCEL's avatar
Sébastien MARCEL committed
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
\mode<presentation>

% Requirement
\RequirePackage{tikz}
\RequirePackage{graphicx}
%\RequirePackage{fontspec}
\RequirePackage{hyperref}

% Colors
\definecolor{unidistancedark}{RGB}{24,70,139}
\definecolor{unidistancelite}{RGB}{20,118,198}
\definecolor{darkred}{RGB}{180,0,0}
\definecolor{darkgreen}{RGB}{0,128,0}

% Defines the background of all slides
\setbeamertemplate{background}{
%  \begin{tikzpicture}
%    \fill[color=unidistancedark] (0,2.5) rectangle (2.5,5);
%    \fill[color=unidistancelite] (2.7,2.5) rectangle (\the\paperwidth,5);
%    \node (logo) at (0,8.3)
%      {\includegraphics[width=.5\paperwidth]{graphics/logo/idiap}};
%    \ifnum\thepage>1\relax%
%    \fill[white,opacity=1] (0,0)
%    rectangle(\the\paperwidth,\the\paperheight);
%    \fi
%  \end{tikzpicture}
  \begin{tikzpicture}
    % The x-coordinate of the image should NOT be 0 -- it is the center of the image
    \node (logo) at (2,7.5) {\includegraphics[width=.25\paperwidth]{graphics/logo/idiap}};
    \fill[color=unidistancedark] (0,3.0) rectangle (2.5,5);
    \fill[color=unidistancelite] (2.7,3.0) rectangle (\the\paperwidth,5);
    %\fill[color=white] (0,8.3) rectangle (2.5,5);
    %\fill[color=unidistancedark] (0,2.5) rectangle (2.5,5);
    %\fill[color=unidistancelite] (2.7,2.5) rectangle (\the\paperwidth,5);
    \ifnum\thepage>1\relax%
    \fill[white,opacity=1] (0,0)
    rectangle(\the\paperwidth,\the\paperheight);
    \fi
  \end{tikzpicture}
}

% Defines some fonts and colors
\usefonttheme{structurebold}
\setbeamercolor{unidistance title}{fg=white}
%\setbeamercolor{unidistance title}{fg=unidistancedark}
\setbeamerfont{unidistance title}{series=\bfseries,size=\large}
\setbeamercolor{unidistance subtitle}{fg=white}
%\setbeamercolor{unidistance subtitle}{fg=unidistancedark}
\setbeamerfont{unidistance subtitle}{series=\bfseries,size=\normalsize}
\setbeamercolor{unidistance author}{fg=black}
\setbeamerfont{unidistance author}{series=\bfseries}

% Title page
\defbeamertemplate*{title page}{unidistance}[1][]
{
  % Normally vkip here to overlay with the box in background
  \vskip3.2cm%
  \begin{beamercolorbox}[wd=14cm,leftskip=3cm,#1]{title page header}
    \usebeamerfont{unidistance title}\usebeamercolor[fg]{unidistance title}\inserttitle\par%
  \end{beamercolorbox}%
  \vskip0.1cm%
  \begin{beamercolorbox}[wd=14cm,leftskip=3cm,#1]{subtitle page header}
    \usebeamerfont{unidistance subtitle}\usebeamercolor[fg]{unidistance subtitle}\insertsubtitle\par%
  \end{beamercolorbox}
  \vskip1cm%
  \begin{beamercolorbox}[wd=14cm,leftskip=3cm,#1]{author}
    \usebeamerfont{unidistance author}\usebeamercolor[fg]{unidistance author}\insertauthor%
  \end{beamercolorbox}
}

%% Defines the frametitle header
%\defbeamertemplate*{frametitle}{unidistance}[1][]
%{
%  \begin{beamercolorbox}[wd=\paperwidth,ht=50pt]{frametitle}
%
%    \begin{tikzpicture}
%      %tikz coordinates are (0,0) on the bottom left of the frame, as defined
%      %above - the format is (x,y) - (horizontal,vertical) displacements
%
%      %use the entire region as a canvas, paint it in white
%      \useasboundingbox[fill=white](0,0) rectangle(\paperwidth,50pt);
%
%      %%put logo, starting on the top-left (n.b.: position w.r.t. image center)
%      %\node (logo) at (.15\paperwidth+5,25pt)
%      %  {\includegraphics[width=.1\paperwidth]{graphics/logo/idiap}};
%
%      %options: title alone or title + subtitle
%      \ifx\insertframesubtitle\@empty%
%      {\node[anchor=west,unidistancedark,font=\LARGE] at (.32\paperwidth,17pt){\insertframetitle};}
%      \else%
%      {\node[anchor=west,unidistancedark,font=\Large] at (0.32\paperwidth,28pt){\insertframetitle};%
%        \node[anchor=west,unidistancelite,font=\small] at (0.32\paperwidth,14pt){\insertframesubtitle};}%
%      \fi
%    \end{tikzpicture}
%
%  \end{beamercolorbox}
%}

% Title page
\defbeamertemplate*{toc}{unidistance}[1][]
{
}

% Set itemize and enumeration lists
\setbeamertemplate{itemize items}[square]
\setbeamercolor*{itemize item}{fg=unidistancedark}
\setbeamercolor*{itemize subitem}{fg=unidistancedark}
\setbeamercolor*{itemize subsubitem}{fg=unidistancedark}
\setbeamertemplate{enumerate items}[default]
\setbeamercolor*{enumerate item}{fg=unidistancedark}
\setbeamercolor*{enumerate subitem}{fg=unidistancedark}
\setbeamercolor*{enumerate subsubitem}{fg=unidistancedark}

% Configure blocks
\setbeamertemplate{blocks}[square]
\setbeamercolor{block title}{bg=unidistancelite,fg=white}
\setbeamercolor{block body}{bg=unidistancelite!10,fg=black}
\setbeamercolor{block title alerted}{bg=darkred!80,fg=white}
\setbeamercolor{block body alerted}{bg=red!10,fg=black}
\setbeamercolor{block title example}{bg=darkgreen!80,fg=white}
\setbeamercolor{block body example}{bg=green!10,fg=black}

% Disables navigation symbols
\setbeamertemplate{navigation symbols}{}

% Defines the frame footer
\setbeamertemplate{footline}{
  \begin{beamercolorbox}[wd=\the\paperwidth,ht=20pt]{section in head/foot}%
    \begin{tikzpicture}
      %use the entire region as a canvas, paint it in white
      \useasboundingbox[fill=white](0,0) rectangle(\paperwidth,20pt);
      %left box, darker color
      \path[fill=unidistancedark] (30pt,0) rectangle (110pt,20pt);
      \node[anchor=center,align=center,white,font={\fontsize{5pt}{3}\selectfont}] at (72pt,10pt) { \href{http://www.idiap.ch}{Idiap} };
      %right box, lighter color with title and page number
      \path[fill=unidistancelite] (112pt,0) rectangle (\paperwidth-30pt,20pt);
      \node[anchor=west,white,font={\fontsize{5pt}{3}\selectfont}] at (115pt,10pt) { \insertsubtitle\ | \inserttitle\ };
      \node[anchor=east,white,font={\fontsize{5pt}{3}\selectfont}] at (\paperwidth-30pt,10pt) { \insertframenumber/\inserttotalframenumber };
    \end{tikzpicture}
  \end{beamercolorbox}
}

% Redefines maketitle so we don't need to put it in a frame
% User needs to do just "\maketitle" after "\begin{document}"
\def\maketitle{%
  \ifbeamer@inframe
    \titlepage
  \else
    \begin{frame}[plain]
      \titlepage
    \end{frame}
  \fi
}

% Settings
\setbeamercolor*{title page header}{fg=white}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}

% Define custom front page
\def\makefrontpage{%
  \begin{frame}[plain,c,noframenumbering]
    \begin{center}
      \includegraphics[width=.75\paperwidth]{graphics/logo/idiap}
      \vskip3em
      \bfseries\href{http://www.idiap.ch}{www.idiap.ch}
    \end{center}
  \end{frame}
}

% Define custom last page
\def\makelastpage{%
  \begin{frame}[plain,c,noframenumbering]
    \begin{center}
      \includegraphics[width=.75\paperwidth]{graphics/logo/idiap}
      \vskip3em
      \bfseries\href{http://www.idiap.ch}{www.idiap.ch}
    \end{center}
  \end{frame}
}

\mode<all>