-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsticky_minutes.cls
290 lines (261 loc) · 9.08 KB
/
sticky_minutes.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
% ---------------------------------------------------------------------------------
% sticky_minutes.cls
% LaTeX template for minutes for Study Association Sticky.
%
% (C) 2015 Laurens Duijvesteijn <[email protected]>
%
% MIT licensed.
%
% ---------------------------------------------------------------------------------
%
% Identification
%
% The next lines give this class its name, a version and the date of last
% modification. It also restricts the input format to LaTex2e.
%
\ProvidesClass{sticky_minutes}[2016/05/25 version 0.0.10]
\NeedsTeXFormat{LaTeX2e}
%
% Typography and options
%
% This class depends on the typographical configuration as defined in the style
% `sticky_typography.cls`.
%
% The next line reads the options given to the class. If a file is named
% `<option>.members` is found, this file is loaded. This is intended for use as
% `<committee_name>.members` to save the members of a certain committee for reuse.
%
% After reading in the options, they are processed and the article class is loaded.
% `\relax` is a no-op command, which is used in place where LaTeX expects a macro,
% but none is required.
%
\DeclareOption*{\InputIfFileExists{\CurrentOption.leden}{}{%
\PassOptionsToClass{\CurrentOption}{sticky_typography}}}
\ProcessOptions \relax
\LoadClass{sticky_typography}
\RequirePackage{xspace}
%
% Internationalization
%
% In this section of the class, translations of the above strings are defined.
%
\RequirePackage{translations}
\DeclareTranslationFallback{str-head}
{\vars@committee\xspace, minutes: \vars@date\xspace}
\DeclareTranslation{Dutch}{str-head}
{Notulen \vars@committee\xspace: \vars@date\xspace}
\DeclareTranslationFallback{str-members}
{Members\xspace}
\DeclareTranslation{Dutch}{str-members}
{Leden\xspace}
\DeclareTranslationFallback{str-absent}
{Absent\xspace}
\DeclareTranslation{Dutch}{str-absent}
{Afwezig\xspace}
\DeclareTranslationFallback{str-guests}
{Guests\xspace}
\DeclareTranslation{Dutch}{str-guests}
{Gasten\xspace}
\DeclareTranslationFallback{str-notetaker}
{Minutes taker\xspace}
\DeclareTranslation{Dutch}{str-notetaker}
{Notulist\xspace}
\DeclareTranslationFallback{str-chair}
{Chairperson\xspace}
\DeclareTranslation{Dutch}{str-voorzitter}
{Voorzitter\xspace}
\DeclareTranslationFallback{str-action}
{Action\xspace}
\DeclareTranslation{Dutch}{str-action}
{AP\xspace}
\DeclareTranslationFallback{str-actionlist}
{Action items\xspace}
\DeclareTranslation{Dutch}{str-actionlist}
{Overzicht actiepunten\xspace}
%
% DeclareAuthorVariable interface
%
% Here an abstraction is defined for the declaration of author variables. This
% consists of the following commands:
%
% \DeclareAuthorVariable*{} - define a mandatory author variable.
% \DeclareAuthorVariable{} - define an optional author variable.
%
% Credits:
%
% tex.stackexchange.com user "egreg", https://tex.stackexchange.com/users/4427/egreg
% from answer http://tex.stackexchange.com/a/93912
%
% Content is originally from him/her and licensed under CC-BY-SA 3.0 until noted.
%% This branches between the normal and starred command.
\newcommand{\DeclareAuthorVariable}{%
\@ifstar{\vars@DeclareAuthorVariable{\vars@mandatory@var}}
{\vars@DeclareAuthorVariable{\vars@optional@var}}%
}
%% The main command; the internal version of \foo is \vars@foo. The macro \vars@foo
%% is initialized to give an error or an info message when used, so if the user
%% doesn't provide a value for a mandatory variable, we'll catch the issue.
\newcommand{\vars@DeclareAuthorVariable}[2]{%
\@namedef{vars@#2}{#1{#2}}%
\@namedef{#2}##1{\@namedef{vars@#2}{##1}}%
}
%% The error and info messages
\newcommand{\vars@mandatory@var}[1]{%
\ClassError{vars}
{Missing value for mandatory variable
\expandafter\string\csname#1\endcsname}
{You have to provide a value with
\expandafter\string\csname#1\endcsname{...}}%
}
\newcommand{\vars@optional@var}[1]{%
\ClassInfo{vars}
{Missing value for optional variable
\expandafter\string\csname#1\endcsname}%
}
% End of CC-BY-SA 3.0 unported code
%
% AuthorVariable declarations
%
% This class exposes the following variables to authors for use in the template.
%
% \committee{} - The name of the committee
% \members{} - The members of the committee
% \date{} - Date of the meeting
% \absent{} - Absentees
% \guests{} - Guests
% \notetaker{} - The notetaker of the minutes
%
\DeclareAuthorVariable*{committee}
\DeclareAuthorVariable*{members}
\DeclareAuthorVariable*{date}
\DeclareAuthorVariable*{absent}
\DeclareAuthorVariable*{guests}
\DeclareAuthorVariable*{notetaker}
\DeclareAuthorVariable*{chair}
%
% Page headers/footers
%
% Here the actual formatting of the document is defined. The standard header and
% footer are removed from the first page, and the next pages get standard ones.
%
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\fancypagestyle{pagestyle}{%
\fancyhf{} % clear all six fields
\fancyhead[L]{\carlito \textbf{\vars@committee{}} - \vars@date}
\fancyhead[R]{\carlito \thepage{} / \pageref{LastPage}}
\renewcommand{\headrulewidth}{0.7pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{pagestyle}
%
% Minutes metadata
%
% `\metadata` prints a description list with the members of the committee, which
% ones are absent, the guests and the minutestaker
% by itself.
%
\newcommand{\metadata}{%
\begin{description}
\item[\GetTranslation{str-members}:] \vars@members
\item[\GetTranslation{str-absent}:] \vars@absent
\item[\GetTranslation{str-guests}:] \vars@guests
\item[\GetTranslation{str-chair}:] \vars@chair
\item[\GetTranslation{str-notetaker}:] \vars@notetaker
\end{description}
}
%
% Minute header
%
% The header of the minutes consists of the name of the committee that was in
% assembly and the date. It also prints some horizontal rules and the previously
% defined metadata.
%
\newcommand{\header}{%
\begin{center}
{\Large \GetTranslation{str-head}}
\end{center}
\noindent\rule{\textwidth}{0.3pt}
\metadata
\noindent\rule{\textwidth}{0.7pt}
}
%
% Action lists
%
% Here, action items and lists get defined. When defining an action item use
% `\action{name}{due}{item}` or the Dutch alias `\ap{naam}{deadline}{taak}`.
%
% These will show up in the document and will get sorted per person with the
% `\actionlist` command or it's Dutch alias `\aplijst`.
%
% Credits:
%
% tex.stackexchange.com user "Werner", https://tex.stackexchange.com/users/5764/werner
% from answer http://tex.stackexchange.com/a/228548
%
% Content is originally from him/her and licensed under CC-BY-SA 3.0 until noted.
%
\RequirePackage{multido}
\newcounter{personcntr}% Keep track of number of persons
\makeatletter
\newcommand{\action}[3]{% \action{<name>}{<time>}{<duty>}
\@ifundefined{person@#1}{% If person doesn't exist
\stepcounter{personcntr}% Next person
\expandafter\xdef\csname person@#1\endcsname{1}% One time/duty
\expandafter\xdef\csname person@bynumber@\thepersoncntr\endcsname{#1}% Number person
}{% Person already exists
\expandafter\xdef\csname person@#1\endcsname{%
\number\numexpr\csname person@#1\endcsname+1}% Step number of time/duty
}%
\expandafter\xdef\csname person@#1@\csname person@#1\endcsname @time\endcsname{#2}% Store time
\expandafter\xdef\csname person@#1@\csname person@#1\endcsname @duty\endcsname{#3}% Store duty
\ignorespaces%
\noindent\textbf{\GetTranslation{str-action} #1:} #3 \hfill \textit{#2}
}
\gdef\newpar{\par}% \multido doesn't enjoy \par
\newcommand\actionlist{% Print actions
\def\descriptionBODY{}% Empty descriptionBODY
{\let\item\relax% Prevent expansion of \item
\let\newpar\relax% Prevent expansion of \newpar
\multido{\iPerson=1+1}{\value{personcntr}}{% Step through all persons
% Extract person name
\expandafter\xdef\expandafter\thisperson\expandafter{\csname person@bynumber@\iPerson\endcsname}%
\protected@xdef\descriptionBODY{%
\descriptionBODY%
\item[\thisperson] \leavevmode\newpar}% Add person name to descriptionBODY
% Extract person number
\expandafter\xdef\expandafter\thispersonnum\expandafter{\csname person@\thisperson\endcsname}%
\multido{\iDuty=1+1}{\thispersonnum}{%
\protected@xdef\descriptionBODY{%
\descriptionBODY%
\csname person@\thisperson @\iDuty @duty\endcsname% Add person duty to descriptionBODY
\hfill
{\bfseries\csname person@\thisperson @\iDuty @time\endcsname}% Add person time to descriptionBODY
\newpar
}%
}%
}%
}%
% Print person time/duty
\section{\GetTranslation{str-actionlist}}% Give the list a title
\begin{description}
\descriptionBODY
\end{description}
}
\makeatother
% End of CC-BY-SA 3.0 code
%
% Dutch aliases
%
\let\commissie\committee
\let\orgaan\committee
\let\leden\members
\let\afwezig\absent
\let\datum\date
\let\gasten\guests
\let\notulist\notetaker
\let\voorzitter\chair
\let\hoofd\header
\let\ap\action
\let\actiepunten\actionlist
% vim: ft=tex