-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsemesterplanner.sty
335 lines (287 loc) · 10 KB
/
semesterplanner.sty
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
% (c) Niklas Schneider
%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{semesterplanner} [2011/01/11v1.0]
% Required Packages.
\RequirePackage{fontawesome}
\RequirePackage{color}
\RequirePackage{schedule_translated}
\RequirePackage{tikz}
\usepackage{ifthen}
\usepackage{translations}
\usepackage[utf8]{inputenc}
\usetikzlibrary{shapes}
% Command to encircle the fa-icons with white, so that they are recognizable on colored ground.
\newcommand*{\encircle}[1]{
\begin{minipage}[b][1em][c]{1.5em}
\begin{tikzpicture}
\node[fill,circle,inner sep=1pt, color = white] {#1};
\end{tikzpicture}
\end{minipage}
}
%%%%% LOCALIZATION
%%%%% Fallback: English
\DeclareTranslationFallback{Timetable}{Stundenplan}
\DeclareTranslationFallback{Appointments}{Termine}
\DeclareTranslationFallback{Deadlines}{Fristen}
\DeclareTranslationFallback{Exams}{Prüfungen}
\DeclareTranslationFallback{Date}{Datum}
\DeclareTranslationFallback{Time}{Zeit}
\DeclareTranslationFallback{Course}{Kurs}
\DeclareTranslationFallback{Description}{Beschreibung}
\DeclareTranslationFallback{Room}{Raum}
\DeclareTranslationFallback{Prio.}{Prio.}
\DeclareTranslationFallback{Type}{Typ}
%%%%% English
\DeclareTranslation{English}{Timetable}{Timetable}
\DeclareTranslation{English}{Appointments}{Appointments}
\DeclareTranslation{English}{Deadlines}{Deadlines}
\DeclareTranslation{English}{Exams}{Exams}
\DeclareTranslation{English}{Date}{Date}
\DeclareTranslation{English}{Time}{Time}
\DeclareTranslation{English}{Course}{Course}
\DeclareTranslation{English}{Description}{Description}
\DeclareTranslation{English}{Room}{Room}
\DeclareTranslation{English}{Prio.}{Prio.}
\DeclareTranslation{English}{Type}{Type}
%%%%% German
\DeclareTranslation{German}{Timetable}{Stundenplan}
\DeclareTranslation{German}{Appointments}{Termine}
\DeclareTranslation{German}{Deadlines}{Fristen}
\DeclareTranslation{German}{Exams}{Prüfungen}
\DeclareTranslation{German}{Date}{Datum}
\DeclareTranslation{German}{Time}{Zeit}
\DeclareTranslation{German}{Course}{Kurs}
\DeclareTranslation{German}{Description}{Beschreibung}
\DeclareTranslation{German}{Room}{Raum}
\DeclareTranslation{German}{Prio.}{Prio.}
\DeclareTranslation{German}{Type}{Typ}
%%%%% French
\DeclareTranslation{French}{Timetable}{L'horaire}
\DeclareTranslation{French}{Appointments}{Le clendrier}
\DeclareTranslation{French}{Deadlines}{Les d\'elais}
\DeclareTranslation{French}{Exams}{}
\DeclareTranslation{French}{Date}{Date}
\DeclareTranslation{French}{Time}{Temps}
\DeclareTranslation{French}{Course}{Cours}
\DeclareTranslation{French}{Description}{Description}
\DeclareTranslation{French}{Room}{Place}
\DeclareTranslation{French}{Prio.}{Prio.}
\DeclareTranslation{French}{Type}{Format}
%%%%% Japanese
\DeclareTranslation{Japanese}{Timetable}{時間割}
\DeclareTranslation{Japanese}{Appointments}{予定表}
\DeclareTranslation{Japanese}{Deadlines}{締切}
\DeclareTranslation{Japanese}{Exams}{試験}
\DeclareTranslation{Japanese}{Date}{日付}
\DeclareTranslation{Japanese}{Time}{時間}
\DeclareTranslation{Japanese}{Course}{課程}
\DeclareTranslation{Japanese}{Description}{内容}
\DeclareTranslation{Japanese}{Room}{教室}
\DeclareTranslation{Japanese}{Prio.}{優先度}
\DeclareTranslation{Japanese}{Type}{形式}
%%%%% Spanish
\DeclareTranslation{Spanish}{Timetable}{Horario}
\DeclareTranslation{Spanish}{Appointments}{Citas}
\DeclareTranslation{Spanish}{Deadlines}{Fechas l\'\i mite}
\DeclareTranslation{Spanish}{Exams}{Ex\'amenes}
\DeclareTranslation{Spanish}{Date}{Fecha}
\DeclareTranslation{Spanish}{Time}{Hora}
\DeclareTranslation{Spanish}{Course}{Curso}
\DeclareTranslation{Spanish}{Description}{Descripci\'on}
\DeclareTranslation{Spanish}{Room}{Aula}
\DeclareTranslation{Spanish}{Prio.}{Prior.}
\DeclareTranslation{Spanish}{Type}{Tipo}
%%%%% CHECKBOXES
% Creates a clickable checkbox with unique index, so that it is independent of all other checkboxes
% (important for some pdf viewers).
\newcommand{\plaincheckbox}[1]{
$ $\begin{Form}[action={}]\CheckBox[width=0.4cm,height=0.3cm,name=#1]{}\end{Form}$\!$
}
\newcommand{\printcheckboxcmd}{print}
\newcommand{\clickcheckboxcmd}{click}
\newcounter{checkboxcounter}
\newcommand{\printcheckbox}{\faSquareO}
\newcommand{\clickcheckbox}{\plaincheckbox{\arabic{checkboxcounter}} \stepcounter{checkboxcounter}}
\newcommand{\currentcheckbox}{none}
% Creates a checkbox according to the given type.
\newcommand{\checkbox}[1]{
% Check whether the user wants a printable checkbox.
\ifthenelse{
\equal{#1}{\printcheckboxcmd}
}
{
% If so, set one.
\printcheckbox
}
{
% If not, check whether they want a clickable checkbox.
\ifthenelse{
\equal{#1}{\clickcheckboxcmd}
}
{
\clickcheckbox
}
{
% If none is selected, do nothing
}
}
}
%%%%% CALENDAR
% Color for the platform symbols.
\definecolor{dodgerblue}{rgb}{0.12, 0.56, 1.0}
% Colors for the course types.
\definecolor{seminar}{rgb}{1.0, 0.8, 0.0}
\definecolor{lecture}{rgb}{0.2, 0.7, 1.0}
\definecolor{tutorial}{rgb}{0.0, 0.8, 0.0}
\definecolor{meeting}{rgb}{0.8, 0.0, 0.0}
\definecolor{officehour}{rgb}{0.0, 0.4, 0.6}
% The different course types.
\NewAppointment{emeeting}{meeting}{white}
\NewAppointment{electure}{lecture}{white}
\NewAppointment{etutorial}{tutorial}{white}
\NewAppointment{eseminar}{seminar}{white}
\NewAppointment{eofficehour}{officehour}{white}
% Commands to create a new entry in the timetable using the aboev types.
\newcommand{\lecture}[6]{\electure{\textbf{#1}}{
\vspace*{-2.5em}
\begin{flushleft}
{#2}\\\vspace*{0.75em}{#6}{#3}
\end{flushleft}}
{#4}{#5}}
\newcommand{\tutorial}[6]{\etutorial{\textbf{#1}}{
\vspace*{-2.5em}
\begin{flushleft}
{#2}\\\vspace*{0.75em}{#6}{#3}
\end{flushleft}}
{#4}{#5}}
\newcommand{\meeting}[6]{\emeeting{\textbf{#1}}{
\vspace*{-2.5em}
\begin{flushleft}
{#2}\\\vspace*{0.75em}{#6}{#3}
\end{flushleft}}
{#4}{#5}}
\newcommand{\seminar}[6]{\eseminar{\textbf{#1}}{
\vspace*{-2.5em}
\begin{flushleft}
{#2}\\\vspace*{0.75em}{#6}{#3}
\end{flushleft}}
{#4}{#5}}
\newcommand{\officehour}[6]{\eofficehour{\textbf{#1}}{
\vspace*{-2.5em}
\begin{flushleft}
{#2}\\\vspace*{0.75em}{#6}{#3}
\end{flushleft}}
{#4}{#5}}
% Commands for entries in the three environments. They are a line of a table.
\newcommand{\appointment}[6]{\checkbox{\currentcheckbox}&\textit{#1}&{#2}&{#3}&{#4}&{#5}&{#6}\\}
\newcommand{\exam}[4]{\checkbox{\currentcheckbox}&\textit{#1}&{#2}&{#3}&{#4}\\}
\newcommand{\deadline}[4]{\checkbox{\currentcheckbox}&\textit{#1}&{#2}&{#3}&{#4}\\}
% Commands for symbols of priority
\newcommand{\pmandatory}{\encircle{\textcolor{red}{\faWarning}}}
\newcommand{\phigh}{\encircle{\textcolor{red}{\faFlag}}}
\newcommand{\pmid}{\encircle{\textcolor{yellow}{\faFlag}}}
\newcommand{\plow}{\encircle{\textcolor{green}{\faFlag}}}
\newcommand{\pnone}{\encircle{\textcolor{gray}{\faTimesCircle}}}
% Commands for exam types.
\newcommand{\oral}{\faComment}
\newcommand{\written}{\faPencil}
% Commands for online platforms.
\newcommand{\teams}{\encircle{\textcolor{dodgerblue}{\faWindows}}}
\newcommand{\zoom}{\encircle{\textcolor{dodgerblue}{\faCamera}}}
\newcommand{\youtube}{\encircle{\textcolor{red}{\faYoutubePlay}}}
% Command for "To be determined" and "To be Announced"
\newcommand{\tbd}{\faQuestion}
\newcommand{\tba}{\faBullhorn}
% Command for adding legends to timetable
\newcommand{\ttlegend}[2]{{\footnotesize\textcolor{#1}{\faSquare}}&{\footnotesize {#2}}\\}
% Environment for the timetable using schedule. Configuration is hardcoded.
\newenvironment{timetable}
{
\section*{\faClockO~\GetTranslation{Timetable}}
\vspace*{-2em}
\CellHeight{1.3cm}
\CellWidth{1in}
\TimeRange{08:00-18:00}
\SubUnits{60}
\BeginOn{Monday}
\TextSize{\tiny}
\FiveDay
\TwentyFourHour
\begin{schedule}
}
{
\end{schedule}
\vspace*{-1em}
}
%%%%% ENVIRONMENTS
% Environment for appointment list. Use appointment command to add one.
% Argument is for caption of the "room" column.
\newenvironment{appointments}[2][Room]
{
\section*{\faCalendar~\GetTranslation{Appointments}}
\renewcommand{\currentcheckbox}{#2}
\ifthenelse{\equal{#2}{\printcheckboxcmd} \OR \equal{#2}{\clickcheckboxcmd}}
{
\begin{tabular}{cllllll}
\faCheckSquare&\textbf{\GetTranslation{Date}}&\textbf{\GetTranslation{Time}}&\textbf{\GetTranslation{Course}}&\textbf{\GetTranslation{Description}}&\textbf{#1}&\textbf{\GetTranslation{Prio.}}\\
}
{
\begin{tabular}{cllllll}
&\textbf{\GetTranslation{Date}}&\textbf{\GetTranslation{Time}}&\textbf{\GetTranslation{Course}}&\textbf{\GetTranslation{Description}}&\textbf{#1}&\textbf{\GetTranslation{Prio.}}\\
}
}
{
\end{tabular}
}
% Environment for deadline list. Use dealine command to add one.
\newenvironment{deadlines}[1]
{
\section*{\faBomb~\GetTranslation{Deadlines}}
\renewcommand{\currentcheckbox}{#1}
\ifthenelse{\equal{#1}{\printcheckboxcmd} \OR \equal{#1}{\clickcheckboxcmd}}
{
\begin{tabular}{cllll}
\faCheckSquare&\textbf{\GetTranslation{Date}}&\textbf{\GetTranslation{Course}}&\textbf{\GetTranslation{Description}}&\textbf{\GetTranslation{Prio.}}\\
}
{
\begin{tabular}{cllll}
&\textbf{{Date}}&\textbf{{Course}}&\textbf{{Description}}&\textbf{{Prio.}}\\
}
}
{
\end{tabular}
}
% Environment for exam list. Use exam command to add one.
\newenvironment{exams}[1]
{
\section*{\faStickyNoteO~\GetTranslation{Exams}}
\renewcommand{\currentcheckbox}{#1}
\ifthenelse{\equal{#1}{\printcheckboxcmd} \OR \equal{#1}{\clickcheckboxcmd}}
{
\begin{tabular}{cllll}
\faCheckSquare&\textbf{\GetTranslation{Date}}&\textbf{\GetTranslation{Time}}&\textbf{\GetTranslation{Course}}&\textbf{\GetTranslation{Type}}\\
}
{
\begin{tabular}{cllll}
&\textbf{\GetTranslation{Date}}&\textbf{\GetTranslation{Time}}&\textbf{\GetTranslation{Course}}&\textbf{\GetTranslation{Type}}\\
}
}
{
\end{tabular}
}
% Environment for timetable legend. Use \ttlabel command.
\newenvironment{legend}
{
\begin{center}
\begin{tabular}{ll}
}
{
\end{tabular}
\end{center}
}
\endinput
%%