9

I have the .ics format file. I would like to import it with LaTeX and transform it into a timetable (automatically). Any suggestions how to do it? I have found a minimal working example for how to create a timetable in Tikz. Since I don't know how to import a .ics-file I couldn't change anything on it.

%!TEX encoding = UTF-8 Unicode
% Author: Laurent Dutriaux
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fourier} % Utilisation des polices texte
\usepackage{tikz}
\usetikzlibrary[positioning]
\usetikzlibrary{patterns}
\usepackage[french]{babel} % styles français
\title{A simple Timetable}
\author{Laurent Dutriaux}
\date{\today}
\newcommand{\daywidth}{2.2 cm}
\begin{document}

\maketitle

\begin{tikzpicture}[x=\daywidth, y=-1cm, node distance=0 cm,outer sep = 0pt]
% Style for Days
\tikzstyle{day}=[draw, rectangle,  minimum height=1cm, minimum width=\daywidth, fill=yellow!20,anchor=south west]
% Style for hours
\tikzstyle{hour}=[draw, rectangle, minimum height=1 cm, minimum width=1.5 cm, fill=yellow!30,anchor=north east]

% Styles for events
% Duration of sequences
\tikzstyle{hours}=[rectangle,draw, minimum width=\daywidth, anchor=north west,text centered,text width=5 em]
\tikzstyle{1hour}=[hours,minimum height=1cm]
\tikzstyle{2hours}=[hours,minimum height=2cm]
\tikzstyle{3hours}=[hours,minimum height=3cm]
%Style for type of sequence 
\tikzstyle{Ang2h}=[2hours,fill=green!20]
\tikzstyle{Phys2h}=[2hours,fill=red!20]
\tikzstyle{Math2h}=[2hours,fill=blue!20]
\tikzstyle{TIPE2h}=[2hours,fill=blue!10]
\tikzstyle{TP2h}=[2hours, pattern=north east lines, pattern color=magenta]
\tikzstyle{G3h}=[3hours, pattern=north west lines, pattern color=magenta!60!white]
\tikzstyle{Planche}=[1hour,fill=white]
% Positioning labels for days and hours
\node[day] (lundi) at (1,8) {Lundi};
\node[day] (mardi) [right = of lundi] {Mardi};
\node[day] (mercredi) [right = of mardi] {Mercredi};
\node[day] (jeudi) [right = of mercredi] {Jeudi};
\node[day] (vendredi) [right = of jeudi] {Vendredi};
\node[hour] (8-9) at (1,8) {8-9};
\node[hour] (9-10) [below = of 8-9] {9-10};
\node[hour] (10-11) [below= of 9-10] {10-11};
\node[hour] (11-12) [below = of 10-11] {11-12};
\node[hour] (12-13) [below  = of 11-12] {12-13};
\node[hour] (13-14) [below = of 12-13] {13-14};
\node[hour] (14-15) [below = of 13-14] {14-15};
\node[hour] (15-16) [below = of 14-15] {15-16};
\node[hour] (16-17) [below = of 15-16] {16-17};
\node[hour] (17-18) [below = of 16-17] {17-18};
\node[hour] (18-19) [below = of 17-18] {18-19};
%Position of sequences
\node[Ang2h] at (1,10) {Anglais};
\node[Phys2h] at (1,8) {Physique};
\node[Phys2h] at (2,8) {Physique};
\node[Phys2h] at (4,8) {Physique};
\node[Phys2h] at (5,10) {Physique};
\node[Math2h] at (2,10) {Maths};
\node[Math2h] at (2,14) {Maths};
\node[Math2h] at (3,8) {Maths};
\node[Math2h] at (4,10) {Maths};
\node[Math2h] at (5,8) {Maths};
\node[TIPE2h] at (1,14) {TIPE};
\node[TIPE2h] at (1,16) {TIPE};
\node[TIPE2h] at (2,16) {TIPE};
\node[TIPE2h] at (3,10) {TIPE};
\node[TIPE2h] at (5,14) {TIPE};
\node[TIPE2h] at (5,16) {TIPE};
\node[TP2h] at (3,14) {Phys ou SI};
\node[TP2h] at (3,16) {SI ou Phys};
\node[Planche] at (1,13) {Planche};
\node[Planche] at (1,18) {Colle};
\node[Planche] at (4,13.5) {Planche};
\end{tikzpicture}


