% Student template

\clearpage
\checkoddpage

\sectionmark{Steckbrief - \stdname}

% Returns a default file if not found
\providecommand\dfincludegraphics[2][]{
	\IfFileExists{#2}
	{
		\includegraphics[#1]{#2}
	}
	{
		%\fbox{File not found}
	}
}

% Ring
\def\ringx{20pt}
\def\ringy{250pt}
\def\ringwidth{250pt}
\def\ringimgwidth{180pt}
\def\ringoffset{(\ringwidth - \ringimgwidth) / 2}
\ifoddpage\else
	\def\ringx{-\paperwidth - 325pt} % ringwidth + 2 * ringx % Nope, idk anymore
\fi
\AddToShipoutPictureBG*{
	\AtTextUpperLeft{
		\put(-\ringx + \ringoffset, -\ringy + \ringoffset){
			\dfincludegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/generated/students/figures/bornerma.jpg}
		}
		\put(-\ringx, -\ringy){
			\includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png}
		}
	}
}

% Frame
\def\framex{160pt}
\def\framey{20pt}
\def\framewidth{180pt}
\def\frameimgwidth{160pt}
\def\frameoffset{(\framewidth - \frameimgwidth) / 2}
\ifoddpage\else
	\def\framex{540pt} % paperwidth - framewidth / 2 % Nope, idk anymore
\fi
\AddToShipoutPictureBG*{
	\AtTextLowerLeft{
		\put(\textwidth - \framex + \frameoffset, \framey + \frameoffset + 8pt){
			\dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/generated/students/figures/child_\stdid.jpg}
		}
		\put(\textwidth - \framex, \framey){
			\oddflip[keepaspectratio=true, width=\framewidth]{rahmen.png}
		}
	}
}

% Steckbrief Tabelle
\ifoddpage
	\def\tablex{0.5\linewidth}
	\def\tablewidth{0.6\linewidth}
\else
	\def\tablex{-0cm}
	\def\tablewidth{0.55\linewidth}
\fi

\hspace*{\tablex}\large\begin{minipage}{\tablewidth}
	\begin{tabular}{@{}ll@{}}
		\textbf{Name:}          & \stdname                                                  \\
		\textbf{Geburtstag:}    & \multicolumn{1}{p{\tablewidth}}{\RaggedRight\stdbirthday} \\
		\textbf{Lieblingsfach:} & \multicolumn{1}{p{\tablewidth}}{\RaggedRight\stdfavsub}   \\
		\textbf{Hassfach:}      & \multicolumn{1}{p{\tablewidth}}{\RaggedRight\stdhatesub}  \\
		\textbf{Hobbies:}       & \multicolumn{1}{p{\tablewidth}}{\RaggedRight\stdhobbies}  \\
		\textbf{Musik:}         & \multicolumn{1}{p{\tablewidth}}{\RaggedRight\stdmusic}    \\
	\end{tabular}\\~\\
	\textbf{Das werde ich am meisten vermissen:}\\\stdmissing\\~\\
	\textbf{Ohne das hätte ich die Oberstufe nicht geschafft:}\\\stdmotivation\\~\\
	\textbf{Lebensmotto:}\\\stdquote\\~\\
	\textbf{Zukunftspläne:}\\\stdfuture\\~\\
	%\textbf{Erkennungsmerkmale:}\\\stdidk\\~\\
\end{minipage}

% Characteristics
\providecommand\studentchar[1]{
	\textbf{#1}
}

% Divider
\providecommand\divider{
	\begin{figure}[H]
		\hspace*{-1.5cm}\includegraphics[keepaspectratio=true, width=\paperwidth]{mittelwelle.png}
	\end{figure}
}

% Comments
\def\commentswidth{0.7\linewidth}
\ifoddpage
	\def\commentsx{-0cm}
\else
	\def\commentsx{\framewidth}
\fi
