diff --git a/sections/german/12/12.md b/sections/german/12/12.md index 9bcae2c..741c590 100644 --- a/sections/german/12/12.md +++ b/sections/german/12/12.md @@ -1,16 +1,196 @@
-

Tabellen

+

🗒️
Tabellen

--- -TODO: Tabellen (booktabs, Möglichkeit für Querformat) +
+
+

Grundstruktur

+

Für typografisch schöne Tabellen nutzen wir das Paket booktabs.

+
\usepackage{booktabs}
+
\begin{table}[position]
+	\begin{tabular}{Spaltendefinition}
+		% Tabelleninhalt
+	\end{tabular}
+	\caption{Tabellenunterschrift}
+\end{table}
+

Die Positionierung erfolgt analog zu Grafiken.

+
+
--- -
+
+
+

Spaltendefinitionen

+
\begin{tabular}{lrcl}
+    % Tabelleninhalt
+\end{tabular}
+ + + + + + + + + + + + + + + + + +
KürzelBedeutung
llinksbündige Spalte
czentrierte Spalte
rrechtsbündige Spalte
+

Hinweis: Vertikale Trennlinien und doppelte horizontale Linien sind unter Typograph\*innen nicht gern gesehen.

+
+
+ +
+
+ +--- + +
+
+

Tabelleninhalt

+
\begin{tabular}{lll}
+    \toprule
+    Spalte 1 & Spalte 2 & Spalte 3 \\\\
+    \midrule
+    Inhalt a & Inhalt b & Inhalt c \\\\
+    Inhalt e & Inhalt f & Inhalt g \\\\
+    Inhalt i & Inhalt j & Inhalt k \\\\
+    \bottomrule
+\end{tabular}
+
    +
  • Zellen werden durch & abgetrennt.
  • +
  • Zeilen werden durch zwei Backslashes beendet.
  • +
  • \toprule, \midrule und \bottomrule strukturieren die Tabelle.
  • +
+
+
+ +
+
+ +--- + +
+
+

Die gesamte Tabelle

+
\begin{table}[h]
+	\begin{tabular}{lrcl} \toprule
+        Sprache & Autor             & Erscheinungsjahr & Aktuelle Version   \\\\
+        \midrule
+        C++     & Bjarne Stroustrup & 1985             & ISO/IEC 14882:2017 \\\\
+        Java    & James Gosling     & 1998             & 12.0.1             \\\\
+        Python  & Guido van Rossum  & 1991             & 3.7.3              \\\\
+        \bottomrule
+	\end{tabular}
+	\caption{Bekannte Programmiersprachen}
+\end{table}
+
+
+ +--- + +
+
+

Besonders lange Tabellen

+

Tabellen, die über mehrere Seiten gehen, werden von tabular einfach abgeschnitten. Die Lösung bietet hier das Paket longtable:

+
\usepackage{longtable}
+
\begin{longtable}{lll}
+    % Tabelleninhalt
+    \caption{Untertitel}
+    \label{tab:bsptab1}
+\end{longtable}
+
+
+ +--- + +
+
+

Hinweise zu longtable

+
\begin{longtable}{lll}
+    % Tabelleninhalt
+    \caption{Untertitel}
+    \label{tab:bsptab1}
+\end{longtable}
+
    +
  • Die longtable-Umgebung vereint die tabular-Umgebung und die table-Umgebung.
  • +
  • Untertitel und Label können deshalb direkt unter dem Tabelleninhalt stehen.
  • +
  • Die Features von booktabs stehen auch in longtable zur Verfügung, sofern das Paket booktabs eingebunden ist.
  • +
+
+
+ +--- + +
+
+

Besonders breite Tabellen

+

Sollte die Tabelle einmal zu breit für eine Seite werden, können einzelne Seiten auch im Querformat dargestellt werden:

+
\usepackage{lscape}
+
\begin{landscape}
+    \begin{table}[h]
+        \begin{tabular}{lll}
+            % Tabelleninhalt
+        \end{tabular}
+    \end{table}
+\end{landscape}
+
+
+ +--- + +
+
+

Weiterführendes Beispiel

+
\begin{table}[h]
+    \begin{tabular}{llr}
+        \toprule
+        Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3}
+        & Average & Worst \\
+        \midrule
+        Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
+        Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
+        AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
+        \bottomrule
+    \end{tabular}
+\end{table}
+

+ 🔗 Dokumentation zu Booktabs +

