Professional Documents
Culture Documents
Maria Eichlseder
I Wissenschaftliche Dokumente
I Dokumentstruktur planen
I Referenzen
I Bilder einsetzen
I Referenzen verwenden
I Zitieren
I Algorithmen
I Code und Pseudocode einsetzen können
I Grafiken
I Diagramme sinnvoll einsetzen
I Umsetzung in TikZ (o.ä.)
1 / 39
Wissenschaftliche“ Dokumente
”
2 / 39
Wissenschaftliche“ Dokumente
”
Beispiele ? LATEX-Dokumentklassen
I Publikationen I article, scrartcl
I Code-Dokumentation einseitig, kürzere Artikel
I Skriptum I report, scrreprt
einseitig, längere Dokumente
I Labor-Protokoll
I book, scrbook
I Technischer Bericht
zweiseitig (Druck)
I Bachelor-Arbeit
I letter2, scrlttr2,
beamer, moderncv,
flashcards, . . .
3 / 39
Beispiel: ScrArtcl
Lorem Ipsum
Mary Sue John Doe
Contents
1 A first section 1
1.1 With subsection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Another section 3
2.1 With yet another subsection . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1 A first section
1.1 With subsection
Hello, here is some text without a meaning. This text should show what a printed
text will look like at this place. sin2 (α) + cos2 (β) = 1. If you read this text, you will
get no information E = mc2 . Really? Is there no information? Is there a difference
between this text and some nonsense like “Huardest gefburn”? Kjift – not at all! A
blind text like this gives you information about the √selected font, how the letters are
√ √
written and an impression of the look. n a · n b = n ab. This text should contain√ qall
na
letters of the alphabet and it should be written in of the original language. √ n
b
= n ab .
There
√ is√no need for special content, but the length of words should match the language.
a n b = n an b.
1 i=n
X x1 + x2 + . . . + xn
x̄ = xi =
n i=1 n 4 / 39
Beispiel: Book
Caput 2
Ein Chapter
+ Leerseite x̄ =
1 i=n
X
n i=1
xi =
x1 + x2 + . . . + xn
n
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis
facilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent im-
perdiet mi nec ante. Donec ullamcorper, felis non sodales commodo, lectus
velit ultrices augue, a dignissim nibh lectus placerat pede. Vivamus nunc
nunc, molestie ut, ultricies vel, semper in, velit. Ut porttitor. Praesent in
sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis frin-
gilla tristique neque. Sed interdum libero ut metus. Pellentesque placerat.
Nam rutrum augue a leo. Morbi sed elit sit amet ante lobortis sollicitudin.
Praesent blandit blandit mauris. Praesent lectus tellus, aliquet aliquam,
luctus a, egestas a, turpis. Mauris lacinia lorem sit amet ipsum. Nunc quis
urna dictum turpis accumsan semper.
Z ∞ sZ Z ∞ r
2 1 ∞ 2 1 π
e−αx dx = e−αx2 dx e−αy dy =
0 2 −∞ −∞ 2 α
5 / 39
Typische Dokument-Bausteine
Inhalt
I Bibliographie BibTEX
I Index von Bildern, Tabellen, Algorithmen, Stichwörtern?
Paket makeidx, \listoffigures, \listoftables
6 / 39
Inhalt?
1. Einleitung
Was? Warum? Wer hat schon ähnliches gemacht?
2. Methoden, Grundlagen
Was braucht man dazu? Wie macht man das?
3. Ergebnisse
Was ist passiert?
4. Diskussion
Was bedeutet das?
7 / 39
Dateien aufteilen – nur Hauptdokument kompilieren
main.tex einfuehrung.tex
\ documentclass { report } \ chapter { Einf ü hrung }
\ usepackage {...} Wir beschreiben ...
\ newcommand {...}
theorie.tex
\ begin { document }
\ title { Theorie von ...} \ chapter { Theorie }
\ author { Mary Sue } Die theoretischen
\ maketitle Grundlagen ...
\ tableofcontents
ergebnisse.tex
\ input { einfuehrung }
\ input { theorie } \ chapter { Ergebnisse }
\ input { ergebnisse } Unsere Experimente ...
\ end { document }
8 / 39
Eigene Titelseite – nützliche Zutaten
Manuelle Abstände
\ vspace *{5 cm } % vertikal
\ hspace *{2 mm } % horizontal
Linien
\ rule {5 cm }{1 mm } % 5 cm lang und 1 mm dick
10 / 39
Bilder
Parameter
I width, scale – Bild skalieren
I trim, clip, page – Bildteile ausschneiden
Positionierung?
13 / 39
Float-Umgebungen & Referenzen I
I Bilder
As \ figurename ~ \ ref { fig : crypto }
on page ~ \ pageref { fig : crypto } illustrates ,
\ begin { figure }
\ centering
\ includegraphics { xkcd }
\ caption { A diagram describing ...}
\ label { fig : crypto }
\ end { figure }
(
Das ist erwünscht!
Floats floaten!
Beschriftung & Referenz sind Pflicht!
14 / 39
Float-Umgebungen & Referenzen II
I Tabellen
\ begin { table }
\ caption {...}\ label {...}
\ begin { tabular }{ lr }
...
\ end { tabular }
\ end { table }
I Algorithmen, Code
\ begin { algorithm }
... kommt gleich
\ end { algorithm }
15 / 39
Noch mehr Nummerierung mit Referenzen
Kapitel und Abschnitte
\ chapter { Theorie }\ label { chap : theorie }
\ section { Ergebnisse }\ label { sec : ergebnisse }
Formeln
\ begin { equation }
a ^2 + b ^2 = c ^2 \ label { eq : dreieck }
\ end { equation }
In Gleichung ~ \ eqref { eq : dreieck }...
Aufzählungspunkte
\ begin { enumerate }
\ item \ label { summe } Summiere alle Werte $ x _ i $
\ end { enumerate }
16 / 39
Literatur zitieren
Donald E. Knuth showed [2] that the implementation
of fundamental algorithms. . .
Examples are provided by Graham et al. [1, p. 13–15].
References
[1] Ronald L. Graham, Donald E. Knuth, and Oren
Patashnik. Concrete mathematics – a foundation
for computer science. Addison-Wesley, 1989.
[2] Donald E. Knuth. The Art of Computer Pro-
gramming, Volume I: Fundamental Algorithms.
Addison-Wesley, 1968.
17 / 39
Literatur zitieren – BibTEX
dokument.tex
Donald E . ~ Knuth showed ~ \ cite { artof }...
... by Graham et ~ al . ~ \ cite [ p . ~ 13 - -15]{ concr }.
\ bibliographystyle { plain }
\ bibliography { literatur }
literatur.bib
@book { artof ,
author = { Donald E . Knuth } ,
title = { The Art of Computer
Programming , Volume { I }:
Fundamental Algorithms } ,
publisher = { Addison - Wesley } ,
year = {1968} ,
}
18 / 39
Literatur zitieren – BibTEX
I Mehrfach kompilieren notwendig
pdflatex dokument.tex
bibtex dokument
pdflatex dokument.tex
pdflatex dokument.tex
I Nachfolger: BibLATEX
I Flexibler, internationaler, einfacher
I (Noch) nicht überall gut integriert (Verlage, IDEs, . . . )
19 / 39
Hyperlinks und URLs
URLs
\ url { www . tugraz . at }
20 / 39
Algorithmen
21 / 39
Source Code
Die Funktion nimmt einen unsigned int als Param-
eter. Der Returnwert ist ebenfalls ein unsigned int.
unsigned f a c t o r i a l ( unsigned n ) ;
I Paket listings
\ usepackage { listings }
\ lstset { keywordstyle =\ bfseries , language = C }
23 / 39
Pseudocode
Algorithmus 1 Berechnung der Fakultät n!
Eingabe: eine Zahl n ∈ N
Ausgabe: N = n!, die Fakultät von n
1: initialisiere N := 1
2: for i = 1, . . . , n do
3: setze N := N · i
4: gib Ergebnis N aus
24 / 39
Pseudocode
I Wenn der Algorithmus im Vordergrund steht, zum Erklären
I Umgebung enumerate
I Paket algorithmic und Konsorten
\ usepackage { algorithm , algorithmic }
...
\ begin { algorithm }
\ caption {...} \ label {...}
\ begin { algorithmic }
\ STATE initialisiere $ N := 1$
\ FOR {$ i = 1 , \ ldots , n $}
\ STATE setze $ N := N \ cdot i $
\ ENDFOR
\ end { algorithmic }
\ end { algorithm }
25 / 39
Grafiken
26 / 39
M1 M2 M` A∩B
IV ···
EK EK EK A B
C1 C2 C`
n n
2 + 2
n n n n
4 + 4 + 4 + 4
.. .. .. .. .. .. .. ..
. . . . . . . .
n n n n
2k + 2k + ··· + 2k + 2k
Warum würde man das in LATEX machen wollen?
Gibt es nicht genug externe Tools?
TikZ verwenden
\ usepackage { tikz }
...
\ begin { tikzpicture }
...
\ end { tikzpicture }
29 / 39
Basics
in tikzpicture:
\ draw (0 ,0) -- (2 ,0) -- (2 ,2) -- (0 ,2) -- (0 ,0)
-- (2 ,2) -- (1 ,3) -- (0 ,2) -- (2 ,0);
\ draw [ color = brown , line width =5 pt ]
(3.5 ,0) rectangle (4 ,1.5);
\ draw [ fill = green !70! yellow ]
(3.75 ,2.5) circle (1);
30 / 39
Punkte
Koordinatensysteme
I Euklidisch: (x,y) mit x- und y-Koordinate [cm]
I Polarkoordinaten: (ϕ:r) mit Winkel ϕ [Grad], Radius r [cm]
I relativ: +(x,y), ++(x,y) mit Abstand zum letzten Punkt
I 3D: (x,y,z)
31 / 39
Beschriftung
Nodes
\ draw (0 ,0) node { Asdf }; Asdf
\ node ( a ) at (0 ,0) { A }; A B
\ node ( b ) at (1 ,0) { B };
\ draw [ - >] ( a ) -- ( b );
32 / 39
Kurven
Eingangs-Winkel
\ draw [ out =90 , in = -90] (6 ,0) to (7 ,2);
33 / 39
Beispiel: Funktionsgraphen
f (x)
f1 (x) = x
1 x
f2 (x) = 20 e
x
π π
2
f3 (x) = sin x
...
\ draw [ domain =0:4] plot (\ x , {1/20* exp (\ x )});
...
34 / 39
Beispiel: Daten plotten
·105
no heuristic
MCTS-UCT
1.5
Monte Carlo
Number of games
Random Walk
1
0.5
0
20 30 40 50 60 70
Score achieved
% 4.1
4 3.7 3.5 3.5
3
2 1.9
1.5 1.2
1 0.9
0.5
0.1
ien
l
iec nien
Sp d
en
ied ien
Fr nde
ch
Po d
n
ga
an
lie
l
D krei
la
an
rtu
Po
Ita
la
nl
ä
an
ch
m
er
he
an
it
ts
Ru
br
eu
oß
N
Gr
Gr
Sonstige (16,5 kWh) 2,9% Regenerative (53,7 kWh)/davon Wind 4,4% (25,0 kWh)
This graphic has been redrawn in Tik Z, but the original looks almost exactly the same.
At first sight, the graphic looks “nice and informative,” but there are a lot of things that went wrong:
Kommentare?
• The chart is three dimensional. However, the shadings add nothing “information-wise,” at best, the
distract.
38 / 39
Bessere Beispiele
http://www.texample.net/tikz/examples/
39 / 39