\end{document}

So how do I import a .ics-file and make a timetable out of it? It would actually be nice if, if you could import the ics-file in a latex table insted (I love the classic design).

Actually I am not the only one with this problem. Here anotherone with the same struggles. And no one with an answer.

Hopefully you have an idea? Biggest trouble with this task (for me) is to include the data in LaTeX and then sort it (so it is on the right place).

Thank you very much in advance!

PS! I would like to have the timescale at the y-axis where x=0 and the days at the x-axis where y=0. And then the subjects in boxes with the SUMMARY\DESCRIPTION\LOCATION under each other. I would love to help - and can maybe help - but first when I have learned how to import a .ics-file and how to structure it / label it so I can use tikz or "just" a table.

Here the data-file:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//skema.derfor.dk//EN
BEGIN:VEVENT
UID:1@314159265
DTSTAMP:20150824T160000
DTSTART:20150824T160000
DTEND:20150824T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:2@314159265
DTSTAMP:20150831T160000
DTSTART:20150831T160000
DTEND:20150831T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:3@314159265
DTSTAMP:20150907T160000
DTSTART:20150907T160000
DTEND:20150907T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:4@314159265
DTSTAMP:20150914T160000
DTSTART:20150914T160000
DTEND:20150914T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:5@314159265
DTSTAMP:20150921T160000
DTSTART:20150921T160000
DTEND:20150921T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:6@314159265
DTSTAMP:20150928T160000
DTSTART:20150928T160000
DTEND:20150928T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:7@314159265
DTSTAMP:20151005T160000
DTSTART:20151005T160000
DTEND:20151005T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:8@314159265
DTSTAMP:20151102T160000
DTSTART:20151102T160000
DTEND:20151102T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:9@314159265
DTSTAMP:20151109T160000
DTSTART:20151109T160000
DTEND:20151109T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:10@314159265
DTSTAMP:20151116T160000
DTSTART:20151116T160000
DTEND:20151116T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:11@314159265
DTSTAMP:20151123T160000
DTSTART:20151123T160000
DTEND:20151123T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:12@314159265
DTSTAMP:20151130T160000
DTSTART:20151130T160000
DTEND:20151130T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:13@314159265
DTSTAMP:20151207T160000
DTSTART:20151207T160000
DTEND:20151207T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:14@314159265
DTSTAMP:20151214T160000
DTSTART:20151214T160000
DTEND:20151214T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:15@314159265
DTSTAMP:20150826T100000
DTSTART:20150826T100000
DTEND:20150826T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:16@314159265
DTSTAMP:20150902T100000
DTSTART:20150902T100000
DTEND:20150902T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:17@314159265
DTSTAMP:20150909T100000
DTSTART:20150909T100000
DTEND:20150909T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:18@314159265
DTSTAMP:20150916T100000
DTSTART:20150916T100000
DTEND:20150916T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:19@314159265
DTSTAMP:20150923T100000
DTSTART:20150923T100000
DTEND:20150923T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:20@314159265
DTSTAMP:20150930T100000
DTSTART:20150930T100000
DTEND:20150930T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:21@314159265
DTSTAMP:20151007T100000
DTSTART:20151007T100000
DTEND:20151007T120000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:22@314159265
DTSTAMP:20151030T110000
DTSTART:20151030T110000
DTEND:20151030T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:23@314159265
DTSTAMP:20151106T110000
DTSTART:20151106T110000
DTEND:20151106T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:24@314159265
DTSTAMP:20151113T110000
DTSTART:20151113T110000
DTEND:20151113T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:25@314159265
DTSTAMP:20151120T110000
DTSTART:20151120T110000
DTEND:20151120T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:26@314159265
DTSTAMP:20151127T110000
DTSTART:20151127T110000
DTEND:20151127T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:27@314159265
DTSTAMP:20151204T110000
DTSTART:20151204T110000
DTEND:20151204T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:28@314159265
DTSTAMP:20151211T110000
DTSTART:20151211T110000
DTEND:20151211T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater V (1514-121) 
END:VEVENT
BEGIN:VEVENT
UID:29@314159265
DTSTAMP:20150825T130000
DTSTART:20150825T130000
DTEND:20150825T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:30@314159265
DTSTAMP:20150901T130000
DTSTART:20150901T130000
DTEND:20150901T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:31@314159265
DTSTAMP:20150908T130000
DTSTART:20150908T130000
DTEND:20150908T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:32@314159265
DTSTAMP:20150915T130000
DTSTART:20150915T130000
DTEND:20150915T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:33@314159265
DTSTAMP:20150922T130000
DTSTART:20150922T130000
DTEND:20150922T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:34@314159265
DTSTAMP:20150929T130000
DTSTART:20150929T130000
DTEND:20150929T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:35@314159265
DTSTAMP:20151006T130000
DTSTART:20151006T130000
DTEND:20151006T180000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K20) 
END:VEVENT
BEGIN:VEVENT
UID:36@314159265
DTSTAMP:20151029T080000
DTSTART:20151029T080000
DTEND:20151029T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:37@314159265
DTSTAMP:20151105T080000
DTSTART:20151105T080000
DTEND:20151105T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:38@314159265
DTSTAMP:20151112T080000
DTSTART:20151112T080000
DTEND:20151112T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:39@314159265
DTSTAMP:20151119T080000
DTSTART:20151119T080000
DTEND:20151119T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:40@314159265
DTSTAMP:20151126T080000
DTSTART:20151126T080000
DTEND:20151126T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:41@314159265
DTSTAMP:20151203T080000
DTSTART:20151203T080000
DTEND:20151203T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:42@314159265
DTSTAMP:20151210T080000
DTSTART:20151210T080000
DTEND:20151210T130000
SUMMARY:Quantumchemistry
DESCRIPTION:
LOCATION:Lecture Theater (1540-K26) 
END:VEVENT
BEGIN:VEVENT
UID:43@314159265
DTSTAMP:20150824T140000
DTSTART:20150824T140000
DTEND:20150824T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:44@314159265
DTSTAMP:20150831T140000
DTSTART:20150831T140000
DTEND:20150831T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:45@314159265
DTSTAMP:20150907T140000
DTSTART:20150907T140000
DTEND:20150907T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:46@314159265
DTSTAMP:20150914T140000
DTSTART:20150914T140000
DTEND:20150914T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:47@314159265
DTSTAMP:20150921T140000
DTSTART:20150921T140000
DTEND:20150921T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:48@314159265
DTSTAMP:20150928T140000
DTSTART:20150928T140000
DTEND:20150928T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:49@314159265
DTSTAMP:20151005T140000
DTSTART:20151005T140000
DTEND:20151005T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:50@314159265
DTSTAMP:20151102T140000
DTSTART:20151102T140000
DTEND:20151102T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:51@314159265
DTSTAMP:20151109T140000
DTSTART:20151109T140000
DTEND:20151109T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:52@314159265
DTSTAMP:20151116T140000
DTSTART:20151116T140000
DTEND:20151116T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:53@314159265
DTSTAMP:20151123T140000
DTSTART:20151123T140000
DTEND:20151123T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:54@314159265
DTSTAMP:20151130T140000
DTSTART:20151130T140000
DTEND:20151130T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:55@314159265
DTSTAMP:20151207T140000
DTSTART:20151207T140000
DTEND:20151207T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:56@314159265
DTSTAMP:20151214T140000
DTSTART:20151214T140000
DTEND:20151214T160000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater II (1514-110) 
END:VEVENT
BEGIN:VEVENT
UID:57@314159265
DTSTAMP:20150825T090000
DTSTART:20150825T090000
DTEND:20150825T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:58@314159265
DTSTAMP:20150901T090000
DTSTART:20150901T090000
DTEND:20150901T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:59@314159265
DTSTAMP:20150908T090000
DTSTART:20150908T090000
DTEND:20150908T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:60@314159265
DTSTAMP:20150915T090000
DTSTART:20150915T090000
DTEND:20150915T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:61@314159265
DTSTAMP:20150922T090000
DTSTART:20150922T090000
DTEND:20150922T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:62@314159265
DTSTAMP:20150929T090000
DTSTART:20150929T090000
DTEND:20150929T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:63@314159265
DTSTAMP:20151006T090000
DTSTART:20151006T090000
DTEND:20151006T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:64@314159265
DTSTAMP:20151103T090000
DTSTART:20151103T090000
DTEND:20151103T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:65@314159265
DTSTAMP:20151110T090000
DTSTART:20151110T090000
DTEND:20151110T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:66@314159265
DTSTAMP:20151117T090000
DTSTART:20151117T090000
DTEND:20151117T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:67@314159265
DTSTAMP:20151124T090000
DTSTART:20151124T090000
DTEND:20151124T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:68@314159265
DTSTAMP:20151201T090000
DTSTART:20151201T090000
DTEND:20151201T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:69@314159265
DTSTAMP:20151208T090000
DTSTART:20151208T090000
DTEND:20151208T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:70@314159265
DTSTAMP:20151215T090000
DTSTART:20151215T090000
DTEND:20151215T120000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:71@314159265
DTSTAMP:20150827T120000
DTSTART:20150827T120000
DTEND:20150827T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:72@314159265
DTSTAMP:20150903T120000
DTSTART:20150903T120000
DTEND:20150903T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:73@314159265
DTSTAMP:20150910T120000
DTSTART:20150910T120000
DTEND:20150910T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:74@314159265
DTSTAMP:20150917T120000
DTSTART:20150917T120000
DTEND:20150917T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:75@314159265
DTSTAMP:20150924T120000
DTSTART:20150924T120000
DTEND:20150924T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:76@314159265
DTSTAMP:20151001T120000
DTSTART:20151001T120000
DTEND:20151001T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:77@314159265
DTSTAMP:20151008T120000
DTSTART:20151008T120000
DTEND:20151008T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:78@314159265
DTSTAMP:20151029T120000
DTSTART:20151029T120000
DTEND:20151029T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:79@314159265
DTSTAMP:20151105T120000
DTSTART:20151105T120000
DTEND:20151105T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:80@314159265
DTSTAMP:20151112T120000
DTSTART:20151112T120000
DTEND:20151112T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:81@314159265
DTSTAMP:20151119T120000
DTSTART:20151119T120000
DTEND:20151119T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:82@314159265
DTSTAMP:20151126T120000
DTSTART:20151126T120000
DTEND:20151126T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:83@314159265
DTSTAMP:20151203T120000
DTSTART:20151203T120000
DTEND:20151203T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:84@314159265
DTSTAMP:20151210T120000
DTSTART:20151210T120000
DTEND:20151210T150000
SUMMARY:Electromagnetic Field Theory
DESCRIPTION:Lessons
LOCATION:IT-lab 2 Chemistry (1510) 
END:VEVENT
BEGIN:VEVENT
UID:85@314159265
DTSTAMP:20150824T100000
DTSTART:20150824T100000
DTEND:20150824T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:86@314159265
DTSTAMP:20150831T100000
DTSTART:20150831T100000
DTEND:20150831T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:87@314159265
DTSTAMP:20150907T100000
DTSTART:20150907T100000
DTEND:20150907T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:88@314159265
DTSTAMP:20150914T100000
DTSTART:20150914T100000
DTEND:20150914T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:89@314159265
DTSTAMP:20150921T100000
DTSTART:20150921T100000
DTEND:20150921T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:90@314159265
DTSTAMP:20150928T100000
DTSTART:20150928T100000
DTEND:20150928T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:91@314159265
DTSTAMP:20151005T100000
DTSTART:20151005T100000
DTEND:20151005T110000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:92@314159265
DTSTAMP:20150826T140000
DTSTART:20150826T140000
DTEND:20150826T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:93@314159265
DTSTAMP:20150902T140000
DTSTART:20150902T140000
DTEND:20150902T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:94@314159265
DTSTAMP:20150909T140000
DTSTART:20150909T140000
DTEND:20150909T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:95@314159265
DTSTAMP:20150916T140000
DTSTART:20150916T140000
DTEND:20150916T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:96@314159265
DTSTAMP:20150923T140000
DTSTART:20150923T140000
DTEND:20150923T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:97@314159265
DTSTAMP:20150930T140000
DTSTART:20150930T140000
DTEND:20150930T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:98@314159265
DTSTAMP:20151007T140000
DTSTART:20151007T140000
DTEND:20151007T160000
SUMMARY:Relativity
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater I (1514-213) 
END:VEVENT
BEGIN:VEVENT
UID:99@314159265
DTSTAMP:20151102T120000
DTSTART:20151102T120000
DTEND:20151102T140000
SUMMARY:Complex Analysis
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater VI (1510-213) 
END:VEVENT
BEGIN:VEVENT
UID:100@314159265
DTSTAMP:20151109T120000
DTSTART:20151109T120000
DTEND:20151109T140000
SUMMARY:Complex Analysis
DESCRIPTION:Oral Lessons
LOCATION:Lecture Theater VI (1510-213) 
END:VEVENT
END:VCALENDAR
  • 1
    Use gawk or similar? I don't think this is really a TeX question: more about text processing. There's no reason to take that data straight into TeX. Better pre-process it into a format you can easily use. – cfr Sep 23 '15 at 22:48
  • @Amelie B. Blackstone There are multiple entries each day. Is this intensionally? – Peter Ebelsberger Sep 26 '15 at 15:26
  • @PeterEbelsberger yes. It's a timetable with multiple lessons each day and therfor multiple entries. There should be a timetable for five weeks. And well, I know it's repeating itself. But well, that is what my school gives me to work with. – Amelie B. Blackstone Sep 27 '15 at 23:12
  • It seems to me, that I cannot provide a solution. Because my code generates a table of a complete year and cannot handle multiple entries currently. – Peter Ebelsberger Sep 28 '15 at 20:09
