
Ich hoffe, meine endgültige Tabelle sieht so aus:
| UNTERBL1 | UNTERBL2 |
| UNTERBL3 | UNTERBL4 |
und das ist es, aber ein Teil der Tabelle überlappt den Text. Was soll ich tun?
Hier ist meine Präambel:
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{array}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\usepackage{textcomp}
\usepackage{stfloats}
\usepackage{multirow}
\usepackage{url}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{diagbox}
\usepackage{booktabs}
\usepackage{cite}
\usepackage{caption}
\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}
Hier ist mein Code:
\begin{table}[th]
\centering
\caption{Result}
\begin{tabular}{c c}
\begin{minipage}[b]{0.48\textwidth}\centering
\resizebox{1.\textwidth}{!}{
\begin{tabular}{cccccccccc}
\toprule
%\hline
\multirow{2}{*}{K} & \multicolumn{3}{c}{t = 0.1} & \multicolumn{3}{c}{t = 1} & \multicolumn{3}{c}{t = 5} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10}
& Prc.\% & Rec.\% & F1-Mea.\% & Prc.\% & Rec.\% & F1-Mea.\% & Prec.\% & Rec.\% & F1-Mea.\%\\ \toprule
0.2 & 99.94 & 99.99 & 99.96 & 99.77 & 99.98 & 99.87 & 94.93 & 99.90 & 97.35 \\
0.5 & 99.91 & 99.99 & 99.94 & 99.93 &99.99 & 99.95 & 73.20 &99.62 & 84.39 \\
0.8 & \textbf{99.95} & \textbf{99.99 } & \textbf{99.96} & 99.93 & 99.99 & 99.95 & 99.70 & 99.99 & 99.84 \\ \toprule
\end{tabular}}
\caption{(a)}
\end{minipage}
&
\begin{minipage}[b]{0.48\textwidth}\centering
\resizebox{1.\textwidth}{!}{
\begin{tabular}{cccccccccc}
\toprule
\multirow{2}{*}{K} & \multicolumn{3}{c}{t = 0.1} & \multicolumn{3}{c}{t = 1} & \multicolumn{3}{c}{t = 5} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10}
& Prec.\% & Rec.\% & F1-Mea.\% & Prc.\% & Rec.\% & F1-Mea.\% & Prc.\% & Rec.\% & F1-Mea.\%\\ \toprule
0.2 & 92.19 & 93.27 & 92.72 & \textbf{92.54} & \textbf{93.62} & \textbf{93.07} & 91.53 & 92.58 & 92.05 \\
0.5 & 92.03 & 93.10 & 92.56 & \textbf{92.54} & \textbf{93.62} & \textbf{93.07} & 91.53 & 92.58 &92.05 \\
0.8 &92.36 & 93.45 & 92.90 & \textbf{92.54} & \textbf{93.62} & \textbf{93.07} & 91.86 & 92.93 & 92.39 \\ \toprule
\end{tabular}}
\caption{(b)}
\end{minipage}
\\
\begin{minipage}[b]{0.48\textwidth}\centering
\resizebox{1.\textwidth}{!}{
\begin{tabular}{cccccccccc}
\toprule
%\hline
\multirow{2}{*}{K} & \multicolumn{3}{c}{t = 0.1} & \multicolumn{3}{c}{t = 1} & \multicolumn{3}{c}{t = 5} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10}
& Prec.\% & Rec.\% & F1-Mea.\% & Prec.\% & Rec.\% & F1-Mea.\% & Prec.\% & Rec.\% & F1-Mea.\%\\ \toprule
0.2 & 99.85 & 94.45 & 97.07 & 99.85 & 99.55 & 99.69 & \textbf{99.85} & \textbf{99.98} & \textbf{99.91} \\
0.5 & 99.89 & 99.25 & 99.56 & 99.85 & 99.73 & 99.78 & \textbf{99.85} & \textbf{99.98} & \textbf{99.91} \\
0.8 & 99.91 & 94.09 & 96.91 & 99.83 & 95.65 & 97.69 & \textbf{99.85} & \textbf{99.98} & \textbf{99.91} \\ \toprule
\end{tabular}}
\caption{(c)}
\end{minipage}
&
\begin{minipage}[b]{0.48\textwidth}\centering
\resizebox{1.\textwidth}{!}{
\begin{tabular}{cccccccccc}
\toprule
%\hline
\multirow{2}{*}{K} & \multicolumn{3}{c}{t = 0.1} & \multicolumn{3}{c}{t = 1} & \multicolumn{3}{c}{t = 5} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10}
& Prec.\% & Rec.\% & F1-Mea.\% & Prec.\% & Rec.\% & F1-Mea.\% & Prec.\% & Rec.\% & F1-Mea.\%\\ \toprule
0.2 & 99.99 & 90.47 & 94.99 & \textbf{99.99} & \textbf{97.61} & \textbf{98.78} & 99.99 & 85.71 & 92.30\\
0.5 & 99.99 & 92.85 & 96.28& \textbf{99.99} & \textbf{97.61} & \textbf{98.78} & 99.99 & 88.09 & 93.66\\
0.8 & 99.99 & 92.85 & 96.28 & \textbf{99.99} & \textbf{97.61} & \textbf{98.78} & 99.99 & 88.09 & 93.66 \\ \toprule
\end{tabular}}
\caption{(d)}
\end{minipage}
\\
\end{tabular}
\end{table}
Antwort1
Konzentrieren wir uns also hier auf das Organisationsproblem. Daher werde ich die Tabellen in einer einfachen Tabelle in einer separaten Datei mit dem Namen komprimieren input_tab_A
:
\begin{tabular}{lll}
A & B & C \\
1 & 2 & 3
\end{tabular}
Durch die Trennung tabular
von s in eigene Dateien können wir uns auf das Problem konzentrieren, nicht auf den Inhalt. Ich empfehle, dies mit allen zu tunzu lang und zu komplexTabellen. Wenn Zeitschriften erforderneine einzige Tex-Datei, kopieren und fügen Sie es einfach ein, nachdem Sie die schwierige Aufgabe des Organisierens und Schreibens Ihres Artikels erledigt haben.
Als nächstes werden in dieser Antwort die folgenden Links als Quellen verwendet:
Nun zum Code. Ich werde mehr als eine Methode zum Einfügen von Tabellen vorstellen. Da Ihr Problem mit der Organisation und Verschiebung um Text herum zusammenhängt, lipsum
wird das Paket verwendet, um das Eintippen von Text zu vermeiden. Manchmal füge ich Kopien ein, \input{input_tab_A}
um längere Tabellen zu erstellen.
Das MWE folgt
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{float}
\usepackage{lipsum}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{font=normalsize,labelfont=sf,textfont=sf,position=top}
\begin{document}
\lipsum[1-3]
\begin{minipage}[b]{0.48\linewidth}
\centering
\begin{table}[H]
\captionbox{Legend}[\linewidth]{
\input{input_tab_A}
}
\end{table}
\end{minipage}%
\begin{minipage}[b]{0.48\linewidth}
\centering
\begin{table}[H]
\captionbox{Legend}[\linewidth]{
\input{input_tab_A}
}
\end{table}
\end{minipage}
\lipsum[1-3]
\begin{minipage}[b]{0.3\textwidth}
\centering
\begin{table}[H]
\captionbox{!!Error textwidth!!}[\linewidth]{
\input{input_tab_A}
}
\end{table}
\end{minipage}%
\begin{minipage}[b]{0.3\textwidth}
\centering
\begin{table}[H]
\captionbox{This table is missing}[\linewidth]{
\input{input_tab_A}
}
\end{table}
\end{minipage}
\begin{table*}
\captionbox{This table goes through two columns}[\linewidth]{
\input{input_tab_A}\input{input_tab_A}
\input{input_tab_A}\input{input_tab_A}
\input{input_tab_A}\input{input_tab_A}
}
\end{table*}
\lipsum[1-3]
\begin{table}[!ht]
\centering
\captionbox{A lot of tables and subtables}[\linewidth]{
\subcaptionbox{First}{
\input{input_tab_A}
}\quad
\subcaptionbox{Second}{
\input{input_tab_A}
}
\subcaptionbox{Third}{
\input{input_tab_A}
}\quad
\subcaptionbox{Fourth}{
\input{input_tab_A}
}
}
\end{table}
\lipsum[1-7]
\begin{table*}[!ht]
\centering
\captionbox{A lot of tables and subtables through two columns}[\linewidth]{
\subcaptionbox{First}{
\input{input_tab_A}
\input{input_tab_A}
\input{input_tab_A}
}\quad
\subcaptionbox{Second}{
\input{input_tab_A}
\input{input_tab_A}
\input{input_tab_A}
}
\subcaptionbox{Third}{
\input{input_tab_A}\input{input_tab_A}
\input{input_tab_A}\input{input_tab_A}
\input{input_tab_A}\input{input_tab_A}
}\quad
\subcaptionbox{Fourth}{
\input{input_tab_A}\input{input_tab_A}
\input{input_tab_A}\input{input_tab_A}
\input{input_tab_A}\input{input_tab_A}
}
}
\end{table*}
\lipsum[1-7]
\begin{figure*}
\centering
\begin{minipage}[b]{0.3\textwidth}
\centering
\captionof{table}{First}
\input{input_tab_A}
\end{minipage}\quad
\begin{minipage}[b]{0.3\textwidth}
\centering
\captionof{table}{Second}
\input{input_tab_A}
\end{minipage}
\begin{minipage}[b]{0.3\textwidth}
\centering
\captionof{table}{Third}
\input{input_tab_A}
\end{minipage} %
\begin{minipage}[b]{0.3\textwidth}
\centering
\captionof{table}{Fourth}
\input{input_tab_A}
\end{minipage}
\end{figure*}
\lipsum[1-10]
\end{document}
Diskussion der Ergebnisse
minipage
mit\linewidth
Das ist ein gutes Ergebnis, jedes mit der Bezeichnung numericas als Tabelle, aber nur eine Spalte. Ich musste [H]
from float
package verwenden, das ist nichtelegant(Warum sollte die Option „H“ nicht in Floats verwendet werden?).
minipage
mit\textwidth
Nicht schön, Tabellen werden sicherlich weit von den Rändern entfernt sein. Schlechte Lösung.
table*
Jetzt wird es besser, in unsere sehr große Tabelle passen beide Spalten, ohne dass der Text gestört wird.Geht es zur nächsten Seite?-- Ja, so IEEEtran
definiert die Klasse das Standardverhalten.
table
Und\subcaptionbox
Diese Lösung gibt uns Untertitel! Das sieht zwar gut aus, ist aber nicht genau das, was Sie wollen. Es befindet sich in einer einzelnen Spalte.
table*
Und\subcaptionbox
Ein bisschen näher. Kleinere Tabellen können nebeneinander stehen, größere Tabellen nicht. Aber es hat immer noch die Untertitel mit Buchstaben. Versuchen wir unseren letzten Schritt.
figure*
, minipage
Und\captionof
Warum beugen wir die Regeln nicht zu unseren Gunsten?
Das caption
Paket ermöglicht uns,ultimativer Trick, einfügenBildunterschriften vonein Objekt in anderen Umgebungen.
Jetzt erreichen wir: (1) die gewünschte Organisation; (2) alle Tabellen sind als Tabellen gekennzeichnet, nicht als Untertabellen; (3) Tabellen, die Spalten überschreiten, aber nicht über Texte; und (4) einigeEleganzVermeidung [H]
.