%% Encoding: ISO8859-1 %%

%% LaTeX-Beamer template for KIT design
%% by Erik Burger, Christian Hammer
%%
%% modified by Christian Henrich for IKS
%%
%% version 1.2
%%
%% mostly compatible to KIT corporate design v1.2
%% http://www.uni-karlsruhe.de/download/uka/Gestaltungsrichtlinien_komplett.pdf
%%
%% Problems, bugs and comments to
%% burger@ipd.uka.de

\usepackage[latin1]{inputenc}
\usepackage[english,ngerman]{babel}
\usepackage{ifthen} %For choosing the language, see below
\usepackage{hyperref}
\usepackage[absolute,overlay]{textpos}
\usepackage{semirounded}
\usepackage[abs]{overpic}

\usepackage{times}

\setbeamercovered{transparent}

\useinnertheme{rounded}
\usecolortheme{kit}

%save space in the footer
\beamer@compresstrue

\newcommand{\titleimage}{IKS-beamer-motiv}

%CH: KIT-point
\setbeamertemplate{itemize items}{
\begin{pgfpicture}{0mm}{0mm}{1ex}{1ex}
{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}} 
\pgfpathmoveto{\pgfpoint{0cm}{1ex}} 
\pgfpathlineto{\pgfpoint{1ex}{1ex}}
\pgfpathlineto{\pgfpoint{1ex}{0cm}}}
{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}}
\pgfpathmoveto{\pgfpoint{1ex}{0cm}}
\pgfpathlineto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0cm}{1ex}}}
\color{kit-green100}
\pgfusepath{fill}
\end{pgfpicture}%
}

