% cvhplan.sty - LaTeX Settings for Time Schedules
% Copyright (C) 2012, 2013, 2017, 2018 Peter Gerwinski, see https://www.cvh-server.de/~pgerwinski/stundenplan/2018ws/tex/
% Copyright (C) 2021 Arne Babenhauserheide
%
% This document is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation, either version 3
% of the License, or (at your option) any later version.
%
% This document is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this document. If not, see <http://www.gnu.org/licenses/>.
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage[paper=a4paper,landscape]{geometry}
\usepackage[colornames,dvipsnames]{xcolor}
\usepackage{rotating}
\usepackage{calc}
\setlength{\pdfpagewidth}{29.7cm}
\setlength{\pdfpageheight}{21.0cm}
\setlength{\textwidth}{28cm}
\setlength{\textheight}{20cm}
\setlength{\hoffset}{-3.75cm}
%\setlength{\voffset}{-3.75cm}
\setlength{\voffset}{-1.95cm}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\setlength{\unitlength}{0.73cm}
\newcommand{\mon}{1}
\newcommand{\tue}{6.4}
\newcommand{\wed}{11.8}
\newcommand{\thu}{17.2}
\newcommand{\fri}{22.6}
\newcommand{\sat}{28.0}
\newcommand{\sun}{33.4}
\newcommand{\drawquarters}[1]{%
{
\put(38.7,19.85){\makebox(0,0)[tr]{#1}}
\color{red}
% \put(6,18.3){\makebox(0,0){\begin{rotate}{10}
% \Huge\textbf{--- Entwurf ---}
% \end{rotate}}}
% \put(7.5,19.6){\begin{minipage}[t]{5.90cm}
% \footnotesize\par
% Dieser Plan enthält noch keine Raumangaben.
% Bitte überprüfen Sie die Webseiten regelmäßig bzgl.\ Aktualisierungen.
% \end{minipage}}
% \put(6,18.3){\makebox(0,0){\begin{rotate}{5}
% \Huge\textbf{--- unvollständige Vorabversion ---}
% \end{rotate}}}
% \put(8,19.5){\begin{minipage}[t]{9cm}
% \small\par
% Dieser Plan gilt vorbehaltlich des geplanten personellen Aufbaus am CVH.
% Bitte überprüfen Sie die Webseiten regelmäßig bzgl.\ Aktualisierungen.
% \end{minipage}}
\color[rgb]{0.8,0.8,0.8}
% add lines after 24:00
% \multiput(1,-6.4)(0,0.4){61}{\line(1,0){37.8}}
\multiput(1,-1.6)(0,0.4){49}{\line(1,0){37.8}}
}
% \put(1,-6.8){\line(1,0){37.8}}
}
\newcommand{\drawhours}{% create the hour-labels
\color[rgb]{0.4,0.4,0.4}
\multiput(1,-6.4)(0,1.6){16}{\line(1,0){37.8}}
\color[rgb]{0,0,0}
\multiput(1,-6.4)(5.4,0){8}{\line(0,1){24.0}}
% double the line before saturday
\put(28.04,-6.40){\line(0,1){24.0}}
\put(0.9,17.6){\makebox(0,0)[r]{0}}
\put(0.9,14.4){\makebox(0,0)[r]{1}}
\put(0.9,11.2){\makebox(0,0)[r]{2}}
\put(0.9,8.0){\makebox(0,0)[r]{3}}
\put(0.9,4.8){\makebox(0,0)[r]{4}}
\put(0.9,1.6){\makebox(0,0)[r]{5}}
\put(0.9,-1.6){\makebox(0,0)[r]{6}}
%\put(0.9,-3.2){\makebox(0,0)[r]{02:00}}
%\put(0.9,-4.8){\makebox(0,0)[r]{04:00}}
%\put(0.9,-6.4){\makebox(0,0)[r]{06:00}}
\put(3.70,17.7){\makebox(0,0)[b]{Montag}}
\put(9.10,17.7){\makebox(0,0)[b]{Dienstag}}
\put(14.50,17.7){\makebox(0,0)[b]{Mittwoch}}
\put(19.90,17.7){\makebox(0,0)[b]{Donnerstag}}
\put(25.30,17.7){\makebox(0,0)[b]{Freitag}}
\put(30.70,17.7){\makebox(0,0)[b]{Samstag}}
\put(36.10,17.7){\makebox(0,0)[b]{Sonntag}}
}
\newlength{\colwidth}
\setlength{\colwidth}{5.4\unitlength}
\newlength{\hours}
\setlength{\hours}{3.2\unitlength}
\newlength{\quarters}
\setlength{\quarters}{0.2\unitlength}
\newlength{\minutes}
\setlength{\minutes}{0.13333\unitlength}
% distance from zero, temporary variable to do calculations, mutated
% along the way
\newlength{\beginminutes}
\newcommand{\halfcol}[1]{\makebox[0.49\colwidth]{\hss#1\hss}}
\newcommand{\activity}[6]{%
\setlength{\beginminutes}{#3\hours}
\addtolength{\beginminutes}{#4\minutes}
\put(#2,17.6){% ab 0:00 Uhr
\begin{minipage}[t]{\colwidth}%
\vspace*{\beginminutes}%
\def\testl{#6}%
\def\testr{\Crecreation}%
\ifx\testl\testr
\strut\vspace*{-44\minutes}%
\else
\makebox(0,0)[tl]{%
\color{#6!30!white}%much weaker colors to preserve ink ("transparency")
\rule{\colwidth}{#5\minutes}}%
\fi
\begin{center}
\scriptsize\setlength{\baselineskip}{3\minutes}\vspace*{-2.5\minutes}\par
#1
\end{center}
\end{minipage}
}
}
\definecolor{LightPeriwinkle}{rgb}{0.65,0.6,0.85}
\definecolor{LightGray}{rgb}{0.85,0.85,0.85}
\definecolor{DirtyYellow}{rgb}{0.90 0.88 0.45}
\definecolor{LightOrange}{rgb}{1.0 0.85 0.45}
\definecolor{LightBlue}{rgb}{0.725 0.875 1.0}
\newcommand{\Clecture}{SkyBlue}
\newcommand{\Cexercises}{SpringGreen}
\newcommand{\Cblock}{YellowGreen}
\newcommand{\Claboratory}{Salmon}
\newcommand{\Ctutorial}{LightPeriwinkle}
\newcommand{\Cexpertise}{YellowOrange}
\newcommand{\Celective}{YellowOrange}
\newcommand{\Coptional}{Yellow}
\newcommand{\Cseminar}{LightOrange}
\newcommand{\Cother}{LightGray}
\newcommand{\Crecreation}{white}
\newcommand{\Cauxlecture}{LightBlue}
\newcommand{\Cpersonal}{LightBlue}
\newcommand{\Llecture}{\colorbox{\Clecture}{Vorlesung\strut}}
\newcommand{\Lexercises}{\colorbox{\Cexercises}{Übung\strut}}
\newcommand{\Lblock}{\colorbox{\Cblock}{Blockveranstaltung\strut}}
\newcommand{\Llaboratory}{\colorbox{\Claboratory}{Praktikum\strut}}
\newcommand{\Ltutorial}{\colorbox{\Ctutorial}{Tutorium\strut}}
\newcommand{\Lexpertise}{\colorbox{\Cexpertise}{Pflichtfach\strut}}
\newcommand{\Lelective}{\colorbox{\Cexpertise}{Wahlpflichtfach\strut}}
\newcommand{\Loptional}{\colorbox{\Coptional}{Wahlfach\strut}}
\newcommand{\Lseminar}{\colorbox{\Cseminar}{Seminar\strut}}
\newcommand{\Lother}{}
\newcommand{\Lrecreation}{}
\newcommand{\Lauxlecture}{\colorbox{\Cauxlecture}{Ausweichtermin\strut}}
\newcommand{\Lpersonal}{\colorbox{\Cpersonal}{privat\strut}}
% bab:
\newcommand{\Cwork}{YellowOrange}
\newcommand{\Cschool}{LightOrange}
\newcommand{\Cchore}{Yellow}
\newcommand{\Cfamily}{SkyBlue}
\newcommand{\Cfood}{LightBlue}
\newcommand{\Chobby}{LightPeriwinkle}
\newcommand{\Crelaxing}{SpringGreen}
% Ferienplan:
\newcommand{\Cwzero}{YellowOrange}
\newcommand{\Cwone}{Yellow}
\newcommand{\Cwtwo}{SpringGreen}
\newcommand{\Cwthree}{SkyBlue}
\newcommand{\Cwfour}{LightBlue}
\newcommand{\Cwfive}{LightPeriwinkle}
\newcommand{\Cwsix}{White}
% bab:
\newcommand{\Lwork}{\colorbox{\Cwork}{Arbeit\strut}}
\newcommand{\Lschool}{\colorbox{\Cschool}{Schule\strut}}
\newcommand{\Lchore}{\colorbox{\Cchore}{Hausarbeit\strut}}
\newcommand{\Lfamily}{\colorbox{\Cfamily}{Familienspaß\strut}}
\newcommand{\Lfood}{\colorbox{\Cfood}{Essen (kochen/essen)\strut}}
\newcommand{\Lhobby}{\colorbox{\Chobby}{Hobby\strut}}
\newcommand{\Lrelaxing}{\colorbox{\Crelaxing}{Ausruhen/Sport\strut}}
% Ferienplan:
\newcommand{\Lwzero}{\colorbox{\Cwzero}{W0\strut}}
\newcommand{\Lwone}{\colorbox{\Cwone}{W1\strut}}
\newcommand{\Lwtwo}{\colorbox{\Cwtwo}{W2\strut}}
\newcommand{\Lwthree}{\colorbox{\Cwthree}{W3\strut}}
\newcommand{\Lwfour}{\colorbox{\Cwfour}{W4\strut}}
\newcommand{\Lwfive}{\colorbox{\Cwfive}{W5\strut}}
\newcommand{\Lwsix}{\colorbox{\Cwsix}{W6\strut}}
\newcommand{\legend}[1]{\put(38.7,19){\makebox(0,0)[r]{\footnotesize#1}}}
\def\lecture#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Clecture}}
\def\exercises#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cexercises}}
\def\block#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cblock}}
\def\laboratory#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Claboratory}}
\def\tutorial#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Ctutorial}}
\def\expertise#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cexpertise}}
\def\elective#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Celective}}
\def\optional#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Coptional}}
\def\seminar#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cseminar}}
\def\other#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cother}}
\def\recreation#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Crecreation}}
\def\auxlecture#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cauxlecture}}
\def\personal#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cpersonal}}
% bab:
\def\work#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwork}}
\def\school#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cschool}}
\def\chore#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cchore}}
\def\family#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cfamily}}
\def\food#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cfood}}
\def\hobby#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Chobby}}
\def\relaxing#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Crelaxing}}
\def\note#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Crecreation}} % recreation is white -> empty
% ferienplan:
\def\wzero#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwzero}}
\def\wone#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwone}}
\def\wtwo#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwtwo}}
\def\wthree#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwthree}}
\def\wfour#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwfour}}
\def\wfive#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwfive}}
\def\wsix#1#2 #3 #4 #5{\activity{#5}{#1}{#2}{#3}{#4}{\Cwsix}}
\newenvironment{plan}[2]{%beginblock
\section*{#1\strut}\begin{picture}(38.8,15.2)(0,3)\drawquarters #2%
}{%endblock
\drawhours\end{picture}\clearpage%
}