%
% Malfil for NTNU-presentasjon i latex-beamer
%
% Basert på Powerpointmal laget vår 2005 av NTNU-infoavdelingen.
%
%     http://www.math.ntnu.no/~berland/ntnubeamer/
% 
% Ikke bruk dette temaet (theme) direkte fra latex-filene, inkluder
% filene med språk i navnet slik at riktige bakgrunner blir valgt, og
% de filene vil inkludere denne for deg.
%
% Håvard Berland 2005, <Havard.Berland@math.ntnu.no>
%
% $Id: beamerthementnu.sty 24 2006-07-05 09:13:02Z berland $
%

\ProvidesClass{beamerthementnu2005}[2006/07/05]

\mode<presentation>

\RequirePackage{helvet}

\setbeamertemplate{navigation symbols}{}

% ``Reflex blue i RGB, pr. 5. juli 2006''
\definecolor{ntnublue}{rgb}{0.0549,0.173,0.557}

% Bakgrunnsfarge for bokser hentet fra Fargekart_NTNU.pdf
%% MÅ FIKSES NÅR INFOAVDELINGEN BESTEMMER SEG!!
\definecolor{ntnuboksbakgrunn}{rgb}{0.89, 0.93, 0.94}

\definecolor{pagenumbercolor}{rgb}{0.742,0.844,0.8945}
\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{pagenumber}{fg=pagenumbercolor}
\setbeamercolor{alerted text}{fg=red}
\setbeamercolor{example text}{fg=ntnublue!50!black}
\setbeamercolor{structure}{fg=ntnublue}
\setbeamercolor{background canvas}{parent=normal text}
\setbeamercolor{background}{parent=background canvas}
\setbeamercolor{footline}{fg=white}%,bg=red}

\setbeamerfont{footline}{size=\tiny}

%\tiny	5	5	
%\scriptsize	7	7	
%\footnotesize	8	8	
%\small	9	9	
%\normalsize	10	10	
%\large	12	12	
%\Large	14	14.40	
%\LARGE	18	17.28	
%\huge	20	20.74	
%\Huge	24	24.88




\setbeamersize{text margin left=1cm,text margin right=1em}

