diff options
| -rw-r--r-- | latex/common.tex | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/latex/common.tex b/latex/common.tex index f8786a2a..105902e5 100644 --- a/latex/common.tex +++ b/latex/common.tex @@ -8,16 +8,17 @@ \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} + \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} + \end{tikzpicture}% } +% Shortcut for \iftoggle{lehrerversion} \newcommand{\iflehrer}[2]{\iftoggle{lehrerversion}{#1}{#2}} % Expands to its argument if the lehrerversion toggle is set \newcommand{\ifschueler}[1]{\iftoggle{lehrerversion}{}{#1}} @@ -48,13 +49,14 @@ \node [cell] at ([shift={(1,-1)}]\xi*#1,0) {\ref{a:\xi}}; \node [cell] at ([shift={(1,-2)}]\xi*#1,0) {}; } - \end{tikzpicture} + \end{tikzpicture}% } } % Point distribution across subtasks \newcommand{\Verteilung}{} +% Input an exercise an specify its version \newcommand{\inputAufgVersion}[2]{% \setcounter{AufgVersion}{#1}% \input{#2}% @@ -69,11 +71,12 @@ \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% + \ifdefempty{\Verteilung}% + {\setcounter{distSum}{-1}}% + {\setcounter{distSum}{\fpeval{\Verteilung}}}% + \renewcommand{\Verteilung}{}% reset the distribution after each exercise + \global\let\Verteilung\Verteilung% + \setcounter{AufgVersion}{1}% Reset the exercise version } % Total amount of point * 2 in order to track half points in an integer counter @@ -100,8 +103,8 @@ } \newcommand{\Point}{% -\PointSymbol -\addtocounter{beA}{2} + \PointSymbol% + \addtocounter{beA}{2}% } \newcommand{\HalfpointSymbol}{% @@ -115,8 +118,8 @@ } \newcommand{\Halfpoint}{% -\HalfpointSymbol -\addtocounter{beA}{1} + \HalfpointSymbol% + \addtocounter{beA}{1}% } \newcommand{\AnzahlInsgesamtPunkte}{\fpeval{\value{be} / 2}} @@ -166,17 +169,18 @@ \theoremstyle{Bearbeitung} \newtheorem{Bearbeitung}{} +% Hide the space to solve the exercise \newcommand{\Lehrerversion}{\excludecomment{Bearbeitung}} +% Set the lehrerversion toggle to false \newcommand{\Schuelerversion}{\togglefalse{lehrerversion}} \iftoggle{lehrerversion}{ - \Lehrerversion -}{ -} + \Lehrerversion% +}{} % Add new paired delimiter 'abs' using mathtools \DeclarePairedDelimiter\abs{\lvert}{\rvert}% - +% Add new distance notation in mathmode \newcommand{\dist}[1]{\abs{\overline{#1}}} % Commands to determine the remaining hsize of a line |