13
+125

I wrote a short Python script and a Jinja template to try and automatically generate the timetable you need. Here's a work in progress:

Early WIP of calendar

Before I go on, could I check that the times are right? I'm not sure if I'm handling the dates and times correctly: in particular there seems to be an overlap on Thursday between Quantum Chemistry and EM Field Theory.

For reference, here's the current python code:

#generate_tikz.py
'''Requirements:
arrow for datetime handling
ics package for reading ICS file,
jinja2 for the templating'''

import arrow
from ics import Calendar
from jinja2 import Environment, FileSystemLoader
from collections import Counter

with open('cal.ics', 'rt') as f:
    cal = Calendar(iter(f))

env = Environment(loader=FileSystemLoader('.'))
template = env.get_template('cal.tpl')

days = [dict() for i in range(5)] 
for event in cal.events:
    day = event.begin.weekday()
    if day >= 5: #weekend
        continue
    days[day][event.begin.hour] = event

from pprint import pprint
pprint(days)

names = Counter(event.name for day in days for event in day.values() )
names = [x[0] for x in names.most_common()]
colors = ['red', 'green', 'blue', 'orange', 'purple', 'brown', 'gray']

with open("cal.tex", "wt") as f:
    f.write(template.render(
        days=days, names=zip(names, colors)
    ))

