2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

added math document examples

This commit is contained in:
Martin Thoma 2012-08-13 19:22:43 +02:00
parent a6411a68c8
commit cec677bc0e
16 changed files with 1732 additions and 0 deletions

View file

@ -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}

View file

@ -0,0 +1,6 @@
make:
pdflatex Aufgabe-Blutspende.tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux

View file

@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="706.125"
height="408.40515"
id="svg2"
inkscape:version="0.48.0 r9654"
sodipodi:docname="Burdsch-Chalifa-Erdhalbkugel.svg">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="935"
inkscape:window-height="641"
id="namedview45"
showgrid="false"
inkscape:zoom="1.2291716"
inkscape:cx="203.08528"
inkscape:cy="107.88786"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" />
<defs
id="defs4">
<marker
refX="0"
refY="0"
orient="auto"
id="Arrow1Lend"
style="overflow:visible">
<path
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
id="path3768"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" />
</marker>
<marker
refX="0"
refY="0"
orient="auto"
id="Arrow1Lstart"
style="overflow:visible">
<path
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
transform="matrix(0.8,0,0,0.8,10,0)"
id="path3765"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" />
</marker>
</defs>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-52,-97.25)"
id="layer1">
<path
d="m 757.13413,451.32142 c -0.34262,0.36811 -704.125927,-1.01015 -704.125927,-1.01015 0,-194.439 157.623957,-352.062964 352.062977,-352.062964 194.439,0 352.06295,158.634114 352.06295,353.073114 z"
id="path4420"
style="fill:#8497e9;fill-opacity:0.3639144;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 698.77301,451.82648 c 2.27347,-0.59614 -600.030599,-1.51523 -600.030599,-1.51523 0,-165.69387 134.321419,-298.50007 300.015299,-298.50007 165.69388,0 300.0153,134.32143 300.0153,300.0153 z"
id="path2987"
style="fill:#a1761d;fill-opacity:0.44342508;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 400,451.6479 1.42857,-298.57143"
id="path3758"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
d="M 399.28571,465.93361 99.877448,465.04601"
id="path3760"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow1Lstart);marker-end:url(#Arrow1Lend)" />
<text
x="212.09299"
y="488.00406"
id="text4400"
xml:space="preserve"
style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
sodipodi:linespacing="125%"><tspan
x="212.09299"
y="488.00406"
id="tspan4402"
style="font-size:20px"><tspan
x="212.09299"
y="488.00406"
id="tspan4404"
style="font-size:20px">6370 km</tspan></tspan></text>
<text
x="387.48788"
y="139.35809"
id="text4414"
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="387.48788"
y="139.35809"
id="tspan4416"><tspan
x="387.48788"
y="139.35809"
id="tspan4418">N</tspan></tspan></text>
<path
d="M 400.02041,451.82649 654.57885,294.74777"
id="path4423"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="M 653.77636,294.74226 142.24211,294.24318"
id="path4425"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:16, 16;stroke-dashoffset:0" />
<text
x="192.92482"
y="288.40582"
id="text4489"
xml:space="preserve"
style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="192.92482"
y="288.40582"
id="tspan4491"><tspan
x="192.92482"
y="288.40582"
id="tspan4493">Der 25. Breitengrad</tspan></tspan></text>
<text
x="582.85437"
y="317.67276"
id="text4503"
xml:space="preserve"
style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="582.85437"
y="317.67276"
id="tspan4505"><tspan
x="582.85437"
y="317.67276"
id="tspan4507"
style="font-size:20px">25°</tspan></tspan></text>
<path
d="m 588.16132,335.15387 c 0,0 -23.48605,-16.16243 -10.35406,-40.4061"
id="path4509"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<text
x="200.5369"
y="626.0354"
transform="matrix(0.82583554,-0.56391104,0.56391104,0.82583554,0,0)"
id="text4400-1"
xml:space="preserve"
style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="200.5369"
y="626.0354"
id="tspan4402-4"><tspan
x="200.5369"
y="626.0354"
id="tspan4404-2"
style="font-size:20px">6370 km</tspan></tspan></text>
<path
d="m 486.07143,294.54968 64.01785,0.0893"
id="path4613"
style="fill:none;stroke:#00ff00;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 516.69304,297.39941 a 3.1567266,3.1567266 0 1 1 -6.31345,0 3.1567266,3.1567266 0 1 1 6.31345,0 z"
transform="translate(-28.031733,-2.7779195)"
id="path4535"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<path
d="m 516.69304,297.39941 a 3.1567266,3.1567266 0 1 1 -6.31345,0 3.1567266,3.1567266 0 1 1 6.31345,0 z"
transform="translate(35.986669,-2.6516413)"
id="path4535-2"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<text
x="435.13611"
y="260.22211"
id="text3024"
xml:space="preserve"
style="font-size:14px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="435.13611"
y="260.22211"
id="tspan3026"><tspan
x="435.13611"
y="260.22211"
id="tspan3028">Burdsch </tspan><tspan
x="496.38611"
y="260.22211"
dx="0"
id="tspan3030" /></tspan><tspan
x="435.13611"
y="277.72211"
id="tspan3032"><tspan
x="435.13611"
y="277.72211"
id="tspan3034">Chalifa</tspan></tspan></text>
<text
x="536.39056"
y="277.88675"
id="text4607"
xml:space="preserve"
style="font-size:14px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="536.39056"
y="277.88675"
id="tspan4609"><tspan
x="536.39056"
y="277.88675"
id="tspan4611">Mileiha</tspan></tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
id="svg2"
version="1.1"
inkscape:version="0.48.0 r9654"
sodipodi:docname="Neues Dokument 1">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="197.661"
inkscape:cy="518.9698"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1278"
inkscape:window-height="726"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 34.285714,396.6479 c 0,0 301.428576,47.14285 632.857146,1.42857"
id="path3050"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 349.51278,80.595435 c 0,0 54.54824,331.330035 2.02031,628.314885"
id="path3820"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 339.41125,714.97123 C 292.94424,646.28086 296.98484,581.6311 290.92393,415.96608 281.75406,165.32284 347.49248,80.595435 347.49248,80.595435 c 0,0 -98.13317,38.965915 -117.1777,167.685325 -3.74197,25.29144 -18.18275,36.36549 -20.20305,165.66501 -2.08342,133.33917 32.32488,208.09143 40.4061,218.19295 8.08122,10.10153 16.16244,58.58885 78.7919,80.81221"
id="path3822"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscsssc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 347.49248,76.554824 c 0,0 -80.81221,14.142136 -117.1777,64.649766 -36.36549,50.50762 -62.62946,107.07617 -62.62946,107.07617 0,0 -21.89511,76.82238 -24.24366,90.91373 -2.0203,12.12182 -2.0203,70.71067 -2.0203,70.71067 0,0 6.06091,68.69038 8.08122,86.87312 2.0203,18.18275 15.16673,62.65835 22.22335,76.7716 12.12183,24.24366 14.14213,26.26396 38.3858,62.62945 5.71428,8.57142 32.32488,48.48733 42.42641,52.52794 10.10152,4.04061 76.77159,26.26396 76.77159,26.26396 C 265.6,692.86785 172.25428,671.19388 106.32911,592.99657 69.816891,549.6875 34.71276,493.2421 34.345187,399.80364 33.947778,298.78067 67.630832,229.24593 113.03752,181.41372 205.80029,83.695751 347.49248,76.554824 347.49248,76.554824 z"
id="path3824"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscscsssscsssc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 353.55339,78.575129 c 0,0 97.25742,19.995076 101.01526,339.411251 2.0203,171.72594 -42.42642,278.80211 -94.95434,299.00516 0,0 24.24366,2.0203 36.36549,-8.08122 12.12183,-10.10153 50.17478,-32.81034 58.58885,-42.42641 14.14214,-16.16244 42.4264,-70.71068 48.48732,-80.8122 6.06091,-10.10153 20.20305,-84.85282 20.20305,-84.85282 l 6.06091,-88.89342 c 0,0 2.04267,-49.20154 -6.06091,-86.87312 C 504.91559,239.77819 503.16101,237.91705 478.81231,181.61069 446.48742,106.8594 353.55339,78.575129 353.55339,78.575129 z"
id="path3826"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscsssccssc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 333.35034,716.99154 c -74.75129,2.02031 -167.68532,-84.85282 -167.68532,-84.85282 0,0 -28.28427,-38.38579 -42.42641,-64.64976 -7.48086,-13.89303 -28.284271,-74.75129 -28.284271,-74.75129 0,0 -8.08122,-68.57848 -8.08122,-86.87312 0,-18.18274 -2.604199,-40.95372 10.101525,-80.8122 C 122.13198,246.13256 123.23861,238.17923 163.64471,179.59038 225.25226,90.259428 353.55339,74.534519 353.55339,74.534519 c 0,0 313.71043,28.756701 317.1879,321.228511 3.38752,284.90613 -319.2082,319.2082 -319.2082,319.2082"
id="path3828"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csscscscsc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 353.55339,76.554824 c 0,0 117.68659,31.320736 165.66502,107.076166 38.38579,60.60915 47.32653,61.20103 64.64976,145.46197 12.44954,60.55509 10.10153,60.60915 10.10153,80.8122 0,20.20306 -8.08122,78.7919 -12.12183,96.97465 -4.04061,18.18274 -24.24367,74.75129 -36.3655,92.93403 -12.12183,18.18275 -38.38579,50.50763 -54.54823,64.64977 -16.16244,14.14213 -135.36044,54.54823 -135.36044,54.54823 l 115.15739,-34.34518 86.87311,-58.58885 c 0,0 52.52794,-86.87312 56.56855,-96.97465 4.04061,-10.10152 20.9223,-111.39166 24.24366,-131.31983 4.04061,-24.24366 -18.18275,-92.93403 -20.20305,-109.09647 -2.02031,-16.16244 -38.3858,-84.85282 -72.73099,-117.1777 C 484.66346,114.26784 353.55339,76.554824 353.55339,76.554824 z"
id="path3830"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csssssscccssssc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 42.426407,323.03205 c 0,0 268.700573,40.4061 622.253963,6.06091"
id="path3832"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 62.629458,256.36198 c 0,0 268.700572,30.30457 577.807252,2.0203"
id="path3834"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 96.974644,193.73252 c 0,0 208.091426,26.26397 501.035666,0"
id="path3836"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 161.62441,135.14367 c 0,0 137.38074,28.28427 369.71583,0"
id="path3838"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.2"
width="202"
height="202"
id="svg2">
<circle cx="100" cy="100" r="100" id="Himmel" style="fill:#d7e3f4;stroke:#000;"/>
<circle cx="100" cy="100" r="80" id="Erde" style="fill:#d38d5f;stroke:#000;"/>
<circle cx="100" cy="100" r="2" id="Zentrum" style="fill:#000;stroke:#000;"/>
<path d="M 0,70 107,0" id="Tangente" style="fill:none;stroke:#000;stroke-width:1px;" />
<path d="m 55,34 45,66 7,-100 z" id="Dreieck" style="fill:#fff;fill-opacity:0.7;stroke:#000;stroke-width:1px;" />
<path d="m 62,29 c 0,0 7,7 -2,13" id="Gradbogen-90" style="fill:none;stroke:#000;stroke-width:1px;"/>
<path d="m 90,85 c 0,0 4,-8 11,-3" id="Gradbogen-phi" style="fill:none;stroke:#000;stroke-width:1px;"/>
<circle cx="60" cy="35" r="1" id="Dot" style="fill:#000;stroke:#000;"/>
<text x="93" y="89" id="phi" style="font-size:10px;fill:#000;font-family:Sans">φ</text>
<text x="75" y="130" id="Erde-t" style="font-size:20px;fill:#000;font-family:Sans">Erde</text>
<text x="71" y="73" id="Radius" style="font-size:10px;fill:#000;font-family:Sans">r</text>
<text x="95" y="17" id="x" style="font-size:10px;fill:#00ff00;font-family:Sans">x</text>
<text x="108" y="15" id="h" style="font-size:10px;fill:#000;font-family:Sans">h</text>
<path style="fill:none;stroke:#00ff00;stroke-width:1px;" d="m 55,34.063745 c 0,0 21,-16.434263 51,-13.844622" id="Kreisbogen"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

View file

@ -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}