\setbeamertemplate{title page}
{
\thispagestyle{empty}

%middle block with name of institute
\begin{textblock*}{\paperwidth}(1mm,42.25mm)
\begin{pgfpicture}{0mm}{0mm}{\paperwidth-2mm}{6mm}
	\color{black!50}
	\pgfpathrectangle{\pgfpoint{0mm}{0mm}}{\pgfpoint{\paperwidth-2mm}{6mm}}
	\pgfusepath{fill}
	\pgftext[at=\pgfpoint{8.5mm}{3mm},left,center]{\textcolor{white}{\tiny\textsc{\insertinstitute}}}
\end{pgfpicture}
\end{textblock*}


%elements on title page

%KIT logo
\begin{textblock*}{16mm}(4mm,4mm)
	\iflanguage{english}{
	\includegraphics[width=15mm]{logos/kitlogo_rgb}
	}{
	\includegraphics[width=15mm]{logos/kit_logo_de_4c_positiv}
	}
\end{textblock*}

%title
\begin{textblock*}{120mm}(9.5mm,16mm)
\begin{beamercolorbox}[wd=118mm,ht=14mm,dp=3mm,left]{white}%
\LARGE\textbf{\inserttitle}
\end{beamercolorbox}
\end{textblock*}

%subtitle
\begin{textblock*}{120mm}(9.5mm,33mm)
\tiny \insertsubtitle
\end{textblock*}

%author
\begin{textblock*}{120mm}(9.5mm,36mm)
\tiny\insertauthor%~\textbar~\insertshortdate
\end{textblock*}

%Universit�t Karlsruhe logo
%\begin{textblock*}{23mm}(106mm,89.6mm)
%\iflanguage{english}{
%\includegraphics[width=20mm]{logos/uka_wortbild_en}
%}{
%\includegraphics[width=20mm]{logos/uka_wortbild_de}
%}
%\end{textblock*}

%Forschungszentrum Karlsruhe logo
%\begin{textblock*}{21mm}(81mm,89.6mm)
%\includegraphics[width=20mm]{logos/fzk_wortbild}
%\end{textblock*}

%legal KIT text
\begin{textblock*}{80mm}[0,1](4mm,94mm)
\fontsize{4pt}{6pt}\selectfont
\iflanguage{english}{
KIT -- The Research University in the Helmholtz Association}
{KIT -- Die Forschungsuniversit{\"a}t in der Helmholtz-Gemeinschaft}
\end{textblock*}

\begin{textblock*}{20mm}[0,1](110mm,92mm)
\fontsize{8pt}{8pt}\selectfont
\bfseries
\textcolor{black!75}{
	\href{http://www.kit.edu}{www.kit.edu}
}
\end{textblock*}

% title image

\begin{textblock*}{\paperwidth}(1mm,48.5mm)
\begin{overpic}[width=126mm,height=40mm]{logos/\titleimage}
\put(-6,-3){
	%mask curve for lower left corner of title image
	\begin{pgfpicture}{0mm}{0mm}{3mm}{3mm}
		\pgfpathqmoveto{0mm}{0mm}
		\pgfpathlineto{\pgfpoint{3mm}{0mm}}
		\pgfpathlineto{\pgfpoint{3mm}{1mm}}

		{\pgfsetcornersarced{\pgfpoint{2mm}{2mm}} 
		\pgfpathlineto{\pgfpoint{1mm}{1mm}}
		\pgfpathlineto{\pgfpoint{1mm}{3mm}}}

		\pgfpathmoveto{\pgfpoint{1mm}{3mm}}
		\pgfpathlineto{\pgfpoint{0mm}{3mm}}
		\pgfpathlineto{\pgfpoint{0mm}{0mm}}
		\pgfpathclose

		\color{black!15}
		\pgfusepath{fill}
	\end{pgfpicture}
}
\end{overpic}
\end{textblock*}

}

%background for pages
%CH: for plain frames
\newlength{\kitbottom}
\usebackgroundtemplate{
	\setlength{\kitbottom}{\ifbeamer@plainframe1mm\else9mm\fi}%
\begin{pgfpicture}{0mm}{0mm}{\paperwidth}{\paperheight}

	{\pgfsetcornersarced{\pgfpoint{2mm}{2mm}}
	\pgfpathmoveto{\pgfpoint{\paperwidth-1mm}{\kitbottom}}
	\pgfpathlineto{\pgfpoint{1mm}{\kitbottom}}
	\pgfpathlineto{\pgfpoint{1mm}{\paperheight-1mm}}}

	{\pgfsetcornersarced{\pgfpoint{2mm}{2mm}}
	\pgfpathmoveto{\pgfpoint{1mm}{\paperheight-1mm}}
	\pgfpathlineto{\pgfpoint{\paperwidth-1mm}{\paperheight-1mm}}
	\pgfpathlineto{\pgfpoint{\paperwidth-1mm}{\kitbottom}}}

	\color{white}
	\pgfusepath{fill}

\end{pgfpicture}%
}

%frametitle
\setbeamertemplate{frametitle}
{
\vspace{2mm} \hspace*{-4mm}
\vbox{\hsize=9cm\bfseries\insertframetitle}

\begin{textblock*}{15mm}(110mm,4mm)
	\iflanguage{english}{
		\includegraphics[width=14mm]{logos/kitlogo_rgb}
	}{
	\includegraphics[width=14mm]{logos/kit_logo_de_4c_positiv}
	}
\end{textblock*}

\begin{textblock*}{1.5mm}(1mm,1mm)
\begin{pgfpicture}{0mm}{0mm}{1.5mm}{9mm}
	\color{kit-green100}
	\pgfpathrectangle{\pgfpoint{0mm}{0mm}}{\pgfpoint{1.5mm}{9mm}}
	\pgfusepath{fill}
\end{pgfpicture}%
\end{textblock*}

}


\setbeamertemplate{headline}
{
}

%footer
\setbeamertemplate{footline}
{
\vskip.4mm
\begin{beamercolorbox}[ht=2.4mm, dp=3mm]{section in head/foot}
	%include mini frame navigation
	\insertnavigation{\paperwidth}
\end{beamercolorbox}

\begin{beamercolorbox}[wd=0.7\textwidth,ht=2.2mm,dp=1.5mm,leftskip=1.3em,rightskip=.5em]{author in head/foot}%
\usebeamerfont{author in head/foot}%
\insertshortauthor\hspace{2.5pt}--\hspace{2.5pt}\insertshorttitle
\end{beamercolorbox}%
\vspace*{-4mm}\hspace*{0.7\textwidth}%
\begin{beamercolorbox}[wd=0.3\textwidth,ht=2.2mm,dp=1.5mm,left,leftskip=.5em]{title in head/foot}%
\usebeamerfont{title in head/foot}%
\hfill\hspace{65pt}\insertframenumber{}/\inserttotalframenumber
% vorher: \hfill\insertshortdate\hspace{30pt}\insertframenumber{}/\inserttotalframenumber
\end{beamercolorbox}%
}
