diff --git a/protokoll/fsrprotokoll.cls b/protokoll/fsrprotokoll.cls index 51e9c01..9c2fe01 100644 --- a/protokoll/fsrprotokoll.cls +++ b/protokoll/fsrprotokoll.cls @@ -1,5 +1,5 @@ % vim: ft=tex -\ProvidesClass{fsrprotokoll}[2018/03/05 Klasse fuer FSR Protokolle v0.2] +\ProvidesClass{fsrprotokoll}[2018/03/05 Klasse fuer FSR Protokolle v0.2.1] \LoadClass{scrartcl} \RequirePackage[utf8]{inputenc} @@ -138,8 +138,13 @@ \immediate\write\exportdata{-} \begin{lrbox}{\mybox}\begin{minipage}{.985\textwidth} \newcommand*{\voteNumber}[1]{% - \immediate\write\exportdata{ decision_id: "\the\year/##1"}% - \textbf{\the\year\,/\,##1:}\\% + %see section VOTENUMBER at the end + \ifthenelse{\equal{##1}{}}{}{% else (argument is not empty) + \setcounter{votenumber}{##1}% + }% + \immediate\write\exportdata{ decision_id: "\the\year/\thevotenumber"}% + \textbf{\the\year\,/\,\thevotenumber:}\\% + \stepcounter{votenumber}% }% \newcommand*{\voteMoney}[1]{% \ifthenelse{\equal{##1}{}} {% @@ -198,8 +203,13 @@ \immediate\write\exportdata{-} \begin{lrbox}{\mybox}\begin{minipage}{.985\textwidth} \newcommand*{\voteNumber}[1]{% - \immediate\write\exportdata{ decision_id: "\the\year/##1"}% - \textbf{\the\year\,/\,##1:}\\% + %see section VOTENUMBER at the end + \ifthenelse{\equal{##1}{}}{}{% else (argument is not empty) + \setcounter{votenumber}{##1}% + }% + \immediate\write\exportdata{ decision_id: "\the\year/\thevotenumber"}% + \textbf{\the\year\,/\,\thevotenumber:}\\% + \stepcounter{votenumber}% }% \newcommand*{\voteMoney}[1]{% \ifthenelse{\equal{##1}{}} {% @@ -292,7 +302,14 @@ \noindent\makebox[6.5cm][l]{Sitzungsleitung} \hfill \noindent\makebox[6.5cm][l]{Protokoll} } +%see section VOTENUMBER at the end +\newcommand*{\initVoteNumber}[1] { + \setcounter{votenumber}{#1} +} + \AtBeginDocument{% + %see section VOTENUMBER at the end + \newcounter{votenumber} \immediate\newwrite\exportdata% \immediate\openout\exportdata=tmp.txt\relax } @@ -317,3 +334,12 @@ \newtoks\guests \endinput +%documentation on VOTENUMBERS (version 0.2 -> 0.2.1, Author: Anton Obersteiner) +%votes are numbered within one year. use \initVoteCount{num} at the beginning +%of your protocol to set this counter to num, otherwise the counter starts at 0. +%each vote is automatically numbered 20YY / and then +%increments the counter *if you call \voteNumber{} in your vote environment*. +%if you call votenumber with an argument: \voteNumber{num}, the counter is reset to that value +%and increments from there in the votes after. +%for backwards compatibility, the argument is not optional (would require \voteNumber[] syntax), +%but the argument to the {} is ignored if empty.