%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% One LaTeX template designed to make Beamer slides (with naereen.sty)
%%
%% by Lilian Besson, (c) 2013 - v1.3 26-12-2013
%%  http://lbesson.bitbucket.org/
%%  mailto:Lilian.BESSON[@]ens-cachan[.]fr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Permission is granted to freely use, copy, and distribute
%% without restriction. Permission is also granted to distribute
%% modified versions and incorporate into your own macro packages
%% if a brief acknowledgement is given.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Packages
%% --------
%% hyperref, fancyhdr, geometry are NOT imported.
%% do it your self in your .tex AFTER \usepackage{naereenbeamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{naereenbeamer}[2013/12/26 v1.3 Naereen Package for Beamer presentation]
\message{<Naereen LaTeX2e Beamer Package. Ask to naereen(@)crans(.)org for any problem.>}

\usepackage{lmodern}% http://ctan.org/pkg/lm
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox

%%%%%%%%%%%%%%%
%% Beamer theme
% choose one from http://deic.uab.es/~iblanes/beamer_gallery/
% or http://www.hartwork.org/beamer-theme-matrix/
%\usetheme{Warsaw}
\usetheme{CambridgeUS}

%%%%%%%%%%%%%%%%%%%%%%
%% Beamer color theme
%% default albatross beaver beetle crane dolphin dove fly lily
%% orchid rose seagull seahorse whale wolverine

%\usecolortheme{seahorse} %% very lighty
\usecolortheme{dolphin} %% nice blue
\usecolortheme{orchid} %% dark red ?
\usecolortheme{whale} %% black and blue as Warsaw

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define your own colors
\definecolor{blackblue}{RGB}{19,19,59}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Change the theme
%\setbeamercolor{alerted text}{fg=orange}
%\setbeamercolor{background canvas}{bg=white}
%\setbeamercolor{block body alerted}{bg=normal text.bg!90!black}
%\setbeamercolor{block body}{bg=normal text.bg!90!black}
%\setbeamercolor{block body example}{bg=normal text.bg!90!black}
%\setbeamercolor{block title alerted}{use={normal text,alerted text},fg=alerted text.fg!75!normal text.fg,bg=normal text.bg!75!black}
%\setbeamercolor{block title}{bg=blue}
%\setbeamercolor{block title example}{use={normal text,example text},fg=example text.fg!75!normal text.fg,bg=normal text.bg!75!black}
%\setbeamercolor{fine separation line}{}
\setbeamercolor{frametitle}{fg=black}
%\setbeamercolor{item projected}{fg=black}
%\setbeamercolor{normal text}{bg=black,fg=yellow}
%\setbeamercolor{palette sidebar primary}{use=normal text,fg=normal text.fg}
%\setbeamercolor{palette sidebar quaternary}{use=structure,fg=structure.fg}
%\setbeamercolor{palette sidebar secondary}{use=structure,fg=structure.fg}
%\setbeamercolor{palette sidebar tertiary}{use=normal text,fg=normal text.fg}
%\setbeamercolor{section in sidebar}{fg=brown}
%\setbeamercolor{section in sidebar shaded}{fg= grey}
\setbeamercolor{separation line}{}
%\setbeamercolor{sidebar}{bg=red}
%\setbeamercolor{sidebar}{parent=palette primary}
%\setbeamercolor{structure}{bg=black, fg=green}
%\setbeamercolor{subsection in sidebar}{fg=brown}
%\setbeamercolor{subsection in sidebar shaded}{fg= grey}
%\setbeamercolor{title}{fg=blackblue}
%\setbeamercolor{titlelike}{fg=blackblue}


%%%%%%%%%%%%%%%%%%%%%%%
%% Other beamer options
\setbeamercovered{transparent}
% Permet de laisser en gris le texte qui n'est pas encore apparu (lorsqu'on utilise les commandes avec des <1,2> ou <4-9>.

%\setbeamercolor{normal text}{fg=black,bg=white}

%%%%%%%%%%%%%%%%%%%%%%%
%% Change Beamer fonts
% \usefonttheme{default}
% \usefonttheme[onlymath]{serif}
\usefonttheme{serif}

% FIXME
\setbeamerfont{title}{family=\rm}
\setbeamerfont{titlelike}{family=\rm}
\setbeamerfont{frametitle}{family=\rm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% innertheme
%% rectangles circles inmargin rounded
\useinnertheme{rounded}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% outertheme
%% infolines miniframes shadow sidebar smoothbars smoothtree split tree
%\useoutertheme{infolines}

%% No navigation symbol.
\setbeamertemplate{navigation symbols}{}
\beamertemplatenavigationsymbolsempty

% Other options
%\setbeamertemplate{footline}[page number]

\beamertemplateballitem
\setbeamertemplate{itemize item}[square]


%\setbeamertemplate{footnote}{%
%  \hangpara{2em}{1}%
%  \makebox[2em][l]{\insertfootnotemark}\footnotesize\insertfootnotetext\par%
%}

% % Si on veut faire apparaître le sommaire courant à chaque nouvelle section.
% \AtBeginSection[]
% {
%   \begin{frame}<beamer>
%     \frametitle{Sommaire} % : section courante}
%     \tableofcontents[currentsubsection,sectionstyle=show/shaded,subsectionstyle=show/shaded]
%   \end{frame}
% }

\newcounter{captureframe}
\setcounter{captureframe}{0}
\newcounter{finalframe}
\setcounter{finalframe}{0}

\newcommand{\appendixBeamer}{
	\appendix{}
%	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	%% Remove <frame #> / <total frame #> from footline template
%	\makeatletter
%	\patchcmd{\beamer@@tmpl@footline}% <cmd>
%	  {\insertframenumber{} / \inserttotalframenumber}% <search>
%	  {Annexe \insertframenumber{} / \inserttotalframenumber}% <replace>
%	  {}% <success>
%	  {}% <failure>
%	\makeatother
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	\setcounter{captureframe}{\value{framenumber}}% Store/capture current frame
	%% Replace <frame #> in footline template
	\makeatletter
	\patchcmd{\beamer@@tmpl@footline}% <cmd>
	  {\insertframenumber}% <search>
	  {\thecaptureframe}% <replace>
	  {}% <success>
	  {}% <failure>
	\makeatother

%	% From http://www.stanford.edu/~dgleich/notebook/2009/05/appendix_slides_in_beamer_cont_1.html
	\setcounter{finalframe}{\value{framenumber}}
	%% Backup frames
	\setcounter{framenumber}{\value{finalframe}}
}

%% END of naereenbeamer.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
