diff --git a/documents/mathe-blutspende/Aufgabe-Blutspende.tex b/documents/mathe-blutspende/Aufgabe-Blutspende.tex new file mode 100644 index 0000000..e48148c --- /dev/null +++ b/documents/mathe-blutspende/Aufgabe-Blutspende.tex @@ -0,0 +1,76 @@ +\documentclass[a4paper,9pt]{scrartcl} +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage{amssymb,amsmath} +\usepackage{geometry} +\usepackage{graphicx} + +\geometry{a4paper,left=18mm,right=18mm, top=1cm, bottom=2cm} + +\setcounter{secnumdepth}{2} +\setcounter{tocdepth}{2} + +\begin{document} + \title{Blutabnahme} + \author{Martin Thoma} + + \setcounter{section}{1} + \section*{Aufgabenstellung} + Ein Mensch hat ca. 5 Liter Blut. Bei einer Blutspende wird in der Regel etwa + ein halber Liter Blut entnommen. Bis zur nächsten Blutspende ist wird dieses + Blut wieder neu gebildet. Wie häufig muss Blut gespendet werden, bis 95\% + des ursprünglichen Blutes gespendet wurde?\\ + + \noindent Die natürliche Neubildung von Blut auch ohne Blutspende wird vernachlässigt. + + \subsection{Die ersten Werte} + $f(x)$ sei die Menge des ursprünglichen Blutes, das nach $x$ Spenden gespendet + wurde:\\ + $f(0) = 0$\\ + Beim ersten mal Blutspenden wird ein halber Liter des ursprünglichen Blutes + gespendet:\\ + $f(1) = f(0) + 0{,}5$\\ + Beim zweiten mal Blutspenden werden 0,45 Liter des ursprünglichen Blutes + gespendet:\\ + $f(2) = f(1) + f(0) + \frac{5-0{,}5}{5} \cdot 0{,}5 Liter = 0{,}95 Liter $\\ + Beim dritten mal Blutspenden werden 0,405 Liter des ursprünglichen Blutes + gespendet:\\ + $f(3) = f(2) + f(1) + f(0) + \frac{5-0{,}95}{5} \cdot 0{,}5 Liter = 1{,}355 Liter$ + + \subsection{Eine rekursive Formel} + \begin{align} + f(1) &= 0{,}5 \\ + f(x) &= \frac{5-f(x-1)}{5} \cdot 0{,}5 + f(x-1) + \end{align} + + \subsection{Auflösen der Rekursion} + \begin{align} + f(3) &= 0{,}5 + \frac{9}{10} \cdot (0{,}5 + \frac{9}{10} \cdot (0{,}5 + \frac{9}{10} \cdot 0{,}5))\\ + &= 0{,}5 + \frac{9}{10} \cdot 0{,}5 + (\frac{9}{10})^2 \cdot (0{,}5 + \frac{9}{10} \cdot 0{,}5)\\ + &= 0{,}5 + \frac{9}{10} \cdot 0{,}5 + (\frac{9}{10})^2 \cdot 0{,}5 + (\frac{9}{10})^3 \cdot 0{,}5\\ + &= 0{,}5 \cdot (1 + \frac{9}{10} + (\frac{9}{10})^2 + (\frac{9}{10})^3 \cdot )\\ + f(x)&= \frac{1}{2} \cdot \sum_{i=0}^{x} (\frac{9}{10})^i + \end{align} + + \subsection{Auflösen des Summensymbols} + \begin{align} + f(x) &= \frac{1}{2} \cdot \sum_{i=0}^{x} (\frac{9}{10})^i\\ + &= \frac{1}{2}\cdot (\frac{0{,}9^{x+1} - 1}{0{,}9 - 1})\\ + &= \frac{1}{2}\cdot (-10 \cdot 0{,}9^{x+1} + 10)\\ + &= -5 \cdot 0{,}9^{x+1} + 5\\ + &= 5 \cdot (1 - 0{,}9^{x+1}) + \end{align} + + \subsection{Lösung} + \begin{align} + 0{,}95 \cdot 5 &= 5 \cdot (1- 0{,}9^{x+1})\\ + 0{,}95 &= 1 - 0{,}9^{x+1}\\ + 0{,}9^{x+1} &= 0{,}05\\ + \ln(0{,}9) \cdot {x+1} &= \ln(0{,}05) \\ + x &= \frac{\ln(0{,}05)}{\ln(0{,}9)} - 1\\ + x &= 27{,}43 + \end{align} + \subsection{Antwort} + Nach dem 28. mal Blutspenden wurden 95\% des ursprünglichen Blutes + gespendet. +\end{document} diff --git a/documents/mathe-blutspende/Makefile b/documents/mathe-blutspende/Makefile new file mode 100644 index 0000000..8201c38 --- /dev/null +++ b/documents/mathe-blutspende/Makefile @@ -0,0 +1,6 @@ +make: + pdflatex Aufgabe-Blutspende.tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux diff --git a/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Erdhalbkugel.svg b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Erdhalbkugel.svg new file mode 100644 index 0000000..5bb0a6a --- /dev/null +++ b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Erdhalbkugel.svg @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 6370 km + N + + + Der 25. Breitengrad + 25° + + 6370 km + + + + Burdsch Chalifa + Mileiha + + diff --git a/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Erdkugel.svg b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Erdkugel.svg new file mode 100644 index 0000000..8b51de9 --- /dev/null +++ b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Erdkugel.svg @@ -0,0 +1,121 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Skizze.svg b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Skizze.svg new file mode 100644 index 0000000..34d1506 --- /dev/null +++ b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa-Skizze.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + φ + Erde + r + x + h + + diff --git a/documents/mathe-burdsch-chalifa/Burdsch-Chalifa.pdf b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa.pdf new file mode 100644 index 0000000..3776601 Binary files /dev/null and b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa.pdf differ diff --git a/documents/mathe-burdsch-chalifa/Burdsch-Chalifa.tex b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa.tex new file mode 100644 index 0000000..7d0cbc8 --- /dev/null +++ b/documents/mathe-burdsch-chalifa/Burdsch-Chalifa.tex @@ -0,0 +1,177 @@ +\documentclass[a4paper,9pt]{scrartcl} +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage{amssymb,amsmath} +\usepackage{geometry} +\usepackage{graphicx} +\usepackage{hyperref} +\usepackage{xcolor} +\definecolor{sky}{HTML}{AAEEEE} +\definecolor{lgreen}{HTML}{77DD11} +\usepackage{tikz} +\usetikzlibrary{calc, decorations.pathmorphing, decorations.text} + +\geometry{a4paper,left=18mm,right=18mm, top=1cm, bottom=2cm} + +\setcounter{secnumdepth}{2} +\setcounter{tocdepth}{2} + +\shorthandon{"} +\hypersetup{ + pdftitle={Sichtweite des Burdsch Chalifa}, + pdfsubject={Aufgabe}, + pdfauthor={Martin Thoma}, + pdfkeywords={Aufgabe, Mathematik, Geometrie, Rechenweg, Lösung}} +\shorthandoff{"} + +\begin{document} + \title{Sichtweite des Burdsch Chalifa} + \author{Martin Thoma} + + \setcounter{section}{1} + \section*{Aufgabenstellung} + Der Burdsch Chalifa war 2010 das höchste Gebäude der Erde. Bis zur Spitze + sind es 830 m.\\ + \\ + Angenommen, die Erde wäre eine perfekte Kugel mit einem Radius von 6370 km + und die Sicht wäre nicht durch Nebel, Wolken oder sonstige Hindernisse + eingeschränkt. Aus welcher Entfernung, die man über die Erde direkt zum + Burdsch Chalifa zurücklegt, könnte man den Burdsch Chalifa maximal sehen? + + \subsection{Situationsskizze} + + +\begin{tikzpicture}[scale=1.2] + \draw[fill=sky] (0, 0) circle (1.5cm); + \draw[fill=brown] (0, 0) circle (1cm); + + %tangente + \begin{scope}[shift={(-1.35cm,0)}, rotate=48] + \draw (0,0) -- node {} (2.5cm, 0); + \end{scope} + + \draw (0,0) -- node {} (0, 1.5cm); + \draw (0,0) -- node[anchor=east] {$r$} (138:1cm); + + % angle + \draw[fill=gray!30] (0,0) -- (138:0.75cm) arc (138:90:0.75cm); + \draw (110:0.5cm) node {$\varphi$}; + + % winkelbogen + \draw[lime] (138:1cm) arc (138:90:1cm); + \node[lime] at (-0.2,0.85) {$x$} ; + + % height + \draw[blue] (0,1cm) -- node[anchor=west] {$h$} (0, 1.5cm); + + \node at (0,-0.2) {Erde} ; + +\end{tikzpicture} + + + Gesucht ist die Länge des neongrün hervorgehobenen Kreisbogens x. + + \subsection{Rechenweg} + \begin{align} + x &= \text{Umfang} \cdot \frac{\phi}{360^\circ} \\ + &= 2 \cdot r \cdot \pi \cdot \frac{cos^{-1}(\frac{r}{r+h})}{360^\circ} \\ + &= 2 \cdot 6370 \text{km} \cdot \pi \cdot \frac{cos^{-1}(\frac{6370}{6370,83})}{360^\circ} \\ + &= 102,8 \text{km} + \end{align} + + \subsection{Antwort} + Bei optimalen, also unrealistischen, Bedingungen könnte man die Spitze + des Burdsch Chalifa noch in 102,8 km entfernung sehen. Dies entspricht + übrigens auch dem Punkt auf der Erdoberfläche, der vom Burdsch Chalifa + am weitesten entfernt und zu sehen ist.\\ + Auch wenn nur die Luftlinie gemessen wird, sind es 102,8 km, da der + Erdradius bedeutend größer als der Burdsch Chalifa ist.\\ + \\ + Laut Bildzeitung kann man die Spitze des Burdsch Chalifa noch in 95 km + sehen\footnote{http://www.bild.de/lifestyle/bams/burj-chalifa/burj-chalifa-bei-dieser-story-wurde-uns-schwindelig-828-meter-11056462.bild.html vom 10. Juni 2010. Abgerufen am 28. Mai 2011.} + + \section{Erweiterung der Aufgabenstellung} + Das Dorf Mileiha liegt direkt östlich vom Burdsch Chalifa + (25$^\circ$ 11' 50'' N, 55$^\circ$ 16' 27'' O). \\ + Wie weit östlich darf das Dorf maximal liegen, damit man die Spitze des + Burdsch Chalifa bei optimalen Bedingungen noch sehen kann?\\ + Hinweis: Es gelten noch immer die gleichen Voraussetzungen wie im ersten + Teil der Aufgabe. + + \subsection{Situationsskizze} +\begin{tikzpicture}[scale=3.5,dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt, + outer sep=-1pt}] + \draw[fill=sky!20] (180:1.2cm) arc (180:0:1.2cm); + \draw[fill=brown!20] (180:1cm) arc (180:0:1cm); + \draw (-1.2cm,0) -- node {} (1.2cm, 0); + \draw (0,0) -- node {} (0, 1cm); + \node at (0,1.1cm) {N} ; + + \coordinate (DEnd) at (0.867cm,0.5cm) ; + \draw[dashed] (-0.86cm,0.5cm) -- node[above] {} (DEnd); + + \node[above] at (-0.4cm, 0.45cm) {25. Breitengrad}; + \node[above, text width=1cm] at (0.15cm, 0.5cm) {\scriptsize Burdsch\\Chalifa}; + \node[above, text width=1cm] at (0.7cm, 0.5cm) {\scriptsize Mileiha}; + + \path [decorate, + decoration={ + text along path, + text={6370 km}, + text align={align=center} + } + ] (0,0) -- (DEnd); + \draw (0,0) -- node {} (DEnd); + \draw[arrows={stealth-stealth}] (-1cm,-0.05cm) -- node[below] {6370 km} (0,-0.05cm); + + \node[dot, lgreen] at (0.2cm,0.5cm) (S) {}; + \node[dot, lgreen] at (0.5cm,0.5cm) (E) {}; + + + + \draw[lgreen, thick] (S) -- node {} (E); + + \begin{scope}[shift={(DEnd)}] + \draw[fill=gray!20] (0,0) -- (180:0.3cm) arc (180:210:0.3cm); + \draw (195:0.2cm) node {$\scriptstyle 25^\circ$}; + \end{scope} + + + +\end{tikzpicture} + + Gesucht ist die grün eingezeichnete Kurve, die sich über die + Erdoberfläche krümmt. Ihre Länge sei x.\\ + Um diese zu berechnen, müssen wir wissen welchen Radius die Kreisfläche + hat, die entsteht, wenn man die Erde am 25. Breitengrad schneidet. Der + Radius dieser Kreisfläche sei $r_{25}$. + \subsection{Berechnung} + \begin{align} + \text{Breitengrad} &= 25 + \frac{11}{60} + \frac{50}{60 \cdot 60} \\ + \text{Breitengrad} &= \frac{9071}{360} \approx 25,1972 \\ + cos(\frac{9071}{360}) &= \frac{r_{25,1972}}{6370\text{km}} \\ + r_{25,1972} &= cos(\frac{9071}{360}) \cdot 6370\text{km} \\ + r_{25,1972} &\approx 5764\text{km} + \end{align} + Der soeben errechnete Radius kann einfach in die im ersten Abschnitt + erarbeitete Formel eingesetzt werden: + \begin{align} + x &= 2 \cdot r \cdot \pi \cdot \frac{cos^{-1}(\frac{r}{r+h})}{360^\circ} \\ + &= 2 \cdot 5764 \text{km} \cdot \pi \cdot \frac{cos^{-1}(\frac{5764}{5764,83})}{360^\circ} \\ + &\approx 97,8 \text{km} + \end{align} + Nun sollte man noch berücksichtigen, dass die Beobachter wohl nicht auf + der Erde kriechen, sondern ihre Augen in einer Höhe von ca. 1,6m sind: + \begin{align} + x &= 2 \cdot 5764 \text{km} \cdot \frac{\pi}{360^\circ} \cdot ( cos^{-1}(\frac{5764}{5764,83}) + cos^{-1}(\frac{5764}{5764,0016}) \\ + &\approx 102 \text{km} + \end{align} + + \subsection{Antwort} + Der am weitesten entfernte Punkt, der direkt östlich vom Burdsch Chalifa + steht und von dem aus die Spitze des Burdsch Chalifa unter optimalen + Bedinungen noch erkannt werden kann, liegt ca. 102 km entfernt. \\ + \\ + Anmerkung: Mileiha liegt ca. 60 km vom Burdsch Chalifa entfernt. Er + müsste also von Mileiha zu sehen sein. +\end{document} diff --git a/documents/mathe-burdsch-chalifa/Makefile b/documents/mathe-burdsch-chalifa/Makefile new file mode 100644 index 0000000..706049d --- /dev/null +++ b/documents/mathe-burdsch-chalifa/Makefile @@ -0,0 +1,6 @@ +make: + pdflatex Burdsch-Chalifa.tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.out diff --git a/documents/stundenplan/Makefile b/documents/stundenplan/Makefile new file mode 100755 index 0000000..beb5847 --- /dev/null +++ b/documents/stundenplan/Makefile @@ -0,0 +1,6 @@ +make: + pdflatex example.tex -output-format=pdf + make clean + +clean: + rm -rf *.aux *.log diff --git a/documents/stundenplan/example.tex b/documents/stundenplan/example.tex new file mode 100755 index 0000000..17bb166 --- /dev/null +++ b/documents/stundenplan/example.tex @@ -0,0 +1,55 @@ +\documentclass[a4paper,10pt]{report} + +% Definitions +\usepackage{lscape} +\usepackage[height=25cm]{geometry} +\usepackage{timetable} + +\geometry{top=2cm,left=1cm,right=1cm,bottom=3cm} + +\begin{document} +\thispagestyle{empty} +\begin{landscape} +\noindent\printheading{Stundenplan von Martin Thoma - 3. Semester} + +% Define the layout of your time tables +\setslotsize{2.8cm}{0.3cm} +\setslotcount {5} {44} +\settopheight{3} +\settextframe{0.8mm} + +% Retro +\setframetype[t]{1} +\seteventcornerradius{0pt} + +% Print timestamps into event blocks +%\setprinttimestamps{2} + +% Define event types +\defineevent{lecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0} +\defineevent{exercise-course} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0} +\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{icpc} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0} + +% Start the time table +\begin{timetable} + \hours{8}{15}{1} + \germandays{1} + \event 1 {0800} {0930} {Analysis III} {Schmöger} {10.21 Benz} {lecture} + \event 1 {0945} {1115} {Betriebssysteme} {Beigl} {10.32 Nusselt} {lecture} + \event 1 {1400} {1530} {Digitaltechnik} {Asfour} {50.35 HS a. F.} {lecture} + + \event 2 {0945} {1115} {Betriebssysteme} {Beigl} {20.40 HS 37} {lecture} + \event 2 {1545} {1715} {Algorithmen II} {Wagner} {30.46 Neue Chemie} {lecture} + + \event 3 {1400} {1530} {Digitaltechnik} {Asfour} {50.35 HS a. F.} {lecture} + + \event 4 {1545} {1715} {Algorithmen II} {Wagner} {30.21 Gerthsen} {lecture} + + \event 5 {1130} {1300} {Analysis III} {Schmoeger} {10.11 Hertz} {lecture} + \event 5 {1545} {1715} {Analysis III} {Bolleyer} {10.21 Daimler} {exercise-course} +\end{timetable} + +\end{landscape} +\end{document} diff --git a/documents/stundenplan/manual.tex b/documents/stundenplan/manual.tex new file mode 100755 index 0000000..75f5d54 --- /dev/null +++ b/documents/stundenplan/manual.tex @@ -0,0 +1,295 @@ +\documentclass[a4paper,10pt]{article} + +% Definitionen +\usepackage{lscape} +\usepackage{listings} +\usepackage[left=4cm,right=4cm]{geometry} +\usepackage{timetable} +\usepackage{bold-extra} + +\lstset{language=[LaTeX]TeX, basicstyle=\ttfamily, basewidth=0.51em, morekeywords={\settopheight, \setbottomspace, \setbottomstyle, \settimestyle, \setprinttimestamps, \printheading,\setslotsize,\setslotcount,\settextframe,\englishdays,\germandays,\timemark,\daymark,\hours,\event,\defineevent,\slotevent,\setframetype,\seteventcornerradius}} + +\title{\texttt{timetable} package for \LaTeX\\\normalsize Version 1.41} +\author{Pascal Gwosdek\\\small Modifications by Daniel Bader} + +\begin{document} +\maketitle + +\section{Introduction} +Still, in times when organisers are freely available on the net, there is need for a way to print out timetables. Such lists shall not only be informative and contain details suchas speaker, location, and time. They should also be pleasing to the eye and immediately reveal the information they contain. What else could be used for this task, if not \LaTeX? + +The present version of \texttt{timetable} is fully compatible to version 1.3, and extends it by a new \texttt{pdflatex} support for which the backend has been entirely redesigned, as well as by several `look\&feel' features. The design including colours and font faces can now be redefined. Note that like its predecessor, generation 1.4 is not compatible to 1.2 and below. + +\section{Command reference} +Like in many other \LaTeX\ packages, macros are split into declaration part and body instructions: + +\subsection{Declaration} +The commands presented in this section can be called at any time before the body is being processed, but do not necessarily need to be put before the \lstinline{\begin}\texttt{\{document\}} tag. Instead, it might even be better to define these things within the document section, as this allows different configurations for several time tables appearing within one large document. + +\subsubsection{Layout} +The general layout can be defined by these macros: +\begin{description} +\item \lstinline!\setslotsize{width}{height}! defines the dimensions of the time slots themselves, standard is 2.8cm$\times$1.2cm. +\item \lstinline!\setslotcount{columns}{rows}! specifies how many of these slots there are, $5\times9$ is predefined. +\item \lstinline!\settextframe{width}! changes the padding of text inside coloured boxed to be different than 0.8mm. +\item \lstinline!\settopheight{rows}! specifies how many slot heights the grey bar at the top should last, the default value is 2. +\item \lstinline!\setbottomspace{width}! sets the distance of the small entries at the bottom of each cell to some value different to 8pt. +\item \lstinline!\setbottomstyle{fontsize}! redefines the font size of the footlines in event blocks. It defaults to \lstinline!\scriptsize!. +\item \lstinline!\settimestyle{fontsize}! redefines the font size of the optional time labels in event blocks. It defaults to \lstinline!\tiny!. +\item \lstinline!\setprinttimestamps{type}! includes timestamps at top and bottom, if set to 1, and timestamps at the top, if set to 2. +\item \lstinline!\setframetype[valign]{type}! changes the frame style. \texttt{type} can either be 1 (entries separated by lines), or 2 (entries in checkerboard layout (default)).\texttt{valign} can be one of \texttt{t} (top), \texttt{c} (centered), or \texttt{b} (bottom). +\item \lstinline!\seteventcornerradius{radius}! defines event corners to be rounded. Admissible values for \texttt{radius} are [0pt..7pt], default is 3pt. +\end{description} +In addition, one may redefine the following default colours: +\begin{description} +\item \lstinline!ttframecol1! is the (brighter) frame colour.\\ Default: RGB 0.8,0.8,0.8. +\item \lstinline!ttframecol2! is the (darker) frame colour.\\ Default: RGB 0.7,0.7,0.7. +\item \lstinline!ttfontcolour! is the frame font colour.\\ Default: Black. +\item \lstinline!ttlinecol1! is the colour of the outer boundary line.\\ Default: Black. +\item \lstinline!ttlinecol2! is the colour of the boundary line separating frame and display area.\\ Default: Black. +\end{description} +Furthermore, one may influence the shape of the output font: +\begin{description} +\item \lstinline!\timetablefont! can be redefined with something else than \lstinline!\sffamily!. +\end{description} + +\subsubsection{Event types}\label{defineevent} +Event types are nothing more than colour combinations, which are given intuitive, i.e. associative, names. After their name, red, green and blue components for the box and text are specified as values between 0 and 1, respectively: +\begin{lstlisting} +\defineevent{lecturetype}{red}{green}{blue}{text red}{text green}{text blue} +\end{lstlisting} + +\subsection{Body} +\subsubsection{Heading} +The heading can be inserted with the \lstinline{\printheading} command: +\begin{lstlisting} +\printheading{Text for the heading} +\end{lstlisting} + +\subsubsection{Left caption} +There are two possibilities for the left caption. The native method is given by the +\begin{lstlisting} +\timemark{1st entry} +\timemark{2nd entry} +... +\end{lstlisting} +macro. Each time the command is called, a new time stamp is being added to the next free line. Alternatively, the +\begin{lstlisting} +\hours{Start time}{Time slot duration}{Print destination?} +\end{lstlisting} +command fills the column with entries of type "$n:00$" or "$n:00 - (n+1):00$", depending on whether \lstinline{Print destination?} is 0 or 1, respectively. $n$ denotes hereby the start time. Just see the results displayed in Appendix A and B, they are generated by this macro. Overflows (i.e. midnight) are handled correctly. + +\subsubsection{Upper caption} +Similarly, the top line can also be filled in two ways. +\begin{lstlisting} +\daymark{1st entry} +\daymark{2nd entry} +... +\end{lstlisting} +is the analogon to the \lstinline{\timemark} macro, while +\begin{lstlisting} +\englishdays{Start day} +\end{lstlisting} +or +\begin{lstlisting} +\germandays{Start day} +\end{lstlisting} +fills the row with day names, starting at the day given as argument (where 1 denotes monday). Again, see the reference in Appendix A to see what it looks like. + +\subsubsection{Events} +\subsubsection*{The \lstinline{\\event} macro} +The perhaps most important macro is given by +\begin{lstlisting} +\event {day number} {start time} {end time} + {name} {lecturer} {location} {type} +\end{lstlisting} +Each of these commands allocates a new event block on the specified day from \lstinline{start time} to \lstinline{end time}, whereby the times are given in the format `0815' for `a quarter past 8'. The block is assigned the type identifier defining background and text colour (see \ref{defineevent}). Note that if \lstinline{\hours} has not been called before, start time and end time fall back to the block number, i.e. \lstinline{\slotevent} is invoked with \lstinline{y = start time} and \lstinline{duration = end time - start time}. + +\subsubsection*{The \lstinline{\\slotevent} macro} +\begin{lstlisting} +\slotevent {x} {y} {duration} + {name} {lecturer} {location} {type} +\end{lstlisting} +Each of these macros specifies one event block in position, duration (i.e. length in time slots), certain full text parameters and finally the type defining background and text colour (see \ref{defineevent}). + +%\newpage +\begin{appendix} +\begin{landscape} +\section{Sample time table (Standard Parameters)} +\subsection{Rendering} + +% Define the layout of your time tables +\setslotsize{2.8cm}{0.26cm} +\setslotcount {5} {36} +\settextframe{0.8mm} + +% Define event types +\defineevent{corelecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0} +\defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0} +\defineevent{work} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0} + +% Start the time table +\printheading{Time table $6^\mathsf{th}$ Semester} +\begin{timetable} + \hours{9}{15}{1} + \englishdays{1} + \event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} + \event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny 1} HaDePra} {work} + \event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny 1} 3.06} {seminar} + \event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 5 {1000} {1100} {Bremser Meeting} {SysArch United} {E1{\tiny 3}} {work} + \event 5 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} +\end{timetable} +\end{landscape} + +\begin{landscape} +\subsection{Source code} +\begin{lstlisting} +\documentclass[a4paper,10pt]{report} + +% Definitions +\usepackage{lscape} +\usepackage[height=25cm]{geometry} +\usepackage{timetable} + +\begin{document} +\thispagestyle{empty} +\begin{landscape} +% Define the layout of your time tables +\setslotsize{2.8cm}{0.26cm} +\setslotcount {5} {36} +\settextframe{0.8mm} + +% Define event types +\defineevent{corelecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0} +\defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0} +\defineevent{work} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0} + +% Start the time table +\printheading{Time table $6^\mathsf{th}$ Semester} +\begin{timetable} + \hours{9}{15}{1} + \englishdays{1} + \event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} + \event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny 1} HaDePra} {work} + \event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny 1} 3.06} {seminar} + \event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 5 {1000} {1100} {Bremser Meeting} {SysArch United} {E1{\tiny 3}} {work} + \event 5 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} +\end{timetable} +\end{landscape} +\end{document} +\end{lstlisting} +\end{landscape} + +\begin{landscape} +\section{Sample time table (Customised Variant)} +\subsection{Rendering} +\printheading{Stundenplan 6. Semester} + +% Define the layout of your time tables +\setslotsize{2.8cm}{0.26cm} +\setslotcount {5} {36} +\settextframe{0.8mm} +\setbottomstyle{\tiny} +\setbottomspace{1pt} +\setprinttimestamps{2} +\setframetype[t]{1} +\seteventcornerradius{0pt} +\definecolor{ttframecol2}{rgb}{0.9,0.9,0.9} + +% Define event types +\defineevent{corelecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0} +\defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0} +\defineevent{work} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0} + +% Start the time table +\begin{timetable} + \hours{9}{15}{0} + \germandays{1} + \event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} + \event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny 1} HaDePra} {work} + \event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny 1} 3.06} {seminar} + \event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 5 {1000} {1100} {Bremser Meeting} {SysArch United} {E1{\tiny 3}} {work} + \event 5 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} +\end{timetable} +\end{landscape} + +\begin{landscape} +\subsection{Source code} +\begin{lstlisting} +\documentclass[a4paper,10pt]{report} + +% Definitions +\usepackage{lscape} +\usepackage[height=25cm]{geometry} +\usepackage{timetable} + +\begin{document} +\thispagestyle{empty} +\begin{landscape} +\printheading{Stundenplan 6. Semester} + +% Define the layout of your time tables +\setslotsize{2.8cm}{0.26cm} +\setslotcount {5} {36} +\settextframe{0.8mm} +\setbottomstyle{\tiny} +\setbottomspace{1pt} +\setprinttimestamps{2} +\setframetype[t]{1} +\seteventcornerradius{0pt} +\definecolor{ttframecol2}{rgb}{0.9,0.9,0.9} + +% Define event types +\defineevent{corelecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0} +\defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0} +\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0} +\defineevent{work} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0} + +% Start the time table +\begin{timetable} + \hours{9}{15}{0} + \germandays{1} + \event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} + \event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny 1} HaDePra} {work} + \event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture} + \event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny 1} 3.06} {seminar} + \event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture} + \event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work} + \event 5 {1000} {1100} {Bremser Meeting} {SysArch United} {E1{\tiny 3}} {work} + \event 5 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture} +\end{timetable} +\end{landscape} +\end{document} +\end{lstlisting} +\end{landscape} + +\end{appendix} +\end{document} diff --git a/documents/stundenplan/timetable.sty b/documents/stundenplan/timetable.sty new file mode 100755 index 0000000..2582222 --- /dev/null +++ b/documents/stundenplan/timetable.sty @@ -0,0 +1,551 @@ +% timetable.sty - The LaTeX timetable stylesheet V1.4 +% http://www.planetk.de/index.php?title=Stundenplan +% +% Copyright (C) 2007-2009 Pascal Gwosdek +% Modifications (C) 2008 Daniel Bader +% +% This program 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 program 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 program; if not, see . +% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{timetable} +\RequirePackage{ifthen, calc, color} + +% Preset the colors +\definecolor{ttframecol1}{rgb}{0.8,0.8,0.8} +\definecolor{ttframecol2}{rgb}{0.7,0.7,0.7} +\definecolor{ttfontcolor}{rgb}{0.0,0.0,0.0} +\definecolor{ttlinecol1}{rgb}{0.0,0.0,0.0} +\definecolor{ttlinecol2}{rgb}{0.0,0.0,0.0} + +% Simple for loop construct as proposed by N. Setzer +\newcommand{\@ttforloop}[5][1] +{ + \setcounter{#2}{#3} + \ifthenelse{#4} + { + #5 + \addtocounter{#2}{#1} + \@ttforloop[#1]{#2}{\value{#2}}{#4}{#5} + } + {} + } + +% SansSerif font +\newcommand{\timetablefont}{\sffamily} +\newcommand{\@ttfont}{\timetablefont\selectfont} + +% Dimensions +\newlength{\@rowheight} +\newlength{\@colwidth} +\newcounter{@rowcount} +\newcounter{@colcount} +\newlength{\@textframe} +\newlength{\@bottomspace} +\newlength{\@totalheight} +\newlength{\@totalwidth} +\newlength{\@toprowheight} + +% Arbitrary stuff +\newcounter{@timemarks} +\newcounter{@daymarks} +\newcounter{@topheight} +\newcounter{@printtimestamps} +\newlength{\@cornerradius} +\newcounter{@frametype} +\newcounter{@framevalign} + +% Predefines +\setlength{\@cornerradius}{3pt} +\setcounter{@frametype}2 +\setcounter{@framevalign}2 +\setlength{\@rowheight}{1.2cm} +\setlength{\@colwidth}{2.8cm} +\setlength{\@textframe}{0.8mm} +\setlength{\@bottomspace}{8pt} +\setcounter{@rowcount}9 +\setcounter{@colcount}5 +\setcounter{@topheight}{2} +\setcounter{@printtimestamps}{0} +\newcommand{\@bottomstyle}{\scriptsize} +\newcommand{\@timestyle}{\tiny} + +% Event declarations +\newlength{\@startposx} +\newlength{\@startposy} +\newlength{\@eventheight} +\newlength{\@newcolwidth} +\newlength{\@newrowheight} +\newlength{\@newcolleft} +\newlength{\@newrowtop} + +% Helpers +\newcounter{@hourslot} +\newcounter{@durationslots} +\newcounter{@minutesperslot} +\newcounter{@timetablehelp} + +\newcounter{@day} +\newcounter{@column} +\newcounter{@row} +\newcounter{@hour} +\newcounter{@minute} +\newcounter{@minuteStep} +\newcounter{@startHour} +\newcounter{@startMinute} +\newcounter{@endHour} +\newcounter{@endMinute} +\newcounter{@hoursset} +\setcounter{@hoursset}{0} +\newcounter{@hourzero} + +\newcommand{\seteventcornerradius}[1] +{ + \setlength{\@cornerradius}{#1} + \ifthenelse{\strip@pt\@cornerradius > 7} + { + \setlength{\@cornerradius}{7pt} + } + { + \ifthenelse{\strip@pt\@cornerradius < 0} + { + \setlength{\@cornerradius}{0pt} + } + {} + } +} + +\newcommand{\settopheight}[1] +{ + \addtocounter{@rowcount}{#1-\value{@topheight}} + \setcounter{@topheight}{#1} +} + +\newcommand{\setframetype}[2][c] +{ + % Set frame type + \ifthenelse{#2 < 1} + { + % Lines + \setcounter{@frametype}{1} + } + { + \ifthenelse{#2 > 2} + { + % Checkerboard + \setcounter{@frametype}{2} + } + { + \setcounter{@frametype}{#2} + } + } + + % Caption vertical alignment + \ifthenelse{\equal{#1}{b}} + {\setcounter{@framevalign}{1}} + {\ifthenelse{\equal{#1}{t}} + {\setcounter{@framevalign}{0}} + {\setcounter{@framevalign}{2}} + } +} + +\newcommand{\setprinttimestamps}[1] +{ + \setcounter{@printtimestamps}{#1} +} + +\newcommand{\setbottomstyle}[1] +{ + \renewcommand{\@bottomstyle}{#1} +} + +\newcommand{\settimestyle}[1] +{ + \renewcommand{\@timestyle}{#1} +} + +\newcommand{\setbottomspace}[1] +{ + \setlength{\@bottomspace}{#1} +} + +\newcommand{\@fmtTime}[2] +{ + % Arguments: {hour}{minute} + \ifthenelse{\value{#1} < 10}{0}{}\arabic{#1}:\ifthenelse{\value{#2} < 10}{0}{}\arabic{#2} +} + +\newcommand{\slotevent}[7] + { + % Arguments: {x}{y}{duration}{title}{lecturer}{place}{type}{textcolor} + \renewcommand{\baselinestretch}{0.75}\normalsize + + \setlength{\@startposx}{#1\@colwidth+0.5pt} + \setlength{\@startposy}{-#2\@rowheight-1.5pt} + \setlength{\@eventheight}{#3\@rowheight-1pt} + \addtolength{\@startposy}{-\@eventheight} + + \addtolength{\@startposx}{\@cornerradius} + \put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\rule[-\dp\strutbox]{\@colwidth-1pt-2\@cornerradius}{\@eventheight}}} + \addtolength{\@startposx}{-\@cornerradius} + \addtolength{\@startposy}{\@cornerradius} + \put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\rule[-\dp\strutbox]{\@colwidth-1pt}{\@eventheight-2\@cornerradius}}} + \addtolength{\@startposy}{-\@cornerradius} + + \setlength{\@cornerradius}{2\@cornerradius} + + \ifthenelse{\strip@pt\@cornerradius > 0} + { + % Left rounded corners + \addtolength{\@startposx}{.5\@cornerradius} + \addtolength{\@startposy}{.5\@cornerradius-\dp\strutbox} + \put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}} + \addtolength{\@startposy}{-.5\@cornerradius+\dp\strutbox} + \addtolength{\@startposy}{-.5\@cornerradius-\dp\strutbox+\@eventheight} + \put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}} + \addtolength{\@startposy}{.5\@cornerradius+\dp\strutbox-\@eventheight} + \addtolength{\@startposx}{-.5\@cornerradius} + + % Right rounded corners + \addtolength{\@startposx}{-.5\@cornerradius+\@colwidth-1pt} + \addtolength{\@startposy}{.5\@cornerradius-\dp\strutbox} + \put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}} + \addtolength{\@startposy}{-.5\@cornerradius+\dp\strutbox} + \addtolength{\@startposy}{-.5\@cornerradius-\dp\strutbox+\@eventheight} + \put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}} + \addtolength{\@startposy}{.5\@cornerradius+\dp\strutbox-\@eventheight} + \addtolength{\@startposx}{.5\@cornerradius-\@colwidth-1pt} + }{} + + \setlength{\@cornerradius}{0.5\@cornerradius} + + \setlength{\@newrowheight}{\@rowheight} + \addtolength{\@newrowheight}{-2\@textframe-1pt} + \setlength{\@newcolwidth}{\@colwidth} + \addtolength{\@newcolwidth}{-2\@textframe-1pt} + + \setlength{\@newrowtop}{-#2\@rowheight} + \addtolength{\@newrowtop}{-2\@textframe} + \setlength{\@newcolleft}{#1\@colwidth+.5pt} + \addtolength{\@newcolleft}{\@textframe} + + \ifthenelse{\value{@hoursset} = 0}{\setcounter{@printtimestamps}{0}}{} + + % Title + \addtolength{\@newrowtop}{-1pt} + \put(\strip@pt\@newcolleft,\strip@pt\@newrowtop) + {\begin{minipage}[t]{\@newcolwidth}% + \@ttfont\raggedright\color{@timetable#7text}% + \ifthenelse{\value{@printtimestamps} > 0}% + {{\@timestyle \@fmtTime{@startHour}{@startMinute}}% + \ifthenelse{\value{@printtimestamps} = 2}% + {{\@timestyle -- \@fmtTime{@endHour}{@endMinute}}}% + {}% + \\}% + {}% + {#4}% + \end{minipage}} + \addtolength{\@newrowtop}{1pt} + + \renewcommand{\baselinestretch}{0.5}\normalsize + \setlength{\@newrowtop}{-#2\@rowheight-#3\@rowheight} + \addtolength{\@newrowtop}{2\@textframe + \@bottomspace} + + % Lecturer + \put(\strip@pt\@newcolleft,\strip@pt\@newrowtop) + {\begin{minipage}[t]{0.6\@newcolwidth}% + \@ttfont\raggedright\color{@timetable#7text}{\@bottomstyle #5% + \vphantom{A}} + \ifthenelse{\value{@printtimestamps} = 1}% + {{\@timestyle \@fmtTime{@endHour}{@endMinute}}}% + {}% + \end{minipage}} + + \setlength{\@newcolleft}{#1\@colwidth + \@colwidth} + \addtolength{\@newcolleft}{-\@textframe-0.4\@newcolwidth} + + % Location + \put(\strip@pt\@newcolleft,\strip@pt\@newrowtop) + {\begin{minipage}[t]{0.4\@newcolwidth}% + \@ttfont\raggedleft\color{@timetable#7text}{\@bottomstyle #6% + \vphantom{A}}% + \end{minipage}} + + \renewcommand{\baselinestretch}{1.0}\normalsize + } + +\newcommand{\event}[7] + { + % Arguments: {@day}{@start}{@end}{title}{lecturer}{place}{type} + + % Use the time format, if hours are defined, and a slot number otherwise: + \ifthenelse{\value{@hoursset} > 0} + { + \setcounter{@startHour}{#2 / 100} + \setcounter{@startMinute}{#2 - #2 / 100 * 100} + + \setcounter{@endHour}{#3 / 100} + \setcounter{@endMinute}{#3 - #3 / 100 * 100} + + \setcounter{@hourslot}{((#2 - \value{@hourzero}) / 100 * (60 / \value{@minutesperslot})) + 2 + ((#2 - #2 / 100 * 100) / \value{@minutesperslot})} + \setcounter{@durationslots}{((#3 - \value{@hourzero}) / 100 * (60 / \value{@minutesperslot})) + 2 + ((#3 - #3 / 100 * 100) / \value{@minutesperslot}) - \value{@hourslot}} + + % Compensate for 24h wrap + \ifthenelse{\value{@hourslot} < 0}{\addtocounter{@hourslot}{(24 * (60 / \value{@minutesperslot}))}}{} + + \addtocounter{@hourslot}{\value{@topheight}-2} + } + { + \setcounter{@hourslot}{#2} + \setcounter{@durationslots}{#3-#2} + } + + \slotevent{#1}{\value{@hourslot}}{\value{@durationslots}}{#4}{#5}{#6}{#7} + } + +\newcommand{\legend}[3] + { + % Arguments: + % Lets you manually set slot contents (use this really rarely and + % SEE: \daymark, \timemark ) + + \setlength{\@newrowtop}{\@rowheight*(-#2+1)-\dp\strutbox} + \setlength{\@newcolleft}{#1\@colwidth-\@colwidth} + + \ifthenelse{\value{@hoursset} = 0} + {\setcounter{@minutesperslot}{60}} + {} + + % Select frame type + \ifthenelse{\value{@frametype} = 1} + { % Lines + \ifthenelse{#1 = 1}{\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop){\textcolor{ttframecol2}{\rule{\@colwidth}{1pt}}}}{} + \addtolength{\@newrowtop}{-\value{@topheight}\@rowheight} + \addtolength{\@newcolleft}{-1pt} + \ifthenelse{#2 = 1}{\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop){\textcolor{ttframecol2}{\rule{1pt}{\value{@topheight}\@rowheight}}}}{} + \addtolength{\@newcolleft}{1pt} + \addtolength{\@newrowtop}{\value{@topheight}\@rowheight} + } + { % Checkerboard + % Horizontal stripe + \ifthenelse{#2 = 1} + {\setcounter{@timetablehelp}{#1 * \real{0.5} * \real{2.0}} + \ifthenelse{\value{@timetablehelp} = #1} + {\addtolength{\@newrowtop}{-\value{@topheight}\@rowheight} + \put(\strip@pt\@newcolleft,\strip@pt\@newrowtop) + {\textcolor{ttframecol2}{\rule{\@colwidth}{\value{@topheight}\@rowheight}}} + \addtolength{\@newrowtop}{\value{@topheight}\@rowheight} + } + {} + } + {} + % Vertical stripe + \ifthenelse{#1 = 1} + {\setcounter{@timetablehelp}{(((#2-\value{@topheight}-1) * \value{@minutesperslot} / 120) * 2) - ((#2-\value{@topheight}-1) * \value{@minutesperslot} / 60)} + \ifthenelse{\value{@timetablehelp} = 0} + {\setcounter{@timetablehelp}{60 / \value{@minutesperslot}} + \addtolength{\@newrowtop}{-\value{@timetablehelp}\@rowheight} + \put(\strip@pt\@newcolleft,\strip@pt\@newrowtop) + {\textcolor{ttframecol2}{\rule{\@colwidth}{\value{@timetablehelp}\@rowheight}}} + \addtolength{\@newrowtop}{\value{@timetablehelp}\@rowheight} + } + {} + } + {} + } + + % Print text + \addtolength{\@newcolleft}{\@textframe} + \addtolength{\@newrowtop}{-\@textframe-\heightof{\large #3}} + + % Optionally move caption to middle or bottom + \ifthenelse{\value{@framevalign} > 0} + { + \ifthenelse{#1 = 1} + { + \addtolength{\@newrowtop}{(- \@rowheight * (60 / \value{@minutesperslot}) + 2\@textframe + \heightof{\Large #3})/\value{@framevalign}} + } + { + \ifthenelse{#2 = 1} + { + \addtolength{\@newrowtop}{(- \value{@topheight}\@rowheight + 2\@textframe + \heightof{\Large #3})/\value{@framevalign}} + }{} + } + }{} + + \put(\strip@pt\@newcolleft,\strip@pt\@newrowtop){\makebox{\textcolor{ttfontcolor}{\@ttfont\large #3}}} + } + +\newcommand{\timemark}[1] + { + \stepcounter{@timemarks} + \legend 1 {\value{@timemarks}} {#1} + } + +\newcommand{\daymark}[1] + { + \stepcounter{@daymarks} + \legend {\value{@daymarks}} 1 {#1} + } + +\newcommand{\defineevent}[7] + { + \definecolor{@timetable#1block}{rgb}{#2, #3, #4} + \definecolor{@timetable#1text} {rgb}{#5, #6, #7} + } + +\newcommand{\printheading}[1] + { + {\@ttfont\LARGE #1}\par\vspace{5mm}\par + } + +\newcommand{\setslotsize}[2] + { + % Arguments: + % Defines the slot size + + \setlength{\@rowheight}{#2} + \setlength{\@colwidth}{#1} + } + +\newcommand{\setslotcount}[2] + { + % Arguments: + % Defines the number of slots in both dimensions + + \setcounter{@colcount}{#1} + \setcounter{@rowcount}{#2+\value{@topheight}} + + \stepcounter{@colcount} + } + +\newcommand{\settextframe}[1] + { + % Arguments: + % Defines the width of the border of each entry (i.e. the + % distance between outer border and text) + + \setlength{\@textframe}{#1} + } + +\newcommand{\hours}[3] + { + % Arguments: + % Automatically sets the time slots to full hours, beginning with + + \setcounter{@hoursset}{1} + \setcounter{@hourzero}{(#1 * 100)} + + \setcounter{@hour}{#1} + \setcounter{@minute}{0} + \setcounter{@minuteStep}{#2} + \setcounter{@minutesperslot}{\value{@minuteStep}} + + \@ttforloop{@row}{\value{@topheight}}{\value{@row} < \value{@rowcount}} + { + \ifthenelse{\value{@minute} = 0}{ + \timemark{\@fmtTime{@hour}{@minute}\ifthenelse{#3 > 0}{-\setcounter{@hour}{\value{@hour}+1}\@fmtTime{@hour}{@minute}\setcounter{@hour}{\value{@hour}-1}}{}} + }{\stepcounter{@timemarks}} + \addtocounter{@minute}{#2} + \ifthenelse{\value{@minute} = 60}{\stepcounter{@hour}\setcounter{@minute}{0}}{} + \ifthenelse{\value{@hour} > 23}{\addtocounter{@hour}{-24}}{} + } + } + +\newcommand{\englishdays}[1] + { + % Arguments: + % Macro for the english week days + + \setcounter{@day}{#1} + + \@ttforloop{@column}{1}{\value{@column} < \value{@colcount}} + { + \ifthenelse{\equal{\value{@day}}1}{\daymark{Monday}}{} + \ifthenelse{\equal{\value{@day}}2}{\daymark{Tuesday}}{} + \ifthenelse{\equal{\value{@day}}3}{\daymark{Wednesday}}{} + \ifthenelse{\equal{\value{@day}}4}{\daymark{Thursday}}{} + \ifthenelse{\equal{\value{@day}}5}{\daymark{Friday}}{} + \ifthenelse{\equal{\value{@day}}6}{\daymark{Saturday}}{} + \ifthenelse{\equal{\value{@day}}7}{\daymark{Sunday}}{} + + \stepcounter{@day} + \ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{} + } + } + +\newcommand{\germandays}[1] + { + % Arguments: + % Macro for the english week days + + \setcounter{@day}{#1} + + \@ttforloop{@column}{1}{\value{@column} < \value{@colcount}} + { + \ifthenelse{\equal{\value{@day}}1}{\daymark{Montag}}{} + \ifthenelse{\equal{\value{@day}}2}{\daymark{Dienstag}}{} + \ifthenelse{\equal{\value{@day}}3}{\daymark{Mittwoch}}{} + \ifthenelse{\equal{\value{@day}}4}{\daymark{Donnerstag}}{} + \ifthenelse{\equal{\value{@day}}5}{\daymark{Freitag}}{} + \ifthenelse{\equal{\value{@day}}6}{\daymark{Samstag}}{} + \ifthenelse{\equal{\value{@day}}7}{\daymark{Sonntag}}{} + + \stepcounter{@day} + \ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{} + } + } + +\newenvironment{timetable}% + {\noindent% + % Arguments: None + % Starts a new timetable + % + % Set the new layout setting + \setlength{\@totalheight}{-\value{@rowcount}\@rowheight}% + \setlength{\@totalwidth}{\value{@colcount}\@colwidth}% + % + % Reset the counters + \setcounter{@timemarks}{\value{@topheight}}% + \setcounter{@daymarks}{1}% + % + % Minipage to correct bounding box + \begin{minipage}[t][-\@totalheight]{\@totalwidth} + % + % Begin. Note the offset hack of the picture, this is to make it consistent to the old pstricks package. + \begin{picture}(\strip@pt\@totalwidth,\strip@pt\@totalheight)(0,-\strip@pt\baselineskip) + % Draw the grey frame + \put(0,\strip@pt\@totalheight){\textcolor{ttframecol1}{\rule[-\dp\strutbox]{\@colwidth}{-\@totalheight}}} + \setlength{\@toprowheight}{\value{@topheight}\@rowheight} + \put(0,-\strip@pt\@toprowheight){\textcolor{ttframecol1}{\rule[-\dp\strutbox]{\@totalwidth}{\@toprowheight}}} + } + { + % Draw the contours + % Inner + \addtolength{\@colwidth}{-1pt} + \put(\strip@pt\@colwidth,-\strip@pt\@toprowheight){\textcolor{ttlinecol2}{\rule[-\dp\strutbox]{\@totalwidth-\@colwidth+1pt}{1pt}}} + \put(\strip@pt\@colwidth,\strip@pt\@totalheight){\textcolor{ttlinecol2}{\rule[-\dp\strutbox]{1pt}{-\@totalheight-\@toprowheight}}} + \addtolength{\@colwidth}{1pt} + + % Outer + \put(0,0){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{\@totalwidth}{1pt}}} + \put(0,\strip@pt\@totalheight){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{1pt}{-\@totalheight}}} + \put(\strip@pt\@totalwidth,\strip@pt\@totalheight){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{1pt}{-\@totalheight+1pt}}} + \addtolength{\@totalheight}{-0.5pt} + \put(0,\strip@pt\@totalheight){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{\@totalwidth}{1pt}}} + \addtolength{\@totalheight}{0.5pt} + \end{picture} + + \end{minipage} + } diff --git a/uml/class-diagramm/Makefile b/uml/class-diagramm/Makefile new file mode 100644 index 0000000..2b173fe --- /dev/null +++ b/uml/class-diagramm/Makefile @@ -0,0 +1,17 @@ +# CHANGELOG +# Version 1.0: Erstellung des Makefile + +# Version des Makefile +fileinfo := LaTeX Makefile +author := Martin Thoma +version := 1.0 + +DATE=$(shell date +%Y-%m-%d) + +make: + mpost meta.mp + pdflatex class-diagram.tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.1 diff --git a/uml/class-diagramm/class-diagram.pdf b/uml/class-diagramm/class-diagram.pdf new file mode 100644 index 0000000..1bacc8b Binary files /dev/null and b/uml/class-diagramm/class-diagram.pdf differ diff --git a/uml/class-diagramm/class-diagram.tex b/uml/class-diagramm/class-diagram.tex new file mode 100644 index 0000000..61c878f --- /dev/null +++ b/uml/class-diagramm/class-diagram.tex @@ -0,0 +1,32 @@ +\documentclass[a4paper]{article} +\usepackage{geometry} + +\geometry{top=1cm,left=1cm,right=1cm,bottom=2cm} + +% The following is needed in order to make the code compatible +% with both latex/dvips and pdflatex. +\ifx\pdftexversion\undefined +\usepackage[dvips]{graphicx} +\else +\usepackage[pdftex]{graphicx} +\DeclareGraphicsRule{*}{mps}{*}{} +\fi + +\pdfinfo{ + /Author (Martin Thoma) + /Title (LittlePraktomat Documentation) + /Subject (LittlePraktomat Documentation) + /Keywords (LaTeX) +} + +\title{LittlePraktomat Documentation} +\author{Martin Thoma} + +\begin{document} + +\maketitle + +\section{UML} +\includegraphics{meta.1} + +\end{document} diff --git a/uml/class-diagramm/meta.mp b/uml/class-diagramm/meta.mp new file mode 100644 index 0000000..fd123aa --- /dev/null +++ b/uml/class-diagramm/meta.mp @@ -0,0 +1,136 @@ +input metauml; +beginfig(1); + Class.LittlePraktomat("LittlePraktomat") + ("-tutors: Set", + "-currentTutor: Tutor", + "-students: Set", + "-tasks: Map", + "-nextTaskId: int", + "-solutions: Set") + ("+addTutor(Tutor): void", + "+addStudent(Student): void", + "+addTask(String): int", + "+containsTutor(Tutor): boolean", + "+containsTask(int): boolean", + "+getCurrentTutor(): Tutor", + "+setCurrentTutor(Tutor): void", + "+getTutors(): Set", + "+getStudents(): Set", + "+getStudentsByStudentNr(int): Student", + "+getTasks(): Map", + "+getSolutionsToTask(): int", + "+getReviewedSolutions(int): int", + "+getDistribution(int): int[]", + "+getStudentsByGrade(): List" + ); + classStereotypes.LittlePraktomat("<>"); + + Class.Person("Person") + ("-name: String", + "+REGEX_NAME: String" + ) + ("+Person(String): void", + "+getName(): String" + ); + + Class.Student("Student") + ("-studentNumber: int", + "+REGEX_STUD_NUMBER: String", + "-myTutor: Tutor", + "-solutions: Map", + ) + ("+Student(String,int,Tutor): void", + "+getStudentNumber(): int", + "+getTutor(): Tutor", + "+getSolution(): int", + "+submitSolution(Solution): void" + ); + classStereotypes.Student("<>", "<>"); + + Class.Review("Review") + ("-grade: int", + "-text: String", + "-solution: Solution" + ) + ("+Review(int,String,Solution): void", + "+getGrade(): int", + "+getText(): String", + "+getSolution(): Solution" + ); + + Class.Solution("Solution") + ("-author: Student", + "-taskID: int", + "-text: String", + "-review: Review" + ) + ("+Solution(int,String,Student): void", + "+getText(): String", + "+getTask(): Task", + "+getAuthor(): Student", + "+getReview(): Review", + "+setReview(Review): void" + ); + + Class.Tutor("Tutor") + ("-students: Set", + "-missingReviews: Set", + "-reviewsDone: Set" + ) + ("+Tutor(String): void", + "+addStudent(Student): void", + "+getStudentCount(): int", + "+review(int,Student,int,String): boolean", + "+addMissingReview(Solution): void", + "+getmissingReviewCount(): int", + "+compareTo(Tutor): int" + ); + classStereotypes.Tutor("<>", "<>"); + + Class.Task("Task") + ("-id: int", + "-text: String", + "-solutions: Set" + ) + ("+Task(int, String): void", + "+addSolution(Solution): void", + "+getText(): String", + "+getId(): int", + "+getSolutions(): Set" + ); + classStereotypes.Task("<>"); + + topToBottom(20)(Student, Person, Tutor, Task); + topToBottom(30)(LittlePraktomat, Review, Solution); + leftToRight(50)(Student, LittlePraktomat); + + + drawObjects(Person, LittlePraktomat, Student, Review, Solution, Tutor, Task); + + + link(inheritance)(pathStepX(Person.n, Student.s, 0)); + link(inheritance)(pathStepX(Person.s, Tutor.n, 0)); + + link(aggregation)(pathStepX(Student.ne + (0, -15), Solution.nw + (0, -19), 20)); + link(aggregation)(pathStepX(Student.n, LittlePraktomat.nw + (0, -50), 0)); + link(aggregation)(pathStepX(Student.nw + (0, -15), Tutor.nw + (0, -33), -30)); + + link(aggregation)(pathStepX(Tutor.nw + (0, -7), Student.nw + (0, -55), -15)); + link(aggregation)(pathStepX(Tutor.nw + (0, -7), LittlePraktomat.nw + (0, -39), -18)); + link(aggregation)(pathStepX(Tutor.nw + (0, -7), LittlePraktomat.nw + (0, -29), -21)); + + link(aggregation)(pathStepX(Task.nw + (0, -7), LittlePraktomat.nw + (0, -60), -50)); + link(aggregation)(pathStepX(Task.ne + (0, -7), Solution.nw + (0, -30), 15)); + + link(aggregation)(pathStepX(Solution.nw + (0, -7), LittlePraktomat.nw + (0, -82), -23)); + link(aggregation)(pathStepX(Solution.nw + (0, -7), Student.ne + (0, -7), -26)); + link(aggregation)(pathStepX(Solution.nw + (0, -7), Student.ne + (0, -66), -29)); + link(aggregation)(pathStepX(Solution.nw + (0, -7), Tutor.ne + (0, -45), -32)); + link(aggregation)(pathStepX(Solution.nw + (0, -59), Task.ne + (0, -50), -20)); + link(aggregation)(pathStepX(Solution.ne + (0, -7), Review.ne + (0, -43), 15)); + + link(aggregation)(pathStepX(Review.ne + (0, -7), Solution.ne + (0, -53), 30)); + link(aggregation)(pathStepX(Review.nw + (0, -7), Tutor.ne + (0, -55), -10)); + +endfig; +end