\renewcommand{\maketitle}[1][top=6cm,bottom=4cm,inner=1.5cm,outer=1.5cm]{%
	\begin{titlepage}
		\newgeometry{#1}
		\begin{center}
			\Huge{\bfseries\Title}

			\vspace{3em}

			\begin{minipage}{0.7\textwidth}
				\Large{Name:} \luecke{8cm}

				\vspace{2em}

				\Large{Klasse:} \luecke{4cm}
			\end{minipage}

			\vspace{2em}
			
			\Large{Schuljahr \Schuljahr}
		\end{center}

		\vfil
		\hrule
		\vspace{2em}

		\begin{minipage}{0.5\textwidth}
			\includegraphics[width=\textwidth]{\LogoFront}
		\end{minipage}
		\hfil
		\begin{minipage}{0.45\textwidth}
			\huge{\bfseries \GenordForm\linebreak \GenordName}
		\end{minipage}
	\end{titlepage}
	\restoregeometry
}

\renewcommand{\addchap}[2][]{%
	\addcontentsline{toc}{chapter}{#2}
	\huge{\bfseries #2}
}

\newcommand{\procOpts}{%
	\ifthenelse{\boolean{printDraft}}{%
		\setboolean{printKalendar}{false}
		\setboolean{printWochen}{false}
	}{
		\setboolean{printKalendar}{true}
		\setboolean{printWochen}{true}
	}
}

\newcommand{\front}{%
	\frontmatter
	\chead{}
	\ihead{\chaptermark}
	\ohead{\normalfont\Title}
	\cfoot{}
}
\newcommand{\hauptteil}{%
	%\clearpage
	{
		\let\cleardoublepage\relax
		\let\clearpage\relax
		\mainmatter 
	}
}
\newcommand{\anhang}{%
	\clearpage
	\appendix
}

\newcommand{\wochen}[2][]{%
	%\clearpage
	\addcontentsline{toc}{chapter}{Wochenübersichten}
	\input{#2}
}

\ProvideDocumentCommand{\mkUrl}{O{} m o}{%
	\url{#1#2} \marginpar{%
		\qrcode[height=4em,nolinks]{#1#2}
		\IfNoValueF{#3}{
			\tiny #3
		}
	}
}

\WithSuffix\newcommand\mkUrl*[2][]{%
	\hyperlink{#1#2}{#2}
}
\ProvideDocumentCommand{\mkUrlCode}{O{} m o O{5em} O{4em}}{%
	\begin{minipage}{#4}
		\centering
		\qrcode[height=#5,nolinks]{#1#2}
		\IfNoValueF{#3}{
			\tiny #3
		}
	\end{minipage}	
}
% **********************************************************************
% Macros für Kontakt
% **********************************************************************
\newtcolorbox{kontaktbox}[2][]{%
	left=2mm,
	fonttitle=\bfseries,
	title={#2},
	#1
}

% **********************************************************************
% Macros für Wochenübersicht
% **********************************************************************
\newcommand{\printWochenuebersicht}[3][Wochenübersicht]{%
	\ifthenelse{\boolean{printWochen}}{%
		\newgeometry{%includefoot,includehead,
			top=0.75cm,
			bottom=0.5cm,
			inner=1.5cm,
			outer=1cm,
		}
		\pagestyle{empty}

		%\printLogbuchWoche{\jahrEins-09-04}{\jahrEins-09-09}
		\pgfcalendar{}{#2}{#3}
		{\ifdate{Monday}{\printLogbuchTagMo{%
						\pgfcalendarweekdayname{\pgfcalendarcurrentweekday},%
						\pgfcalendarcurrentday.\pgfcalendarcurrentmonth%
					}\hfil%
			}{}%
			\ifdate{Tuesday}{\printLogbuchTagDi{%
							\pgfcalendarweekdayname{\pgfcalendarcurrentweekday},%
							\pgfcalendarcurrentday.\pgfcalendarcurrentmonth%
						}\hfil%
			}{}%
			\ifdate{Wednesday}{\printLogbuchTagMi{%
						\pgfcalendarweekdayname{\pgfcalendarcurrentweekday},%
						\pgfcalendarcurrentday.\pgfcalendarcurrentmonth%
					}\pagebreak%
			}{}%
			\ifdate{Thursday}{\printLogbuchTagDo{%
							\pgfcalendarweekdayname{\pgfcalendarcurrentweekday},%
							\pgfcalendarcurrentday.\pgfcalendarcurrentmonth%
						}\hfil%
			}{}%
			\ifdate{Friday}{\printLogbuchTagFr{%
							\pgfcalendarweekdayname{\pgfcalendarcurrentweekday},%
							\pgfcalendarcurrentday.\pgfcalendarcurrentmonth%
						}%
				}{}%
		}

		\clearpage
		\pagestyle{scrheadings}
		\restoregeometry
	}{
		\clearpage	
		\begin{center}
			\Huge{#1 1}
		\end{center}
			\clearpage
		\begin{center}
			\Huge{#1 2}
		\end{center}
			\clearpage
	}
}
\newcommand{\printLogbuchTagMo}[2][]{%
		\begin{minipage}{\textwidth}
			\printLogbuchZiel
		\end{minipage}\\[0.5em]
		\begin{minipage}[t]{0.32\textwidth}
			\centering
			\begin{logbuchTag}{#2}
				\faecher
			\end{logbuchTag}
		\end{minipage}
}
\newcommand{\printLogbuchTagDi}[2][]{%
	\begin{minipage}[b]{0.32\textwidth}
			\centering
			\begin{logbuchTag}{#2}
				\faecher[5]
			\end{logbuchTag}
			\begin{logbuchZusatz}{Extras}
				something awesome will appear here
				\vspace{1.6cm}
			\end{logbuchZusatz}
		\end{minipage}
}
\newcommand{\printLogbuchTagMi}[2][]{%
	\begin{minipage}[t]{0.32\textwidth}
			\centering
			\begin{logbuchTag}{#2}
				\faecher
			\end{logbuchTag}
		\end{minipage}
}
\newcommand{\printLogbuchTagDo}[2][]{%
	\begin{minipage}[b]{0.32\textwidth}
			\centering
			\begin{logbuchTag}{#2}
				\faecher
			\end{logbuchTag}
			\begin{logbuchZusatz}[height=1.5cm,]{Kenntnissnahme}
				%\textbf{Wochenziel:}
				
				%\arbeitshaltungEmojis
				%\tcblower
				%\vspace{0.6cm}

				\vspace{0.5cm}

				\begin{minipage}{0.31\textwidth}
					\centering
					\luecke{\linewidth}
					
					\footnotesize Schüler\_in
				\end{minipage}\hfil
				\begin{minipage}{0.31\textwidth}
					\centering
					\luecke{\linewidth}

					\footnotesize Lehrkraft
				\end{minipage}\hfil
				\begin{minipage}{0.31\textwidth}
					\centering
					\luecke{\linewidth}
					\footnotesize Eltern
				\end{minipage}
			\end{logbuchZusatz}
		\end{minipage}
}
\newcommand{\printLogbuchTagFr}[2][]{%
	\begin{minipage}[b]{0.32\textwidth}
		\centering
		\begin{logbuchTag}{#2}
			\faecher[5]
		\end{logbuchTag}
		\begin{logbuchZusatz}[width=2.05\textwidth]{Wochenfeedback}
			\feldLin[0.77cm]{6}
		\end{logbuchZusatz}
	\end{minipage}\hfil
	\printLogbuchSpalte
}
\newcommand{\printLogbuchSpalte}{%
	\begin{minipage}[b]{0.32\textwidth}
			\centering
				\begin{logbuchZusatz}{Mitteilungen Eltern}
						\feldLin[0.8cm]{8}
						\vspace{-0.4cm}
						\chb\ Weitere Mitteilungen S.\,\pageref{mitteilungen}
						\vspace{0.4cm}
				\end{logbuchZusatz}

				\begin{logbuchZusatz}{Vereinbarungen Logbuchgespräch}
						\feldLin[0.8cm]{6}
						\vspace{-0.5cm}
				\end{logbuchZusatz}
				
				\begin{logbuchZusatz}{Feedback}
					\begin{smallitemize}
						\item Arbeitshaltung
							
							\arbeitshaltungEmojis
						\item Freundlich und Fair
							
							\arbeitshaltungEmojis
						\item Material
							
							\arbeitshaltungEmojis
					%	\item Logbuch
					%		
					%		\arbeitshaltungEmojis
					\end{smallitemize}
				\end{logbuchZusatz}
				\begin{logbuchZusatz}[upperbox=invisible,tikz={opacity=0,transparency group}]{Wochenfeedback}
					\feldLin[0.77cm]{6}
				\end{logbuchZusatz}
		\end{minipage}
}
\newcommand{\arbeitshaltungEmojis}{%
	\usym{1F641}	\hspace{0.5em} \usym{1F610} \hspace{0.5em} \usym{1F642} \hspace{0.5em} \usym{1F603}
}
\newcommand{\printLogbuchZiel}{%
	\begin{center}
		\tcbox[%
			enhanced,
			attach boxed title to top left = {xshift=2mm,yshift=-2mm},
			colback=white!98!black,%
			height=1.5cm,	
			left=1mm,
			right=1mm,
			drop lifted shadow,
			fonttitle=\bfseries,
			title={Mein Wochenziel:},
			]{\hspace{0.95\linewidth}}%
	\end{center}
}
\newtcolorbox{logbuchZusatz}[2][]{%
	enhanced,
	attach boxed title to top left = {xshift=2mm,yshift=-2mm},
	colback=white!98!black,%
	drop lifted shadow,
	left=1mm,
	right=1mm,
	fonttitle=\bfseries,
	center title,
	minipage boxed title=3.5cm,
	%colback=white!98!black,%	
	fonttitle=\bfseries,
	title={#2},
	#1
}
\newtcolorbox{logbuchTag}[1]{%
	colback=white!98!black,%
	drop shadow southeast,	
	left=1mm,
	right=1mm,
	fonttitle=\bfseries,
	title={#1},
}
\newtcolorbox{logbuchFach}[1]{%
	enhanced,
	attach boxed title to top left = {xshift=2mm,yshift=-2mm},
	sharp corners=downhill,
	drop small lifted shadow,
	colback=white!93!black,	
	sidebyside=true,
	righthand width=0.8cm,
	sidebyside gap=3mm,
	flushright lower,
	left=1mm,
	right=1mm,
	top=4mm,
	skin=bicolor,
	colbacklower=white!85!black,
	halign lower=center,
	leftlower=4mm,
	rightlower=4mm,
	title=#1,
}
\newcommand{\faecher}[1][6]{%
	\foreach\n in {1,...,#1}{%
		\begin{logbuchFach}{\n.\,Stunde}
			\textbf{Fach:} 

			\feldLin[0.6cm]{3}
			\vspace{-0.5cm}
			\tcblower
			\usym{1F641}

			\vspace{0.5em}

			\usym{1F610} 
			
			\vspace{0.5em}

			\usym{1F642} 
			
			\vspace{0.5em}

			\usym{1F603}
		\end{logbuchFach}
	}
}
\newcommand{\logbuchWoche}[6][3]{%
	\newcounter{logbuchTagNummer}
	\setcounter{logbuchTagNummer}{0}
	\foreach\name in {#2,#3,#4,#5,#6}{%
		\refstepcounter{logbuchTagNummer}
		\begin{minipage}{0.32\textwidth}
			\centering
			\begin{logbuchTag}{\name}
				\faecher
			\end{logbuchTag}
		\end{minipage}
		\ifthenelse{\value{logbuchTagNummer}<#1\OR\(\value{logbuchTagNummer}>#1\AND\value{logbuchTagNummer}<5\)}{%
			\hfil
		}{}
	}
}
% **********************************************************************
% Macros für Kompetenznachweis
% **********************************************************************
\newcommand{\kompnachweisLB}[4][]{%
	\renewcommand{\arraystretch}{1.9}
	\begin{tabularx}{\linewidth}{cc|X|c|c|c|c}
		\rowcolor{gray!40!white}
		&
		{\bfseries Datum} &
		{\bfseries Thema} &
		{\bfseries\footnotesize Note} &
		{\bfseries\footnotesize E|G} &
		\multicolumn{2}{|c}{\bfseries Unterschriften} \\
		\rowcolor{gray!40!white}
		 & & & & & {\tiny Fachlehrer\_in} & 
		{\tiny Tutor\_in}\\
		\hline
		\rowcolor{white}
		\multicolumn{7}{c}{\bfseries Lernbüro #2}\\\hline
		\rowcolor{gray!20!white}
		 1 & & & & & &\\
		\rowcolor{gray!10!white}
		 2 & & & & & &\\
		\rowcolor{gray!20!white}
		 3 & & & & & &\\
		\rowcolor{gray!10!white}
		 4 & & & & & &\\
		\rowcolor{gray!20!white}
		 5 & & & & & &\\
		\rowcolor{gray!10!white}
		 6 & & & & & &\\\hline
		\rowcolor{white}
		\multicolumn{7}{c}{\bfseries Lernbüro #3}\\\hline
		\rowcolor{gray!20!white}
		 1 & & & & & &\\
		\rowcolor{gray!10!white}
		 2 & & & & & &\\
		\rowcolor{gray!20!white}
		 3 & & & & & &\\
		\rowcolor{gray!10!white}
		 4 & & & & & &\\
		\rowcolor{gray!20!white}
		 5 & & & & & &\\
		\rowcolor{gray!10!white}
		 6 & & & & & &\\\hline
		\rowcolor{white}
		\multicolumn{7}{c}{\bfseries Lernbüro #4}\\\hline
		\rowcolor{gray!20!white}
		 1 & & & & & &\\
		\rowcolor{gray!10!white}
		 2 & & & & & &\\
		\rowcolor{gray!20!white}
		 3 & & & & & &\\
		\rowcolor{gray!10!white}
		 4 & & & & & &\\
		\rowcolor{gray!20!white}
		 5 & & & & & &\\
		\rowcolor{gray!10!white}
		 6 & & & & & &\\\hline
	\end{tabularx}
	\renewcommand{\arraystretch}{1}
}
\newcommand{\kompnachweisWP}[1][]{%
	\renewcommand{\arraystretch}{1.9}
	\begin{tabularx}{\linewidth}{cc|X|c|c|c|c}
		\rowcolor{gray!40!white}
		&
		{\bfseries Datum} &
		{\bfseries Thema} &
		{\bfseries\footnotesize Note} &
		{\bfseries\footnotesize E|G} &
		\multicolumn{2}{|c}{\bfseries Unterschriften} \\
		\rowcolor{gray!40!white}
		 & & & & & {\tiny Fachlehrer\_in} & 
		{\tiny Tutor\_in}\\
		\hline
		\rowcolor{white}
		\multicolumn{7}{c}{\bfseries Wahlpflichtfach: \luecke{5cm} }\\\hline
		\rowcolor{gray!20!white}
		 1 & & & & & &\\
		\rowcolor{gray!10!white}
		 2 & & & & & &\\
		\rowcolor{gray!20!white}
		 3 & & & & & &\\
		\rowcolor{gray!10!white}
		 4 & & & & & &\\
		\rowcolor{gray!20!white}
		 5 & & & & & &\\
		\rowcolor{gray!10!white}
		 6 & & & & & &\\\hline
	\end{tabularx}
	\renewcommand{\arraystretch}{1}
}
% **********************************************************************
% Macros für Mitteilungen
% **********************************************************************
\newcommand{\mitteilungen}[1][20cm]{%
	\begin{center}
		\renewcommand{\arraystretch}{1.75}
		\begin{tabularx}{\linewidth}{p{3cm}|p{3cm}|X}
			\textbf{Datum} & \textbf{Lehrkraft} & \textbf{Mitteilung}\\\hline
			\begin{minipage}{2cm} \vspace{#1} \end{minipage} & & \\
		\end{tabularx}
		\renewcommand{\arraystretch}{1}
	\end{center}
}
% **********************************************************************
% Macros für Entschuldigungen
% **********************************************************************
\newcommand{\abwesenheitBox}[1][11]{%
	\foreach\lauf in {1,...,#1}{%
		\begin{tcolorbox}[%
			%left=2mm,
		]
			\centering\doublespacing
			Mein Kind war/wird vom \luecke{2.6cm} bis \luecke{2.6cm} aus folgendem Grund

			\luecke{0.9\linewidth} 
			
			abwesend (sein).
			\hfil
					\begin{minipage}{0.5\textwidth}
						\centering
						\vspace{2.25em}
						\luecke{\linewidth}
						\footnotesize Unterschrift Erziehungsberechtigte(r), Datum
					\end{minipage}
		\end{tcolorbox}

		\vfil	
	}
}

% **********************************************************************
% Macros für den Kalendar
% **********************************************************************
\newcommand{\ferien}{}
\newcommand{\feiertage}{}
\newcommand{\termine}{}
\newenvironment{schulkalendar}[2][top=0.5cm,bottom=0.5cm,outer=1.5cm]{%
	\newgeometry{#1}
	\pagestyle{empty}
	\addcontentsline{toc}{chapter}{#2}
	\newboolean{schulkalendarSeiteOne}
	\setboolean{schulkalendarSeiteOne}{true}
	\newcommand{\calName}{}
}{%
	\restoregeometry
	\pagestyle{scrheadings}
}
\newcommand{\schulkal}[3][0.96]{%
		\rotatebox{90}{%
			\scalebox{#1}{%
				\begin{tikzpicture}[every day/.style={anchor = north}]
					\ifthenelse{\boolean{schulkalendarSeiteOne}}{%
						\renewcommand{\calName}{first}
					}{%
						\renewcommand{\calName}{scnd}
					}
					\calendar[%
						dates=#2,
						name=\calName,
						day yshift = 3em,
						day code=
						{
							\node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
							minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
							\draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
								\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
						},
						execute before day scope=
						{
							\ifdate{day of month=1}
							{
								% Shift right
								\pgftransformxshift{4.8cm}
								% Print month name 
								\draw (0,0)node [shape=rectangle, minimum height= .53cm,
									text width = 4.4cm, fill = red, text= white, draw = red, text centered]
									{\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}};
							}{}
							\ifdate{workday}
							{
								\ferien
							}{}
							\ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{}
							\ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{}
							\feiertage
						},
					 execute at begin day scope=
						{
							% each day is shifted down according to the day of month
							\pgftransformyshift{-.53*\pgfcalendarcurrentday cm}
						}
					];

				\termine
			\end{tikzpicture}
		}
	}
	\setboolean{schulkalendarSeiteOne}{false}
	\clearpage
}
% Names of Holidays are inserted by employing this macro
\newcommand{\termin}[3][]{
	\ifthenelse{\boolean{schulkalendarSeiteOne}}{%
		\node [anchor=north west, text width= 3.4cm] at
			($(first-#2.north west)+(3em, 0em)$) {\tiny{#3}};
	}{%
		\node [anchor=north west, text width= 3.4cm] at
			($(scnd-#2.north west)+(3em, 0em)$) {\tiny{#3}};
	}
}
