| 1 |
%% |
| 2 |
%% This is file `semesterplannerlua.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% semesterplannerlua.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Copyright (C) 2024 by Lukas Heindl <[email protected]> |
| 12 |
%% -------------------------------------------------------------------------- |
| 13 |
%% This work may be distributed and/or modified under the |
| 14 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 15 |
%% of this license or (at your option) any later version. |
| 16 |
%% The latest version of this license is in |
| 17 |
%% http://www.latex-project.org/lppl.txt |
| 18 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 19 |
%% version 2005/12/01 or later. |
| 20 |
%% |
| 21 |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 22 |
\ProvidesPackage{semesterplannerlua} |
| 23 |
[2024/05/19 v1.1.2 Semesterplanner package in lua with tikz only] |
| 24 |
|
| 25 |
\RequirePackage{tikz} |
| 26 |
\usetikzlibrary{calendar, positioning, shapes.misc, backgrounds} |
| 27 |
\RequirePackage{pgfkeys} |
| 28 |
\RequirePackage{xcolor} |
| 29 |
\RequirePackage{fontawesome} |
| 30 |
\RequirePackage{luapackageloader} % use the default lua path as well |
| 31 |
\definecolor{seminar}{rgb}{1.0, 0.8, 0.0} |
| 32 |
\definecolor{lecture}{rgb}{0.2, 0.7, 1.0} |
| 33 |
\definecolor{tutorial}{rgb}{0.0, 0.8, 0.0} |
| 34 |
\definecolor{meeting}{rgb}{0.8, 0.0, 0.0} |
| 35 |
\definecolor{laboratory}{rgb}{0.8, 0.0, 0.0} |
| 36 |
\definecolor{fieldstudy}{rgb}{0.8, 0.0, 0.0} |
| 37 |
\definecolor{officehour}{rgb}{0.0, 0.4, 0.6} |
| 38 |
\definecolor{DodgerBlue}{HTML}{1E90FF} |
| 39 |
\newcommand*{\semesterplannerLua@encircle}[1]{ |
| 40 |
\begin{minipage}[b][1em][c]{1.5em} |
| 41 |
\begin{tikzpicture} |
| 42 |
\node[fill,circle,inner sep=1pt, color = white] {#1}; |
| 43 |
\end{tikzpicture} |
| 44 |
\end{minipage} |
| 45 |
} |
| 46 |
\protected\def\oral{\faComment} |
| 47 |
\protected\def\written{\faPencil} |
| 48 |
\protected\def\pmandatory{\semesterplannerLua@encircle{\textcolor{red}{\faWarning}}} |
| 49 |
\protected\def\phigh{\semesterplannerLua@encircle{\textcolor{red}{\faFlag}}} |
| 50 |
\protected\def\pmid{\semesterplannerLua@encircle{\textcolor{yellow}{\faFlag}}} |
| 51 |
\protected\def\plow{\semesterplannerLua@encircle{\textcolor{green}{\faFlag}}} |
| 52 |
\protected\def\pnone{\semesterplannerLua@encircle{\textcolor{gray}{\faTimesCircle}}} |
| 53 |
|
| 54 |
\protected\def\teams{\semesterplannerLua@encircle{\textcolor{DodgerBlue}{\faWindows}}} |
| 55 |
\protected\def\zoom{\semesterplannerLua@encircle{\textcolor{DodgerBlue}{\faCamera}}} |
| 56 |
\protected\def\youtube{\semesterplannerLua@encircle{\textcolor{red}{\faYoutubePlay}}} |
| 57 |
\protected\def\BBB{\semesterplannerLua@encircle{\textcolor{DodgerBlue}{\faBold}}} |
| 58 |
|
| 59 |
\protected\def\tbd{\faQuestion} |
| 60 |
\protected\def\tba{\faBullhorn} |
| 61 |
|
| 62 |
\directlua{sp = require("semesterplannerLua_timetable.lua")} |
| 63 |
\directlua{cal = require("semesterplannerLua_calendar.lua")} |
| 64 |
\pgfkeys{ |
| 65 |
/semesterplannerLua/timetable/env/.cd, |
| 66 |
days/.initial={Mon,Tue,Wend,Thur,Fri}, days/.default={Mon,Tue,Wend,Thur,Fri}, |
| 67 |
dayse/.initial={M,T,W,Th,F}, dayse/.default={M,T,W,Th,F}, |
| 68 |
% |
| 69 |
start time/.initial=, start time/.default=, |
| 70 |
end time/.initial=, end time/.default=, |
| 71 |
% |
| 72 |
width/.initial=\textwidth, width/.default=\textwidth, |
| 73 |
length/.initial=10, length/.default=10, |
| 74 |
% |
| 75 |
/semesterplannerLua/timetable/event/.cd, |
| 76 |
% event arguments |
| 77 |
content/.initial=, content/.default=, |
| 78 |
% |
| 79 |
time/.initial=, time/.default=, |
| 80 |
day/.initial=, day/.default=, |
| 81 |
% |
| 82 |
tikz/.initial=, tikz/.default=, |
| 83 |
scale width/.initial=1, scale width/.default=1, |
| 84 |
offset/.initial=0, offset/.default=0, |
| 85 |
% |
| 86 |
textcolor/.initial=, textcolor/.default=, |
| 87 |
title/.initial=, title/.default=, |
| 88 |
speaker/.initial=, speaker/.default=, |
| 89 |
location/.initial=, location/.default=, |
| 90 |
password/.initial=, password/.default=, |
| 91 |
prio/.initial=, prio/.default=, |
| 92 |
type/.initial=, type/.default=, |
| 93 |
formatter/.initial=timetableformatter, formatter/.default=timetableformatter, |
| 94 |
% |
| 95 |
/semesterplannerLua/calendar/.cd, |
| 96 |
draw/.initial={true}, draw/.default={true}, |
| 97 |
room/.initial={}, room/.default={}, |
| 98 |
time/.initial={}, time/.default={}, |
| 99 |
prio/.initial={}, prio/.default={}, |
| 100 |
course/.initial={}, course/.default={}, |
| 101 |
desc/.initial={}, desc/.default={}, |
| 102 |
type/.initial={}, type/.default={}, |
| 103 |
date/.initial={}, date/.default={}, |
| 104 |
end/.initial={}, end/.default={}, |
| 105 |
tikz/.initial={}, tikz/.default={}, |
| 106 |
period/.initial={nil}, period/.default={nil}, |
| 107 |
shift/.initial={true}, shift/.default={true}, |
| 108 |
print/.initial={true}, print/.default={true}, |
| 109 |
} |
| 110 |
\tikzoption{day headings}{\tikzstyle{day heading}=[#1]} |
| 111 |
\tikzstyle{day heading}=[] |
| 112 |
\tikzstyle{day letter headings}=[ |
| 113 |
execute before day scope={ \ifdate{day of month=1}{% |
| 114 |
\pgfmathsetlength{\pgf@ya}{\tikz@lib@cal@yshift}% |
| 115 |
\pgfmathsetlength\pgf@xa{\tikz@lib@cal@xshift}% |
| 116 |
\pgftransformyshift{-\pgf@ya} |
| 117 |
\foreach \d/\l in {0/M,1/T,2/W,3/T,4/F,5/S,6/S} { |
| 118 |
\pgf@xa=\d\pgf@xa% |
| 119 |
\pgftransformxshift{\pgf@xa}% |
| 120 |
\pgftransformyshift{\pgf@ya}% |
| 121 |
\node[every day,day heading]{\l};% |
| 122 |
} |
| 123 |
}{}% |
| 124 |
}% |
| 125 |
] |
| 126 |
\newenvironment{timetable}[1][]{ |
| 127 |
\section*{\faClockO~Timetable} |
| 128 |
\pgfkeys{/semesterplannerLua/timetable/env/.cd,days,dayse,start time,end time,width,length,#1} |
| 129 |
\directlua{sp.init{ |
| 130 |
days=[[\pgfkeysvalueof{/semesterplannerLua/timetable/env/days}]], |
| 131 |
min=[[\pgfkeysvalueof{/semesterplannerLua/timetable/env/start time}]], |
| 132 |
max=[[\pgfkeysvalueof{/semesterplannerLua/timetable/env/end time}]], |
| 133 |
dayse=[[\pgfkeysvalueof{/semesterplannerLua/timetable/env/dayse}]]}} |
| 134 |
\newcommand{\semesterplannerLua@event}[1][]{ |
| 135 |
\pgfkeys{/semesterplannerLua/timetable/event/.cd,content,time,day,tikz,scale |
| 136 |
width,offset,textcolor,title,speaker,type,location,password,prio,formatter, ##1} |
| 137 |
\directlua{ |
| 138 |
sp.addEvent{ |
| 139 |
time="\pgfkeysvalueof{/semesterplannerLua/timetable/event/time}", |
| 140 |
day="\pgfkeysvalueof{/semesterplannerLua/timetable/event/day}", |
| 141 |
tikz=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/tikz}]], |
| 142 |
offset=\pgfkeysvalueof{/semesterplannerLua/timetable/event/offset}, |
| 143 |
scale_width=\pgfkeysvalueof{/semesterplannerLua/timetable/event/scale width}, |
| 144 |
formatter=\pgfkeysvalueof{/semesterplannerLua/timetable/event/formatter}, |
| 145 |
textcolor=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/textcolor}]], |
| 146 |
title=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/title}]], |
| 147 |
speaker=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/speaker}]], |
| 148 |
location=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/location}]], |
| 149 |
password=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/password}]], |
| 150 |
prio=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/prio}]], |
| 151 |
type=[[\pgfkeysvalueof{/semesterplannerLua/timetable/event/type}]], |
| 152 |
} |
| 153 |
} |
| 154 |
} |
| 155 |
\newcommand{\lecture}[1][]{ |
| 156 |
\semesterplannerLua@event[tikz={fill=lecture,}, textcolor=white, type=lect, ##1] |
| 157 |
\ignorespaces |
| 158 |
} |
| 159 |
\newcommand{\seminar}[1][]{ |
| 160 |
\semesterplannerLua@event[tikz={fill=seminar,}, textcolor=white, type=sem, ##1] |
| 161 |
\ignorespaces |
| 162 |
} |
| 163 |
\newcommand{\tutorial}[1][]{ |
| 164 |
\semesterplannerLua@event[tikz={fill=tutorial,}, textcolor=white, type=tut, ##1] |
| 165 |
\ignorespaces |
| 166 |
} |
| 167 |
\newcommand{\meeting}[1][]{ |
| 168 |
\semesterplannerLua@event[tikz={fill=meeting,}, textcolor=white, type=meet, ##1] |
| 169 |
\ignorespaces |
| 170 |
} |
| 171 |
\newcommand{\officehour}[1][]{ |
| 172 |
\semesterplannerLua@event[tikz={fill=officehour,}, textcolor=white, type=office, ##1] |
| 173 |
\ignorespaces |
| 174 |
} |
| 175 |
\newcommand{\laboratory}[1][]{ |
| 176 |
\semesterplannerLua@event[tikz={fill=laboratory,}, textcolor=white, type=lab, ##1] |
| 177 |
\ignorespaces |
| 178 |
} |
| 179 |
\newcommand{\fieldstudy}[1][]{ |
| 180 |
\semesterplannerLua@event[tikz={fill=fieldstudy,}, textcolor=white, type=fieldstudy, ##1] |
| 181 |
\ignorespaces |
| 182 |
} |
| 183 |
}{ |
| 184 |
\directlua{sp.draw( |
| 185 |
[[\pgfkeysvalueof{/semesterplannerLua/timetable/env/length}]], |
| 186 |
[[\pgfkeysvalueof{/semesterplannerLua/timetable/env/width}]])} |
| 187 |
} |
| 188 |
|
| 189 |
\newcommand{\printSpCalendar}[3][3]{\directlua{cal.drawCalendar("#2", "#3", #1)}} |
| 190 |
|
| 191 |
\newenvironment{appointments}[2][Room]{ |
| 192 |
\directlua{cal.init(#2)} |
| 193 |
\newcommand{\appointment}[1][]{% |
| 194 |
\pgfkeys{/semesterplannerLua/calendar/.cd,draw,room,time,prio,course,desc,date,end,tikz,period,type,shift,print, ##1}% |
| 195 |
\directlua{ |
| 196 |
cal.addAppointment{draw=\pgfkeysvalueof{/semesterplannerLua/calendar/draw}, |
| 197 |
room=[[\pgfkeysvalueof{/semesterplannerLua/calendar/room}]], |
| 198 |
time=[[\pgfkeysvalueof{/semesterplannerLua/calendar/time}]], |
| 199 |
prio=[[\pgfkeysvalueof{/semesterplannerLua/calendar/prio}]], |
| 200 |
course=[[\pgfkeysvalueof{/semesterplannerLua/calendar/course}]], |
| 201 |
desc=[[\pgfkeysvalueof{/semesterplannerLua/calendar/desc}]], |
| 202 |
date=[[\pgfkeysvalueof{/semesterplannerLua/calendar/date}]], |
| 203 |
endDate=[[\pgfkeysvalueof{/semesterplannerLua/calendar/end}]], |
| 204 |
tikz=[[\pgfkeysvalueof{/semesterplannerLua/calendar/tikz}]], |
| 205 |
period=\pgfkeysvalueof{/semesterplannerLua/calendar/period}, |
| 206 |
shift=\pgfkeysvalueof{/semesterplannerLua/calendar/shift}, |
| 207 |
print=\pgfkeysvalueof{/semesterplannerLua/calendar/print}}}% |
| 208 |
\ignorespaces |
| 209 |
} |
| 210 |
\section*{\faCalendar~Appointments} |
| 211 |
\begin{tabular}{rlllll} |
| 212 |
\textbf{Date}&\textbf{Time}&\textbf{Course}&\textbf{Description}&\textbf{#1}&\textbf{Prio.}\\ |
| 213 |
}{ |
| 214 |
\end{tabular} |
| 215 |
} |
| 216 |
|
| 217 |
\newenvironment{exams}[1]{ |
| 218 |
\directlua{cal.init(#1)} |
| 219 |
\newcommand{\exam}[1][]{% |
| 220 |
\pgfkeys{/semesterplannerLua/calendar/.cd,draw,room,time,prio,course,desc,date,end,tikz,period,type,shift,print, ##1}% |
| 221 |
\directlua{ |
| 222 |
cal.addExam{ |
| 223 |
draw=\pgfkeysvalueof{/semesterplannerLua/calendar/draw}, |
| 224 |
room=[[\pgfkeysvalueof{/semesterplannerLua/calendar/room}]], |
| 225 |
time=[[\pgfkeysvalueof{/semesterplannerLua/calendar/time}]], |
| 226 |
course=[[\pgfkeysvalueof{/semesterplannerLua/calendar/course}]], |
| 227 |
desc=[[\pgfkeysvalueof{/semesterplannerLua/calendar/desc}]], |
| 228 |
date=[[\pgfkeysvalueof{/semesterplannerLua/calendar/date}]], |
| 229 |
tikz=[[\pgfkeysvalueof{/semesterplannerLua/calendar/tikz}]], |
| 230 |
type=[[\pgfkeysvalueof{/semesterplannerLua/calendar/type}]], |
| 231 |
shift=\pgfkeysvalueof{/semesterplannerLua/calendar/shift}, |
| 232 |
print=\pgfkeysvalueof{/semesterplannerLua/calendar/print}}}% |
| 233 |
\ignorespaces |
| 234 |
} |
| 235 |
\section*{\faStickyNoteO~Exams} |
| 236 |
\begin{tabular}{rllll} |
| 237 |
\textbf{Date}&\textbf{Time}&\textbf{Course}&\textbf{Type}&\textbf{Note}\\ |
| 238 |
}{ |
| 239 |
\end{tabular} |
| 240 |
} |
| 241 |
|
| 242 |
\newenvironment{deadlines}[1]{ |
| 243 |
\directlua{cal.init(#1)} |
| 244 |
\newcommand{\deadline}[1][]{% |
| 245 |
\pgfkeys{/semesterplannerLua/calendar/.cd,draw,room,time,prio,course,desc,date,end,tikz,period,type,shift,print, ##1}% |
| 246 |
\directlua{ |
| 247 |
cal.addDeadline{ |
| 248 |
draw=\pgfkeysvalueof{/semesterplannerLua/calendar/draw}, |
| 249 |
course=[[\pgfkeysvalueof{/semesterplannerLua/calendar/course}]], |
| 250 |
desc=[[\pgfkeysvalueof{/semesterplannerLua/calendar/desc}]], |
| 251 |
date=[[\pgfkeysvalueof{/semesterplannerLua/calendar/date}]], |
| 252 |
tikz=[[\pgfkeysvalueof{/semesterplannerLua/calendar/tikz}]], |
| 253 |
prio=[[\pgfkeysvalueof{/semesterplannerLua/calendar/prio}]], |
| 254 |
shift=\pgfkeysvalueof{/semesterplannerLua/calendar/shift}, |
| 255 |
print=\pgfkeysvalueof{/semesterplannerLua/calendar/print}}}% |
| 256 |
\ignorespaces |
| 257 |
} |
| 258 |
\section*{\faStickyNoteO~Deadlines} |
| 259 |
\begin{tabular}{rlll} |
| 260 |
\textbf{Date}&\textbf{Course}&\textbf{Description}&\textbf{Prio}\\ |
| 261 |
}{ |
| 262 |
\end{tabular} |
| 263 |
} |
| 264 |
\endinput |
| 265 |
%% |
| 266 |
%% End of file `semesterplannerlua.sty'. |