View file

@ -0,0 +1,6 @@
make:
pdflatex Burdsch-Chalifa.tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out

6
documents/stundenplan/Makefile Executable file
View file

@ -0,0 +1,6 @@
make:
pdflatex example.tex -output-format=pdf
make clean
clean:
rm -rf *.aux *.log

View file

@ -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}

295
documents/stundenplan/manual.tex Executable file
View file

@ -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}

View file

@ -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 <http://www.gnu.org/licenses/>.
%
\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: <horizontal> <vertical> <text>
% 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: <width> <height>
% Defines the slot size
\setlength{\@rowheight}{#2}
\setlength{\@colwidth}{#1}
}
\newcommand{\setslotcount}[2]
{
% Arguments: <days> <hours per day>
% Defines the number of slots in both dimensions
\setcounter{@colcount}{#1}
\setcounter{@rowcount}{#2+\value{@topheight}}
\stepcounter{@colcount}
}
\newcommand{\settextframe}[1]
{
% Arguments: <width>
% 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: <start hour> <minute stepping> <print end time?>
% Automatically sets the time slots to full hours, beginning with <start hour>
\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: <number of start day>
% 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: <number of start day>
% 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}
}

View file

@ -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

Binary file not shown.

View file

@ -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}

136
uml/class-diagramm/meta.mp Normal file
View file

@ -0,0 +1,136 @@
input metauml;
beginfig(1);
Class.LittlePraktomat("LittlePraktomat")
("-tutors: Set<Tutor>",
"-currentTutor: Tutor",
"-students: Set<Student>",
"-tasks: Map<Integer,Task>",
"-nextTaskId: int",
"-solutions: Set<solution>")
("+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("<<AverageGrade>>");
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<Integer,Solution>",
)
("+Student(String,int,Tutor): void",
"+getStudentNumber(): int",
"+getTutor(): Tutor",
"+getSolution(): int",
"+submitSolution(Solution): void"
);
classStereotypes.Student("<<Comparable>>", "<<AverageGrade>>");
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<Student>",
"-missingReviews: Set<Solution>",
"-reviewsDone: Set<Review>"
)
("+Tutor(String): void",
"+addStudent(Student): void",
"+getStudentCount(): int",
"+review(int,Student,int,String): boolean",
"+addMissingReview(Solution): void",
"+getmissingReviewCount(): int",
"+compareTo(Tutor): int"
);
classStereotypes.Tutor("<<Comparable>>", "<<AverageGrade>>");
Class.Task("Task")
("-id: int",
"-text: String",
"-solutions: Set<Solution>"
)
("+Task(int, String): void",
"+addSolution(Solution): void",
"+getText(): String",
"+getId(): int",
"+getSolutions(): Set<Solution>"
);
classStereotypes.Task("<<AverageGrade>>");
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