\usetheme{Copenhagen}
\RequirePackage{numberslides}
\RequirePackage{pxfonts}
\RequirePackage{eurosym}
\RequirePackage{xspace}
\RequirePackage{misc}

%% Using our logo.
\pgfdeclaremask{lrde-logo-mask}{share/figs/lrdemask}
\pgfdeclareimage[mask=lrde-logo-mask,interpolate=true,width=.10\textwidth]
		{lrde-logo}{share/figs/lrde-big}
\pgfdeclareimage[mask=lrde-logo-mask,interpolate=true,width=.10\textwidth]
		{lrde-logo-red}{share/figs/lrde-red}


%% Covered stuff should be visible, but transparent.
\setbeamercovered{dynamic}

%% Itemize, but more compact.
\newenvironment{compactitemize}{%
  \begin{itemize}
    \setlength\topsep{0pt}\setlength\partopsep{0pt}\setlength\parskip{0pt}%
    \setlength\itemsep{0pt}\setlength\parsep{0pt}%
  }{%
  \end{itemize}}

%% Make a frame with the whole toc.
\newcommand{\maketoc}{
  \frame{%
    \frametitle{\inserttitle}%
    \tableofcontents%
  }%
}

%% Emphasized is blue.
\renewcommand{\emph}[1]{\textcolor{blue}{#1}}

%% Like \alert<.>, but remains in emphasis afterwards.
\ifx\warn\undefined
  \newcommand{\warn}[1]{\alt<.>{\alert{#1}}{{\emph{#1}}}}
\fi

%% Redefine maketitle to include the LRDE logo.
\renewcommand{\maketitle}{%
  \begin{frame}
    \titlepage%
    \vspace{-10mm}%
    \begin{flushright}%
      \includegraphics[width=3cm]{share/figs/lrde-big}%
    \end{flushright}%
  \end{frame}%
  %
  \maketoc
}

%% Sections start with their title and local outline.
\newcommand{\sectionframe}{
  \begin{frame}
    \frametitle{\insertsection}
    \tableofcontents[currentsection,hideothersubsections]
  \end{frame}
}
\ifx\NoSectionToc\undefined
  \AtBeginSection[]{\sectionframe}
\fi

%% Subsections start with their title and local outline.
\newcommand{\subsectionframe}{
  \begin{frame}
    \frametitle{\insertsubsection}
    \tableofcontents[sectionstyle=show/shaded,subsectionstyle=show/shaded/hide]
  \end{frame}
  }
\ifx\NoSubsectionToc\undefined
  \AtBeginSubsection[]{\subsectionframe}
\fi


%% -------------- %%
%% Bibliography.  %%
%% -------------- %%

% Beamer and natbib are incompatible.
\let\citep\cite
\let\citet\cite
\newcommand{\bibliographyframe}[1]
{
  \begin{frame}[allowframebreaks]
    \frametitle{\bibname}

    % FIXME: Dummy bibliography style (Beamer doesn't need one
    % actually), to have texi2dvi run bibtex on this file (otherwise
    % it would not!)
    %
    % Longer explanation: the predicate (function) `bibaux_file_p' in
    % texi2dvi (used to determine whether a file generated by LaTeX is
    % to be processed by bibtex or not) requires a `\bibstyle'
    % command.  If it can't find it, it won't consider the file as a
    % valid BibTeX entry.  Hence this hack.
    %
    % Maybe we should extend texi2dvi so that one can have bibtex run
    % even when no style is defined (e.g., with a dedicated command
    % line option).
    \bibliography{#1}
  \end{frame}
}