And this is the Jinja template:

{# saved as cal.tpl #}
%See http://tex.stackexchange.com/q/268780/82389
\documentclass[draft, a4paper]{article}
\usepackage[top=5mm, bottom=5mm, left=5mm, right=5mm]{geometry}
%\usepackage{showframe}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}

%Options for timetable contents
\def\firsthour{8}
\def\lasthour{19}
\def\daynames{Monday, Tuesday, Wednesday, Thursday, Friday}

%Options for timetable drawing
\def\daywidth{3.4cm}   %approx \textwidth / 6
\def\hourheight{2.2cm} %approx \textheight / (\lasthour - \firsthour + 1)

\begin{document}

\centering
\begin{tikzpicture}[
    x=\daywidth, y=-\hourheight,
    block/.style={
        draw, text width=\daywidth, minimum height=\hourheight, inner sep=0pt, align=flush center
    },
    hour/.style ={block, fill=yellow!40, font=\bfseries\Large,
        text width=0.6*\daywidth, xshift=0.2*\daywidth},
    day/.style  ={block, fill=yellow!40, font=\bfseries\Large,
        minimum height=0.5*\hourheight, yshift=-0.25*\hourheight},
    event details/.style={
        align=flush center,
        inner xsep=0pt, inner ysep=1pt,
        rectangle split, rectangle split parts=3,
        text width=0.95*\daywidth
    },
    name/.style ={font=\normalsize},
    desc/.style ={font=\small\itshape},
    loc/.style  ={font=\small},
    hours/.style={minimum height=#1*\hourheight}
]

{%- for name, color in names -%}
    \tikzset{ {{name}}/.style={block, fill={{color}}!20, draw={{color}}!50!black, thick} }
{% endfor %}

\draw[help lines, xshift=0.5*\daywidth, yshift=0.5*\hourheight]
    (0, \firsthour) grid [xstep=\daywidth, ystep=\hourheight] (5, \lasthour);

\pgfmathtruncatemacro\secondhour{\firsthour + 1}
\foreach \end[remember=\end as \start (initially \firsthour)] in {\secondhour, ..., \lasthour} {
    \node[hour] at (0, \start) {\start--\end};
}

\foreach \day[count=\daynum] in \daynames {
    \node[day] at (\daynum, \firsthour-1) {\day};
}

{%- for day in days -%}
    {%- set dayloop = loop -%}
    {%- for time, event in day.items() -%}
        {%- set duration = event.duration.seconds / 3600 -%}
        {%- set y = time  + (duration - 1) / 2 -%}
    \node[{{event.name}}, hours={{duration}}] at ( {{ dayloop.index }} , {{ y }} ) {};

    \node[event details] at ( {{ dayloop.index }} , {{ y }} ) {
        \nodepart[name]{one}   \strut {{ event.name }} 
        \nodepart[desc]{two}   \strut {{ event.description }}
        \nodepart[loc] {three} \strut {{ event.location }}
    };
    {%- endfor %}
{% endfor %}

\end{tikzpicture}
\end{document}

If you have a recent version of Python available on your system, you can install the requisite packages with: pip install ics jinja2 Then run the script with: python generate_tikz.py Finally, call pdflatex cal.tex to generate a pdf.

In case you can't do this on your system, I've included the output TeX code below.

%cal.tex
%See http://tex.stackexchange.com/q/268780/82389
\documentclass[draft, a4paper]{article}
\usepackage[top=5mm, bottom=5mm, left=5mm, right=5mm]{geometry}
%\usepackage{showframe}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}

