aboutsummaryrefslogtreecommitdiff
path: root/zeitung/parts/studenttemplate.tex
blob: 853f0e665f3aad03ccffaedddef0ab4eed8c768a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
% 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}
	}
}

\providecommand\studentbackground[2]{
	% 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

	% Frame and QR-Code
	\def\framex{160pt}
	\def\framey{20pt}
	\def\framewidth{180pt}
	\def\frameimgwidth{160pt}
	\def\frameoffset{(\framewidth - \frameimgwidth) / 2}
	\def\qrcodex{90pt}
	\ifoddpage\else
		\def\framex{540pt} % paperwidth - framewidth / 2 % Nope, idk anymore
		\def\qrcodex{470pt}
	\fi

	\AddToShipoutPictureBG*{
		\AtTextUpperLeft{
			\put(-\ringx + \ringoffset, -\ringy + \ringoffset){
				\def\imgpath{parts/generated/students/figures/36_#1.jpg}
				\IfFileExists{\imgpath}{}
				{
					\def\imgpath{placeholder/#1.jpg}
				}
				\includegraphics[keepaspectratio=true, width=\frameimgwidth]{\imgpath}
			}
			\put(-\ringx, -\ringy){
				\includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png}
			}
		}
		\AtTextLowerLeft{
			\put(\textwidth - \framex + \frameoffset, \framey + \frameoffset + 8pt){
				\dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/generated/students/figures/11_#1.jpg}
			}
			\put(\textwidth - \framex, \framey){
				\oddflip[keepaspectratio=true, width=\framewidth]{rahmen.png}
			}
			\put(\textwidth - \qrcodex, \framey - 25pt){
				\def\stdqrcode{#2}
				\ifdefempty{\stdqrcode}{}{
					\qrcode[nolink, height=0.7in]{#2}
				}
			}
			\put(\textwidth - \qrcodex, 250pt){
				\oddflip[keepaspectratio=true, height=2cm]{vorderseite.png}
			}
		}
	}
}

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

\hspace*{\tablex}\vspace*{1.4cm}\begin{minipage}{\tablewidth}
	\vspace*{.5cm}
	\begin{normalsize}
		\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\\~\\
	\end{normalsize}
\end{minipage}

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

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

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