% Radboud University Nijmegen titlepage
% Author: Mart Lubbers
% Date: 2016-11-15
\RequirePackage{geometry,graphicx,ifpdf,keyval,iflang}

\def\@rutitleauthors{\@author}
\def\@rutitlepagenr{\thepage}
\define@key{maketitleru}{course}{\def\@rutitlecourse{#1}}
\define@key{maketitleru}{institute}{\def\@rutitleinst{#1}}
\define@key{maketitleru}{authorstext}{\def\@rutitleauthorstext{#1}}
\define@key{maketitleru}{authors}{\def\@rutitleauthors{#1}}
\define@key{maketitleru}{righttext}{\def\@rutitlerighttext{#1}}
\define@key{maketitleru}{righttextheader}{\def\@rutitlerighttextheader{#1}}
\define@key{maketitleru}{righttextB}{\def\@rutitlerighttextb{#1}}
\define@key{maketitleru}{righttextBheader}{\def\@rutitlerighttextbheader{#1}}
\define@key{maketitleru}{pagenr}{\def\@rutitlepagenr{#1}}
\define@key{maketitleru}{subtitle}{\def\@rutitlesubtitle{#1}}
\setkeys{maketitleru}{%
	course={},
	institute={Radboud Universit\IfLanguageName{dutch}{eit}{y} Nijmegen},
	authorstext={\IfLanguageName{dutch}{Auteurs: }{Authors:}},
	righttextheader={},
	righttext={}
}	
\newcommand{\maketitleru}[1][]{
	\setkeys{maketitleru}{#1}
	\newgeometry{hmarginratio=1:1}
	\begin{titlepage}
		\setcounter{page}{\@rutitlepagenr}
		\begin{center}
			\textsc{\LARGE\@rutitlecourse}\\[1.5cm]
			\ifpdf\includegraphics[height=150pt]{logo.pdf}\\
			\else\includegraphics[height=150pt]{logo.eps}\\
			\fi
			\vspace{0.4cm}
			\textsc{\Large\@rutitleinst}\\[1cm]
			\hrule
			\vspace{0.4cm}
			\textbf{\large\@title}\\[0.4cm]
			\hrule
			\ifdefined\@rutitlesubtitle
				\vspace{0.4cm}
				\textit{\@rutitlesubtitle}\\[1cm]
			\else
				\vspace{2cm}			
			\fi
			\begin{minipage}[t]{0.45\textwidth}
				\begin{flushleft}\large
					\textit{\@rutitleauthorstext}\\
					\@rutitleauthors{}
				\end{flushleft}
			\end{minipage}
			\begin{minipage}[t]{0.45\textwidth}
				\begin{flushright}\large
					\textit{\@rutitlerighttextheader}\\
					\@rutitlerighttext%
				\end{flushright}
			\end{minipage}

			\vspace{1cm}
			\ifdefined\@rutitlerighttextb
				\begin{minipage}[t]{0.45\textwidth}
					~
				\end{minipage}
				\begin{minipage}[t]{0.45\textwidth}
					\begin{flushright}\large
						\textit{\@rutitlerighttextbheader}\\
						\@rutitlerighttextb%
					\end{flushright}
				\end{minipage}
			\fi
			\vfill
			{\large\@date}
		\end{center}
	\end{titlepage}
	\restoregeometry
}
