\newcommand{\Signatur}{FIF} \newcommand{\Schule}{Hans-Sachs-Gymnasium} \newcommand{\LogoSchule}{images/logos/HSG.png} \newtcolorbox{wiederholung}[1]{colback=orange!5!white,colframe=orange!75!black,fonttitle=\bfseries,title=Wiederholung: #1} \newcommand\kariert[2][0.5cm]{% \begin{tikzpicture}[gray,step=#1] \pgfmathtruncatemacro\anzahl{(\linewidth-\pgflinewidth)/#1} % maximale Anzahl Kästchen pro Zeile \draw (0,0) rectangle (\anzahl*#1,#2*#1) (0,0) grid (\anzahl*#1,#2*#1); \end{tikzpicture} } \newcommand{\liniert}[2][9mm]{% \begin{tikzpicture}[gray] \path[use as bounding box](0,0)rectangle(\linewidth,-#2*#1-0.5\pgflinewidth); \foreach \n in {1,...,#2}\draw(0 ,-#1*\n )--(\linewidth,-#1*\n ); \end{tikzpicture} } \newcommand{\iflehrer}[2]{\iftoggle{lehrerversion}{#1}{#2}} \newcommand{\solution}[1]{\iftoggle{lehrerversion}{#1}{\textcolor{white}{#1}}} \newcommand{\psolution}[1]{\iftoggle{lehrerversion}{#1}{\phantom{#1}}} \ifluatex \newcommand{\gap}[1]{\underLine{\solution{#1}}} \newcommand{\pgap}[1]{\underLine{\psolution{#1}}} \else \newcommand{\gap}[1]{\uline{\solution{#1}}} \newcommand{\pgap}[1]{\uline{\psolution{#1}}} \fi \newtoggle{betable} \newcommand{\beTabelle}[1][3cm]{% \toggletrue{betable} \iftoggle{lehrerversion}{}{ \centering \begin{tikzpicture}[cell/.style={draw, minimum height=1cm, minimum width=#1}] \node [cell] at (1,0) {Aufgabe}; \node [cell] at (1,-1) {BEs}; \node [cell] at (1,-2) {$\sum$\hspace{#1*2/3}~}; \foreach \x [count=\xi] in {1,...,\theAufg}{% \node [cell] at ([shift={(1,0)}]\xi*#1,0) {\xi}; \node [cell] at ([shift={(1,-1)}]\xi*#1,0) {\ref{a:\xi}}; \node [cell] at ([shift={(1,-2)}]\xi*#1,0) {}; } \end{tikzpicture} } } % Point distribution across subtasks \newcommand{\Verteilung}{} \newcounter{Aufg} \newenvironment{Aufg}[1][] { \refstepcounter{Aufg}% \noindent\textbf{Aufgabe \theAufg\ifstrempty{#1}{}{\ #1}:% \ifdefempty{\Verteilung}{}{\ \Verteilung{} BE} \hfill \iftoggle{vaguebe}{ca. }{/}\ref{a:\theAufg} \ BE}% \newline }{% \ifdefempty{\Verteilung}% {\setcounter{distSum}{-1}}% {\setcounter{distSum}{\fpeval{\Verteilung}}}% \renewcommand{\Verteilung}{}% reset the distribution after each exercise \global\let\Verteilung\Verteilung% } % Total amount of point * 2 in order to track half points in an integer counter \newcounter{be} % Total amount of points in the document \newcounter{beA}[Aufg] % Amount of point in the current exercise \newcounter{beAManuell} % Counter to manually override the points in the current exercise \setcounter{beAManuell}{-1} \newcounter{distSum} % Counter to check the sum of the point distribution \setcounter{distSum}{-1} \newcommand{\BE}[1]{% \iftoggle{erwartungshorizont}{% Typeset the points only if we are creating a horizon of expectation #1 BE}{}% TODO: better typesetting \addtocounter{beA}{\fpeval{#1*2}}} \newcommand{\PointSymbol}{% \iftoggle{erwartungshorizont}{% Typeset the checkmark only if we are creating a horizon of expectation \tikz[scale=0.23, overlay, remember picture] { \draw[line width=0.7, line cap=round] (0.25, 1) to [bend left=10] (1,2); \draw[line width=0.8, line cap=round] (0, 1.35) to [bend right=1] (0.23,1); } }{} } \newcommand{\Point}{% \PointSymbol \addtocounter{beA}{2} } \newcommand{\HalfpointSymbol}{% \iftoggle{erwartungshorizont}{% Typeset the checkmark only if we are creating a horizon of expectation \tikz[scale=0.23, overlay, remember picture] { \draw[line width=0.7, line cap=round] (0.25, 1) to [bend left=10] (1,2); \draw[line width=0.7, line cap=round] (0.5, 1.75) to (0.75,1.25); \draw[line width=0.8, line cap=round] (0, 1.35) to [bend right=1] (0.23,1); } }{} } \newcommand{\Halfpoint}{% \HalfpointSymbol \addtocounter{beA}{1} } \newcommand{\AnzahlInsgesamtPunkte}{\fpeval{\value{be} / 2}} % Manually override the points \newcommand{\AnzahlPunkte}[1]{\setcounter{beAManuell}{\fpeval{#1*2}}} \newenvironment{Lsg}[1][] {% \iftoggle{lehrerversion}{% \noindent\textbf{Lösung:}\ \iftoggle{erwartungshorizont}{#1 \\}{} }{% \begin{adjustbox}{max height=0cm, minipage=[0pt]{\textwidth},frame,phantom} }% }% {%end_def \iftoggle{lehrerversion}{}{\end{adjustbox}\vspace{-0.5\baselineskip}} % Overwrite the beA counter \ifnumcomp{\arabic{beAManuell}}{>}{-1}% {\setcounter{beA}{\value{beAManuell}}}% {} \setcounter{beAManuell}{-1} % Sum up all points \addtocounter{be}{\value{beA}} % Persist the current exercise count \setcounter{beA}{\fpeval{\value{beA} / 2}}% \addtocounter{beA}{-1}% decrement beA count because refstepcounter will increment it \refstepcounter{beA}% make the beA available for the ref and label mechanisms \expandafter\label{a:\theAufg}% create a label for this exercise \ifnumgreater{\thedistSum}{-1}{% \ifnumequal{\thedistSum}{\thebeA}{}{% \errmessage{Aufg \theAufg: \noexpand\Verteilung (\thedistSum) and point count (\thebeA) are not equal}% }%ifnumequal }{}%ifnumfreater } \newtheoremstyle{Bearbeitung}% name of the style to be used {0pt}% measure of space to leave above the theorem. E.g.: 3pt {25pt}% measure of space to leave below the theorem. E.g.: 3pt {}% name of font to use in the body of the theorem {}% measure of space to indent {}% name of head font {}% punctuation between head and body { }% space after theorem head; " " = normal interword space {\thmname{#1}} \theoremstyle{Bearbeitung} \newtheorem{Bearbeitung}{} \newcommand{\Lehrerversion}{\excludecomment{Bearbeitung}} \newcommand{\Schuelerversion}{\togglefalse{lehrerversion}} \iftoggle{lehrerversion}{ \Lehrerversion }{ } % Add new paired delimiter 'abs' using mathtools \DeclarePairedDelimiter\abs{\lvert}{\rvert}% \newcommand{\dist}[1]{\abs{\overline{#1}}} % Commands to determine the remaining hsize of a line % See: https://tex.stackexchange.com/questions/17349/is-there-a-way-to-measure-the-remaining-space-of-a-line-of-text \newcommand{\currentsidemargin}{% \ifodd\value{page}% \oddsidemargin% \else% \evensidemargin% \fi% } \newlength{\whatsleft} \newcommand{\measureremainder}[1]{% \begin{tikzpicture}[overlay,remember picture] % Helper nodes \path (current page.north west) ++(\hoffset, -\voffset) node[anchor=north west, shape=rectangle, inner sep=0, minimum width=\paperwidth, minimum height=\paperheight] (pagearea) {}; \path (pagearea.north west) ++(1in+\currentsidemargin,-1in-\topmargin-\headheight-\headsep) node[anchor=north west, shape=rectangle, inner sep=0, minimum width=\textwidth, minimum height=\textheight] (textarea) {}; % Measure distance to right text border \path let \p0 = (0,0), \p1 = (textarea.east) in [/utils/exec={\pgfmathsetlength#1{\x1-\x0}\global#1=#1}]; \end{tikzpicture}% } \newcommand{\ruletoend}[1]{\measureremainder{\whatsleft}\rule{\whatsleft}{#1}} \newtcolorbox{defbox}[1]{breakable, enhanced, colback=orange!5!white,colframe=orange!75!black,title=#1} \newtcolorbox{merke}{ coltitle=white, colbacktitle=orange!80!black, colback=white,% TODO: support bg from beamer theme colframe=orange!80!black, enhanced, title=\bfseries {\large M}ERKE, attach boxed title to top right={yshift=-0.28cm, xshift=-5mm}, frame code={ \draw[ decorate, decoration={random steps, segment length=5mm, amplitude=0.6pt}, draw=orange!80!black, ] (frame.north east) rectangle (frame.south west); }, } \newtcolorbox{pseudocode}{ coltitle=white, colbacktitle=gray!30!black, colback=white,% TODO: support bg from beamer theme colframe=gray!30!black, enhanced, title=\bfseries {\large P}SEUDOCODE, attach boxed title to top right={yshift=-0.28cm, xshift=-5mm}, frame code={ \draw[ decorate, decoration={random steps, segment length=5mm, amplitude=0.6pt}, draw=gray!30!black, ] (frame.north east) rectangle (frame.south west); }, } \newcommand{\boldred}[1]{\textcolor{red}{\textbf{#1}}} \newcommand{\boldgreen}[1]{\textcolor{green!70!black}{\textbf{#1}}}