diff options
Diffstat (limited to 'latex/common.tex')
| -rw-r--r-- | latex/common.tex | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/latex/common.tex b/latex/common.tex index 2d2efbea..5cdc2985 100644 --- a/latex/common.tex +++ b/latex/common.tex @@ -33,23 +33,54 @@ {}% name of head font {}% punctuation between head and body {\newline }% space after theorem head; " " = normal interword space -{\textbf{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}\ifdefined\Verteilung{}: \ \Verteilung \hfill {/}\AnzahlPunkte \ BE\fi}} +{\textbf{\thmname{#1} \thmnumber{#2}\thmnote{ (#3)}\ifdefined\Verteilung{}: \ \Verteilung \hfill {/}\ref{a:\thmnumber{#2}} \ BE\fi}} \theoremstyle{Aufg} \newtheorem{Aufg}{Aufgabe} -\newtheoremstyle{Lsg}% name of the style to be used -{2pt}% measure of space to leave above the theorem. E.g.: 3pt -{}% 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 -{\newline }% space after theorem head; " " = normal interword space -{\textbf{\thmname{#1}\thmnote{ (#3)}:}} +% 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} + +\newcommand{\BE}[1]{% +\iftoggle{erwartungshorizont}{% Typeset the points only if we are creating a horzon of expectation +#1 BE}{}% TODO: better typesetting +\addtocounter{beA}{\fpeval{#1*2}}} + +\newcommand{\AnzahlInsgesamtPunkte}{\fpeval{\value{be} / 2}} -\theoremstyle{Lsg} -\newtheorem{Lsg}{Lösung} +% Point distribution across subtasks +\newcommand{\Verteilung}{} + +% Manually override the points +\newcommand{\AnzahlPunkte}[1]{\setcounter{beAManuell}{\fpeval{#1*2}}} + + +\newenvironment{Lsg} +{ +\iftoggle{lehrerversion}{ +\noindent\textbf{Lösung:}\newline +}{ +\begin{adjustbox}{max height=0cm, minipage=[0pt]{\textwidth},frame,phantom} +} +} +{%end_def +\iftoggle{lehrerversion}{}{\end{adjustbox}\vspace{-\baselineskip}} +% Overwrite the beA counter +\ifthenelse{\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 refstepcount 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 +} \newtheoremstyle{Bearbeitung}% name of the style to be used {0pt}% measure of space to leave above the theorem. E.g.: 3pt @@ -65,12 +96,10 @@ \newtheorem{Bearbeitung}{} \newcommand{\Lehrerversion}{\excludecomment{Bearbeitung}} -\newcommand{\Schuelerversion}{\excludecomment{Lsg}} \iftoggle{lehrerversion}{ \Lehrerversion }{ - \Schuelerversion } % Add new paired delimiter 'abs' using mathtools |
