improve punkte command to automatically create correct number of exercises

This commit is contained in:
2020-04-25 15:12:06 +02:00
parent f193152820
commit 5a1385f05b
3 changed files with 23 additions and 10 deletions
+22 -4
View File
@@ -20,6 +20,8 @@
\RequirePackage[nobottomtitles]{titlesec}
\RequirePackage{listings}
\RequirePackage{mathtools}
\RequirePackage{forloop}
\RequirePackage{totcount}
\usetikzlibrary{quotes, angles}
@@ -54,6 +56,9 @@
\newtheorem{bem}[satz]{Bemerkung}
\newtheorem{aufgabe}{Aufgabe}
% enable aufgaben counting
\regtotcounter{aufgabe}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
@@ -76,11 +81,24 @@
}
% punkte tabelle
\newcommand\punkte{
\begin{tabular}{|c|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|@{}m{0cm}@{}}
\newcommand{\punkte}{
\@punkten{\totvalue{aufgabe}}
}
\def\@punkten#1{
\newcounter{n}
\begin{tabular}{|c|*{#1}{m{1cm}|}m{1cm}|@{}m{0cm}@{}}
\hline
Aufgabe & \centering A1 & \centering A2 & \centering A3 & \centering A4 & \centering $\sum$ & \\[5mm] \hline
Punkte & & & & & & \\[5mm] \hline
Aufgabe
\forloop{n}{1}{\not{\value{n} > #1}}{
& \centering A\then
}
& \centering $\sum$ & \\[5mm] \hline
Punkte
\forloop{n}{1}{\not{\value{n} > #1}}{
&
}
& & \\[5mm] \hline
\end{tabular}
}
Binary file not shown.
+1 -6
View File
@@ -2,12 +2,7 @@
\begin{document}
% punkte tabelle
\begin{tabular}{|c|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|@{}m{0cm}@{}}
\hline
Aufgabe & \centering A1 & \centering A2 & \centering A3 & \centering A4 & \centering A5 & \centering $\sum$ & \\[5mm] \hline
Punkte & & & & & & & \\[5mm] \hline
\end{tabular}
\punkte
\title{Analysis II: Übungsblatt 1}
\author{Leon Burgard, Christian Merten}