+
+
+ +
+
+ +--- + +
+
+

Vereinfachung

+

+ Der Tables Generator ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen. +

+ + + +
+
+ +--- + +

7. Tabellen einfügen

    diff --git a/sections/german/12/table-advanced-example-crop.svg b/sections/german/12/table-advanced-example-crop.svg new file mode 100644 index 0000000..f0c53b1 --- /dev/null +++ b/sections/german/12/table-advanced-example-crop.svg @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/12/table-advanced-example-orig.svg b/sections/german/12/table-advanced-example-orig.svg new file mode 100644 index 0000000..57082e3 --- /dev/null +++ b/sections/german/12/table-advanced-example-orig.svg @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/12/table-advanced-example.synctex.gz b/sections/german/12/table-advanced-example.synctex.gz new file mode 100644 index 0000000..0014ed5 Binary files /dev/null and b/sections/german/12/table-advanced-example.synctex.gz differ diff --git a/sections/german/12/table-advanced-example.tex b/sections/german/12/table-advanced-example.tex new file mode 100644 index 0000000..ef84408 --- /dev/null +++ b/sections/german/12/table-advanced-example.tex @@ -0,0 +1,27 @@ +\documentclass[a4paper]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{hyperref} +\usepackage{booktabs} +\usepackage{lscape} +\begin{document} +\thispagestyle{empty} + +\begin{landscape} +\begin{table}[h] + \begin{tabular}{llr} + \toprule + Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3} + & Average & Worst \\ + \midrule + Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\ + Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\ + AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\ + \bottomrule +\end{tabular} +\end{table} +\end{landscape} + +\end{document} diff --git a/sections/german/12/table-content-example-crop.svg b/sections/german/12/table-content-example-crop.svg new file mode 100644 index 0000000..11367ec --- /dev/null +++ b/sections/german/12/table-content-example-crop.svg @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/12/table-content-example-orig.svg b/sections/german/12/table-content-example-orig.svg new file mode 100644 index 0000000..997e940 --- /dev/null +++ b/sections/german/12/table-content-example-orig.svg @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/12/table-content-example.tex b/sections/german/12/table-content-example.tex new file mode 100644 index 0000000..33d21fb --- /dev/null +++ b/sections/german/12/table-content-example.tex @@ -0,0 +1,23 @@ +\documentclass[a4paper]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{hyperref} +\usepackage{booktabs} +\begin{document} +\thispagestyle{empty} + +\begin{table}[h] + \begin{tabular}{lll} + \toprule + Spalte 1 & Spalte 2 & Spalte 3 \\ + \midrule + Inhalt a & Inhalt b & Inhalt c \\ + Inhalt e & Inhalt f & Inhalt g \\ + Inhalt i & Inhalt j & Inhalt k \\ + \bottomrule +\end{tabular} +\end{table} + +\end{document} diff --git a/sections/german/12/table-example-crop.svg b/sections/german/12/table-example-crop.svg new file mode 100644 index 0000000..68e6178 --- /dev/null +++ b/sections/german/12/table-example-crop.svg @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/12/table-example-orig.svg b/sections/german/12/table-example-orig.svg new file mode 100644 index 0000000..ad28ec1 --- /dev/null +++ b/sections/german/12/table-example-orig.svg @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/12/table-example.tex b/sections/german/12/table-example.tex new file mode 100644 index 0000000..ca7ce22 --- /dev/null +++ b/sections/german/12/table-example.tex @@ -0,0 +1,24 @@ +\documentclass[a4paper]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{hyperref} +\usepackage{booktabs} +\usepackage[ngerman]{babel} +\begin{document} +\thispagestyle{empty} + +\begin{table}[h] + \begin{tabular}{lrcl} \toprule + Sprache & Autor & Erscheinungsjahr & Aktuelle Version \\ + \midrule + C++ & Bjarne Stroustrup & 1985 & ISO/IEC 14882:2017 \\ + Java & James Gosling & 1998 & 12.0.1 \\ + Python & Guido van Rossum & 1991 & 3.7.3 \\ + \bottomrule + \end{tabular} + \caption{Bekannte Programmiersprachen} +\end{table} + +\end{document} diff --git a/sections/german/12/tables-generator.png b/sections/german/12/tables-generator.png new file mode 100644 index 0000000..70dbc77 Binary files /dev/null and b/sections/german/12/tables-generator.png differ