From 387806ac7aeab94e97b8af767397c048b6fb0819 Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Fri, 3 Feb 2023 12:27:27 +0100 Subject: [PATCH] add automatic vote numbering, therefore v0.2.1 \newcounter{votenumber} \initVoteNumber for the first lines of the protocol automatic increment in every vote and vote-two-thirds environment some documentation at the end and references to that Protokoll-Vorlage entsprechend angepasst und erweitert --- protokoll/fsrprotokoll.cls | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) 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.