% Bildene deklareres her først, da blir de kun fysisk inkludert en
% gang i hver pdf-fil som genereres, selv om de brukes på hver side.
% Andre språkavhengige bilder deklareres i de spesifikke språkfilene.
\pgfdeclareimage[height=\paperheight,interpolate=true]{bakgrunn}{gfx/bakgrunn}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definerer to templates for bakgrunn, avhengig av om det er forside
% eller ikke. Hvilken som brukes må styres av brukeren, se kommandoen 
% \ntnutitlepage under.
\defbeamertemplate*{background canvas}{ntnu theme}%
{%
  \pgfuseimage{bakgrunn}%
}
\defbeamertemplate{background canvas}{ntnu theme titlepage}%
{%
  \pgfuseimage{bakgrunnforside}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% En kommando for å lage forside, som bruker en annen bakgrunn
\newcommand{\ntnutitlepage}{%
{% open a TeX group to keep changes local
\setbeamertemplate{background canvas}[ntnu theme titlepage]
\setbeamertemplate{footline}[ntnu theme titlepage]
\begin{frame}%
\titlepage%
\end{frame}%
}%
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Kode for å få til pene bokser
\setbeamertemplate{blocks}[]
\setbeamercolor{block title}{fg=white,bg=ntnublue}
\setbeamercolor{block title example}{parent=block title}
\setbeamercolor{block body}{parent=normal text,%
  use=block title,bg=ntnuboksbakgrunn}
\setbeamercolor{block body example}{parent=block body}
% NB:
% Rektangulære bokser får litt for mye spacing når de er inni
% kolonner. Dette er innrapportert som beamerbug [2005/10/27]




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Tegner opp footer, den blå bakgrunnen i footer kommer fra bakgrunnsbilde.
\defbeamertemplate*{footline}{ntnu theme}
{
  % stay in vertical mode here, thus no \leavevmode.
  \hbox{%
    \hspace{8.5cm}
      \pgfuseimage{skapendeunivlite}%
    }%
  \hbox{%
    \begin{beamercolorbox}[wd=0.2\textwidth,ht=5mm,dp=2mm,left]{footline}%
      \hspace{2mm}\usebeamerfont{footline}www.ntnu.no%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=0.8\textwidth,ht=5mm,dp=2mm,right]{ffootline}%
      \usebeamerfont{footline}\insertshortauthor,~\insertshorttitle~\hspace{2mm}%
    \end{beamercolorbox}%
  }
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Alternativ versjon av footer som gjør at NTNU-logoen ikke tas med.
%
% For å aktivere denne, legg til kommandoen
%    \setbeamertemplate{footline}[ntnu theme nologo]
% et sted i tex-fila di.
%
% NB: NTNU info-avdelingen godtar ikke denne varianten.
%
\defbeamertemplate{footline}{ntnu theme nologo}
{
  \hbox{%
    \begin{beamercolorbox}[wd=0.2\textwidth,ht=5mm,dp=2mm,left]{footline}%
      \hspace{2mm}\usebeamerfont{footline}www.ntnu.no%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=0.8\textwidth,ht=5mm,dp=2mm,right]{ffootline}%
      \usebeamerfont{footline}\insertshortauthor,~\insertshorttitle~\hspace{2mm}%
    \end{beamercolorbox}%
  }
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Tegner opp footer for forsida, \ntnutitlepage styrer bruk av denne.
\defbeamertemplate{footline}{ntnu theme titlepage}
{
  \hbox{%
    \begin{beamercolorbox}[wd=0.2\textwidth,ht=5mm,dp=2mm,left]{footline}%
      \hspace{2mm}\usebeamerfont{footline}www.ntnu.no%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=0.8\textwidth,ht=5mm,dp=2mm,right]{ffootline}%
      \usebeamerfont{footline}\insertshortauthor,~\insertshorttitle~\hspace{2mm}%
    \end{beamercolorbox}%
  }
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setter opp teksten på forsida (tittel på foredrag, foredragsholder etc..
\defbeamertemplate*{title page}{ntnu}[1][]
{%
  \vspace{0.47\paperheight}
%  \begin{flushleft}
    \begin{beamercolorbox}[sep=3pt,left,leftskip=1.2cm,#1]{title}
      \usebeamerfont{title}\inserttitle\par%
      \ifx\insertsubtitle\@empty%
      \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
      \fi%     
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=3pt,left,leftskip=1.2cm,#1]{author}
      \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=3pt,left,leftskip=1.2cm,#1]{institute}
      \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=3pt,left,leftskip=1.2cm,#1]{date}
      \usebeamerfont{date}\insertdate
    \end{beamercolorbox}
%  \end{flushleft}
  \vfill
}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Header på hver slide
\defbeamertemplate*{frametitle}{ntnu theme}[1][left]
{
  \@tempdima=\textwidth%
%$  \advance\@tempdima by\beamer@leftmargin%
  \advance\@tempdima by\beamer@rightmargin%
  % \@tempdima must now be the whole physical page width
  
  % sep-option to beamercolorbox gives padding in all directions
  % inside the beamercolorbox.
  
  % Page number:
  \begin{beamercolorbox}[sep=0.2cm,leftskip=-1cm,wd=1cm]{pagenumber}
    \usebeamerfont{pagenumber}
    \insertframenumber
  \end{beamercolorbox}
  
  % Skip a bit downwards:
  \vskip0.0cm
  
  % Print frametitle:
  \begin{beamercolorbox}[sep=0cm,#1,wd=\the\@tempdima]{frametitle}
    \if@tempswa\else\csname beamer@fte#1\endcsname\fi%
    {\usebeamerfont{frametitle}\insertframetitle\par}%
    % \if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here... 
  \end{beamercolorbox}%
}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Noen generelle innstillinger
\setbeamercolor*{itemize item}{fg=black}
\setbeamercolor*{itemize subitem}{fg=black}
\setbeamercolor*{itemize subsubitem}{fg=black}
\setbeamercolor*{enumerate item}{fg=black}
\setbeamercolor*{enumerate subitem}{fg=black}
\setbeamercolor*{enumerate subsubitem}{fg=black}
\setbeamercolor*{title}{fg=black}
\setbeamercolor*{frametitle}{fg=black}


\defbeamertemplate*{itemize item}{ntnu}{---}
\defbeamertemplate*{itemize subitem}{ntnu}{$\bullet$}
\defbeamertemplate*{itemize subsubitem}{ntnu}{---}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Fonter

\setbeamerfont{title}{size=\large,series=\bfseries}
\setbeamerfont{subtitle}{size=\normalsize}
\setbeamerfont{author}{size=\normalsize}
\setbeamerfont{date}{size=\normalsize}
\setbeamerfont{institute}{size=\normalsize}
\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries}
\setbeamerfont{pagenumber}{size=\small,series=\bfseries}


\mode
<all>
