I'm struggeling with creating a "serial letter" (not really a letter, but a document wich I will need different versions of for different people). I have all the data I need to insert in a csv file. In the beginning it was only supposed to make the document just personalized with names. It has 4 pages and it was only supposed to put the name of the person on the first page, so out would come a pdf with the 4-sided document for each person.
Now I want to create something similar, but now it has to do a little more than just inserting names. The last page is supposed to be a table containing their tasks. At the moment it's supposed to be one row per day and in the second column there should be the different tasks for the day (ideal with one line per task, still in one cell). I use the package datatool for that. Now the problem is to get the csv formatted right and to play it together nicely with babel (think that's one of the problems).
I know you all like minimal examples, so here you go.
\documentclass[parskip,twoside,9pt]{scrartcl}
\usepackage{fontspec}
\usepackage[german]{babel}
\usepackage{marvosym}
\usepackage{lmodern}
\usepackage[a6paper,left=8.5mm,right=8.5mm,top=2.26cm,bottom=8.5mm,headheight=2.26cm,headsep=0cm]{geometry}
\usepackage{array}
\usepackage{wrapfig}
\usepackage{fancyhdr}
\tolerance=2000
\setlength{\emergencystretch}{20pt} %verhindert das herrausragen von Wörtern übers Zeilenende
\renewcommand{\familydefault}{\sfdefault}
\usepackage[table]{xcolor}
\usepackage{datatool}
\DTLsetseparator{;}
\DTLloaddb{Orga}{Orga_test.csv}
\begin{document}
\DTLforeach{Orga}{
\Mittwoch=Mittwoch,\Donnerstag=Donnerstag,\Freitag=Freitag,\Samstag=Samstag,\Sonntag=Sonntag}{
\renewcommand{\arraystretch}{4}
\begin{table}[h!]
\begin{tabular}{|p{2cm}|p{6cm}|}
\hline
Mittwoch & \Mittwoch \\\hline
Donnerstag & \Donnerstag \\\hline
Freitag & \Freitag \\\hline
Samstag & \Samstag \\\hline
Sonntag & \Sonntag \\\hline
\end{tabular}
\end{table}
\renewcommand{\arraystretch}{1}
}
\end{document}
This only creates the last page, the table.
This is the csv (obviously without names) I use:
Mittwoch;Donnerstag;Freitag;Samstag;Sonntag
;;18:30 – 20:00: Verantwortlicher Fachvortrag;;9:30 – 12:30: Verantwortlicher Workshops
Aufgabe2
;16:00 – 18:00: Verantwortlicher Anfangsplenum;07:00 – 14:00: Verantwortlicher E;9:00 – 12:00: Verantwortlicher Wanderung
13:00 – 14:30: Verantwortlicher Zwischenplenum;12:00 – 14:30: Verantwortlicher Endplenum
Aufgabe2
;13:00 – 16:00: Verantwortlicher Hostel;14:00 – 18:30: Verantwortlicher Workshops;;8:00 – 10:00: Verantwortlicher Hostel
Aufgabe2
;;;ab 19:30: Verantwortliche Kochen;Spätestens 21:00: Schnaps
;19:00 – 20:00: Verantwortlicher Abendessen;14:00 – 19:00: Verantwortlicher B;9:00 – 12:00: Verantwortlicher Stadtführung;14:30 – 16:00: Verantwortlicher Lunchpakete
Aufgabe 2
;13:00 – 16:00: Verantwortlicher Fachschaft;ab 19:00: Verantwortlicher Grillen;9:00 – 12:00: Verantwortlicher Wanderung
14:00 – 15:30: Verantwortlicher Mitgliederversammlung;Aufgabe
;;ab 20:30: Verantwortlicher Spieleabend;9:00 – 12:00: Verantwortlicher Stadtführung
Ab 20:30: Verantwortlicher H;Aufgabe
;ab 20:00: Verantwortlicher Kneipentour;;;16:00 – 19:00: Verantwortlicher Putzen
Aufgabe
And this is how it looked like in LibreOffice where I created that