Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 7
Codeumbruch korrigiert

17 Mai '21, 08:50

gast3's gravatar image

gast3
(ausgesetzt)

Ich würde die störenden vertikalen Linien alle weglassen und es beispielsweise so: \documentclass[paper=a4,titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \usepackage{tabularx} \usepackage{booktabs} \usepackage{graphicx} \newcommand*{\tabcolhead}[1]{\rotatebox[origin=c]{45}{\textbf{#1}}} \begin{document} \begin{table}[ht] \setlength{\tabcolsep}{.75\tabcolsep}% Spaltenabstand etwas verringern. \caption{Die 15 Schulmädchen.} \begin{tabularx}{\linewidth}{*{6}{XXX@{\hskip4\tabcolsep}}XXX} \toprule \multicolumn{3}{l}{\tabcolhead{Montag}} & \multicolumn{3}{l}{\tabcolhead{Dienstag}} & \multicolumn{3}{l}{\tabcolhead{Mittwoch}} & \multicolumn{3}{l}{\tabcolhead{Donnerstag}} & \multicolumn{3}{l}{\tabcolhead{Freitag}} & \multicolumn{3}{l}{\tabcolhead{Samstag}} & \multicolumn{3}{l}{\tabcolhead{Sonntag}}\\ \midrule a & A & V & b & B & V & c & C & V & d & D & V & e & E & V & f & F & V & g & G & V \\ b & E & D & c & F & E & d & G & F & e & A & G & f & B & A & g & C & B & a & D & C \\ c & B & C & d & C & A & e & D & B & f & E & C & g & F & D & a & G & E & b & A & F \\ d & f & g & e & a & b & f & a & b & g & b & c & a & c & d & b & d & e & c & e & f \\ e & F & C & f & G & D & g & A & E & a & B & F & b & C & G & c & D & A & d & E & B \\ \bottomrule \end{tabularx} \label{tab:1} \end{table} \end{document} oder so: \documentclass[titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \usepackage{tabularx} \usepackage{booktabs} \newcommand*{\tabcolhead}[2][\hskip -4\tabcolsep]{#1\footnotesize\textbf{#2}} \begin{document} \begin{table}[ht] \setlength{\tabcolsep}{.85\tabcolsep}% Spaltenabstand etwas verringern. verringern. \caption{Die 15 Schulmädchen.} \begin{tabularx}{\linewidth}{*{6}{XXX@{\hskip4\tabcolsep}}XXX} \toprule \multicolumn{3}{c}{\tabcolhead{Montag}} & \multicolumn{3}{c}{\tabcolhead{Dienstag}} & \multicolumn{3}{c}{\tabcolhead{Mittwoch}} & \multicolumn{3}{c}{\tabcolhead{Donnerstag}} & \multicolumn{3}{c}{\tabcolhead{Freitag}} & \multicolumn{3}{c}{\tabcolhead{Samstag}} & \multicolumn{3}{c}{\tabcolhead[]{Sonntag}}\\ \midrule a & A & V & b & B & V & c & C & V & d & D & V & e & E & V & f & F & V & g & G & V \\ b & E & D & c & F & E & d & G & F & e & A & G & f & B & A & g & C & B & a & D & C \\ c & B & C & d & C & A & e & D & B & f & E & C & g & F & D & a & G & E & b & A & F \\ d & f & g & e & a & b & f & a & b & g & b & c & a & c & d & b & d & e & c & e & f \\ e & F & C & f & G & D & g & A & E & a & B & F & b & C & G & c & D & A & d & E & B \\ \bottomrule \end{tabularx} \label{tab:1} \end{table} \end{document} lösen. Wenn man dagegen auf der fürcherlichen Klötzchengrafik an Stelle einer Tabelle besteht, ergibt es in der Tat keinen Sinn `booktabs` zu verwenden. Dann ginge das beispielsweise so: \documentclass[paper=a4,titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \usepackage{tabularx} \newcommand*{\tabcolhead}[1]{\footnotesize\textbf{#1}} \begin{document} \begin{table}[ht] \caption{Die 15 Schulmädchen.} \begin{tabularx}{\linewidth}{|*{7}{XXX|}} \firsthline \multicolumn{3}{|c|}{\tabcolhead{Montag}} & \multicolumn{3}{c|}{\tabcolhead{Dienstag}} & \multicolumn{3}{c|}{\tabcolhead{Mittwoch}} & \multicolumn{3}{c|}{\tabcolhead{Donnerstag}} & \multicolumn{3}{c|}{\tabcolhead{Freitag}} & \multicolumn{3}{c|}{\tabcolhead{Samstag}} & \multicolumn{3}{c|}{\tabcolhead{Sonntag}}\\ \hline a & A & V & b & B & V & c & C & V & d & D & V & e & E & V & f & F & V & g & G & V \\ \hline b & E & D & c & F & E & d & G & F & e & A & G & f & B & A & g & C & B & a & D & C \\ \hline c & B & C & d & C & A & e & D & B & f & E & C & g & F & D & a & G & E & b & A & F \\ \hline d & f & g & e & a & b & f & a & b & g & b & c & a & c & d & b & d & e & c & e & f \\ \hline e & F & C & f & G & D & g & A & E & a & B & F & b & C & G & c & D & A & d & E & B \\ \lasthline \end{tabularx} \label{tab:1} \end{table} \end{document} Näheres zu `\hline` ist jeder besseren LaTeX-Einführung zu entnehmen. `\firsthline` und `\lasthline` sind in der Anleitung zu Paket `array` zu finden. Im Beispiel wird `array` von `tabularx` geladen. Man beachte außerdem Option `captions=tableheading` in von mir angegebenen Beispielen. Warum die Option gesetzt wurde, ist bereits in den @saputello Kommentaren zur Frage angegeben. Darüber hinaus ist die Option in der KOMA-Script-Anleitung erklärt. Diese Option ist übrigens das Einzige, was an dem gezeigten Tabellencode spezifisch für KOMA-Script ist. Ohne eine KOMA-Script-Klasse wäre das Paket `caption` und dessen Option `tableposition=top` zu empfehlen.
Klicke auf Einblenden/Ausblenden von Überarbeitungen 6
kleine Optimierung

16 Mai '21, 16:40

gast3's gravatar image

gast3
(ausgesetzt)

Ich würde die störenden vertikalen Linien alle weglassen und es beispielsweise so: \documentclass[paper=a4,titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \usepackage{tabularx} \usepackage{booktabs} \usepackage{graphicx} \newcommand*{\tabcolhead}[1]{\rotatebox[origin=c]{45}{\textbf{#1}}} \begin{document} \begin{table}[ht] \setlength{\tabcolsep}{.75\tabcolsep}% Spaltenabstand etwas verringern. \caption{Die 15 Schulmädchen.} \begin{tabularx}{\linewidth}{*{6}{XXX@{\hskip4\tabcolsep}}XXX} \toprule \multicolumn{3}{l}{\tabcolhead{Montag}} & \multicolumn{3}{l}{\tabcolhead{Dienstag}} & \multicolumn{3}{l}{\tabcolhead{Mittwoch}} & \multicolumn{3}{l}{\tabcolhead{Donnerstag}} & \multicolumn{3}{l}{\tabcolhead{Freitag}} & \multicolumn{3}{l}{\tabcolhead{Samstag}} & \multicolumn{3}{l}{\tabcolhead{Sonntag}}\\ \midrule a & A & V & b & B & V & c & C & V & d & D & V & e & E & V & f & F & V & g & G & V \\ b & E & D & c & F & E & d & G & F & e & A & G & f & B & A & g & C & B & a & D & C \\ c & B & C & d & C & A & e & D & B & f & E & C & g & F & D & a & G & E & b & A & F \\ d & f & g & e & a & b & f & a & b & g & b & c & a & c & d & b & d & e & c & e & f \\ e & F & C & f & G & D & g & A & E & a & B & F & b & C & G & c & D & A & d & E & B \\ \bottomrule \end{tabularx} \label{tab:1} \end{table} \end{document} oder so: \documentclass[paper=a4,titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \documentclass[titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \usepackage{tabularx} \usepackage{booktabs} \newcommand*{\tabcolhead}[2][\hskip -3\tabcolsep]{#1\footnotesize\textbf{#2}} -4\tabcolsep]{#1\footnotesize\textbf{#2}} \begin{document} \begin{table}[ht] \setlength{\tabcolsep}{.75\tabcolsep}% \setlength{\tabcolsep}{.85\tabcolsep}% Spaltenabstand etwas verringern. \caption{Die 15 Schulmädchen.} \begin{tabularx}{\linewidth}{*{6}{XXX@{\hskip4\tabcolsep}}XXX} \toprule \multicolumn{3}{c}{\tabcolhead{Montag}} & \multicolumn{3}{c}{\tabcolhead{Dienstag}} & \multicolumn{3}{c}{\tabcolhead{Mittwoch}} & \multicolumn{3}{c}{\tabcolhead{Donnerstag}} & \multicolumn{3}{c}{\tabcolhead{Freitag}} & \multicolumn{3}{c}{\tabcolhead{Samstag}} & \multicolumn{3}{c}{\tabcolhead[]{Sonntag}}\\ \midrule a & A & V & b & B & V & c & C & V & d & D & V & e & E & V & f & F & V & g & G & V \\ b & E & D & c & F & E & d & G & F & e & A & G & f & B & A & g & C & B & a & D & C \\ c & B & C & d & C & A & e & D & B & f & E & C & g & F & D & a & G & E & b & A & F \\ d & f & g & e & a & b & f & a & b & g & b & c & a & c & d & b & d & e & c & e & f \\ e & F & C & f & G & D & g & A & E & a & B & F & b & C & G & c & D & A & d & E & B \\ \bottomrule \end{tabularx} \label{tab:1} \end{table} \end{document} lösen. Wenn man dagegen auf der fürcherlichen Klötzchengrafik an Stelle einer Tabelle besteht, ergibt es in der Tat keinen Sinn `booktabs` zu verwenden. Dann ginge das beispielsweise so: \documentclass[paper=a4,titlepage=true,bibliography=totocnumbered,parskip=half,DIV=12,captions=tableheading]{scrartcl} \usepackage{tabularx} \newcommand*{\tabcolhead}[1]{\footnotesize\textbf{#1}} \begin{document} \begin{table}[ht] \caption{Die 15 Schulmädchen.} \begin{tabularx}{\linewidth}{|*{7}{XXX|}} \firsthline \multicolumn{3}{|c|}{\tabcolhead{Montag}} & \multicolumn{3}{c|}{\tabcolhead{Dienstag}} & \multicolumn{3}{c|}{\tabcolhead{Mittwoch}} & \multicolumn{3}{c|}{\tabcolhead{Donnerstag}} & \multicolumn{3}{c|}{\tabcolhead{Freitag}} & \multicolumn{3}{c|}{\tabcolhead{Samstag}} & \multicolumn{3}{c|}{\tabcolhead{Sonntag}}\\ \hline a & A & V & b & B & V & c & C & V & d & D & V & e & E & V & f & F & V & g & G & V \\ \hline b & E & D & c & F & E & d & G & F & e & A & G & f & B & A & g & C & B & a & D & C \\ \hline c & B & C & d & C & A & e & D & B & f & E & C & g & F & D & a & G & E & b & A & F \\ \hline d & f & g & e & a & b & f & a & b & g & b & c & a & c & d & b & d & e & c & e & f \\ \hline e & F & C & f & G & D & g & A & E & a & B & F & b & C & G & c & D & A & d & E & B \\ \lasthline \end{tabularx} \label{tab:1} \end{table} \end{document} Näheres zu `\hline` ist jeder besseren LaTeX-Einführung zu entnehmen. `\firsthline` und `\lasthline` sind in der Anleitung zu Paket `array` zu finden. Im Beispiel wird `array` von `tabularx` geladen. Man beachte außerdem Option `captions=tableheading` in von mir angegebenen Beispielen. Warum die Option gesetzt wurde, ist bereits in den @saputello Kommentaren zur Frage angegeben. Darüber hinaus ist die Option in der KOMA-Script-Anleitung erklärt. Diese Option ist übrigens das Einzige, was an dem gezeigten Tabellencode spezifisch für KOMA-Script ist. Ohne eine KOMA-Script-Klasse wäre das Paket `caption` und dessen Option `tableposition=top` zu empfehlen.empfehlen.
Klicke auf Einblenden/Ausblenden von Überarbeitungen 5

16 Mai '21, 16:07

gast3's gravatar image

gast3
(ausgesetzt)

Klicke auf Einblenden/Ausblenden von Überarbeitungen 4

16 Mai '21, 15:52

gast3's gravatar image

gast3
(ausgesetzt)

Klicke auf Einblenden/Ausblenden von Überarbeitungen 3

16 Mai '21, 15:48

gast3's gravatar image

gast3
(ausgesetzt)

Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

16 Mai '21, 15:48

gast3's gravatar image

gast3
(ausgesetzt)

Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

16 Mai '21, 15:47

gast3's gravatar image

gast3
(ausgesetzt)