%Options for timetable contents
\def\firsthour{8}
\def\lasthour{19}
\def\daynames{Monday, Tuesday, Wednesday, Thursday, Friday}

%Options for timetable drawing
\def\daywidth{3.4cm}   %approx \textwidth / 6
\def\hourheight{2.2cm} %approx \textheight / (\lasthour - \firsthour + 1)

\begin{document}

\centering
\begin{tikzpicture}[
    x=\daywidth, y=-\hourheight,
    block/.style={
        draw, text width=\daywidth, minimum height=\hourheight, inner sep=0pt, align=flush center
    },
    hour/.style ={block, fill=yellow!40, font=\bfseries\Large,
        text width=0.6*\daywidth, xshift=0.2*\daywidth},
    day/.style  ={block, fill=yellow!40, font=\bfseries\Large,
        minimum height=0.5*\hourheight, yshift=-0.25*\hourheight},
    event details/.style={
        align=flush center,
        inner xsep=0pt, inner ysep=1pt,
        rectangle split, rectangle split parts=3,
        text width=0.95*\daywidth
    },
    name/.style ={font=\normalsize},
    desc/.style ={font=\small\itshape},
    loc/.style  ={font=\small},
    hours/.style={minimum height=#1*\hourheight}
]\tikzset{ Quantumchemistry/.style={block, fill=red!20, draw=red!50!black, thick} }
\tikzset{ Electromagnetic Field Theory/.style={block, fill=green!20, draw=green!50!black, thick} }
\tikzset{ Relativity/.style={block, fill=blue!20, draw=blue!50!black, thick} }
\tikzset{ Complex Analysis/.style={block, fill=orange!20, draw=orange!50!black, thick} }


\draw[help lines, xshift=0.5*\daywidth, yshift=0.5*\hourheight]
    (0, \firsthour) grid [xstep=\daywidth, ystep=\hourheight] (5, \lasthour);

\pgfmathtruncatemacro\secondhour{\firsthour + 1}
\foreach \end[remember=\end as \start (initially \firsthour)] in {\secondhour, ..., \lasthour} {
    \node[hour] at (0, \start) {\start--\end};
}

\foreach \day[count=\daynum] in \daynames {
    \node[day] at (\daynum, \firsthour-1) {\day};
}\node[Quantumchemistry, hours=2.0] at ( 1 , 16.5 ) {};

    \node[event details] at ( 1 , 16.5 ) {
        \nodepart[name]{one}   \strut Quantumchemistry 
        \nodepart[desc]{two}   \strut 
        \nodepart[loc] {three} \strut Lecture Theater V (1514-121)
    };\node[Relativity, hours=1.0] at ( 1 , 10.0 ) {};

    \node[event details] at ( 1 , 10.0 ) {
        \nodepart[name]{one}   \strut Relativity 
        \nodepart[desc]{two}   \strut Oral Lessons
        \nodepart[loc] {three} \strut Lecture Theater I (1514-213)
    };\node[Complex Analysis, hours=2.0] at ( 1 , 12.5 ) {};

    \node[event details] at ( 1 , 12.5 ) {
        \nodepart[name]{one}   \strut Complex Analysis 
        \nodepart[desc]{two}   \strut Oral Lessons
        \nodepart[loc] {three} \strut Lecture Theater VI (1510-213)
    };\node[Electromagnetic Field Theory, hours=2.0] at ( 1 , 14.5 ) {};

    \node[event details] at ( 1 , 14.5 ) {
        \nodepart[name]{one}   \strut Electromagnetic Field Theory 
        \nodepart[desc]{two}   \strut Oral Lessons
        \nodepart[loc] {three} \strut Lecture Theater II (1514-110)
    };
\node[Electromagnetic Field Theory, hours=3.0] at ( 2 , 10.0 ) {};

    \node[event details] at ( 2 , 10.0 ) {
        \nodepart[name]{one}   \strut Electromagnetic Field Theory 
        \nodepart[desc]{two}   \strut Lessons
        \nodepart[loc] {three} \strut IT-lab 2 Chemistry (1510)
    };\node[Quantumchemistry, hours=5.0] at ( 2 , 15.0 ) {};

    \node[event details] at ( 2 , 15.0 ) {
        \nodepart[name]{one}   \strut Quantumchemistry 
        \nodepart[desc]{two}   \strut 
        \nodepart[loc] {three} \strut Lecture Theater (1540-K20)
    };
\node[Quantumchemistry, hours=2.0] at ( 3 , 10.5 ) {};

    \node[event details] at ( 3 , 10.5 ) {
        \nodepart[name]{one}   \strut Quantumchemistry 
        \nodepart[desc]{two}   \strut 
        \nodepart[loc] {three} \strut Lecture Theater (1540-K26)
    };\node[Relativity, hours=2.0] at ( 3 , 14.5 ) {};

    \node[event details] at ( 3 , 14.5 ) {
        \nodepart[name]{one}   \strut Relativity 
        \nodepart[desc]{two}   \strut Oral Lessons
        \nodepart[loc] {three} \strut Lecture Theater I (1514-213)
    };
\node[Quantumchemistry, hours=5.0] at ( 4 , 10.0 ) {};

    \node[event details] at ( 4 , 10.0 ) {
        \nodepart[name]{one}   \strut Quantumchemistry 
        \nodepart[desc]{two}   \strut 
        \nodepart[loc] {three} \strut Lecture Theater (1540-K26)
    };\node[Electromagnetic Field Theory, hours=3.0] at ( 4 , 13.0 ) {};

    \node[event details] at ( 4 , 13.0 ) {
        \nodepart[name]{one}   \strut Electromagnetic Field Theory 
        \nodepart[desc]{two}   \strut Lessons
        \nodepart[loc] {three} \strut IT-lab 2 Chemistry (1510)
    };
\node[Quantumchemistry, hours=2.0] at ( 5 , 11.5 ) {};

    \node[event details] at ( 5 , 11.5 ) {
        \nodepart[name]{one}   \strut Quantumchemistry 
        \nodepart[desc]{two}   \strut 
        \nodepart[loc] {three} \strut Lecture Theater V (1514-121)
    };


\end{tikzpicture}
\end{document}
  • 2
    My pleasure. Let me know if there's anything else I can do to help. – David R Oct 4 '15 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.