
最終的なテーブルは次のようになることを期待しています:
| サブテーブル1 | サブテーブル2 |
| サブテーブル3 | サブテーブル4 |
確かにそうですが、表の一部がテキストと重なっています。どうすればいいでしょうか?
私の序文は次のとおりです。
\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}
これが私のコードです:
\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}
答え1
では、ここで組織の問題に焦点を当ててみましょう。したがって、テーブルを という名前の別のファイルに圧縮して、単純なテーブルにしますinput_tab_A
。
\begin{tabular}{lll}
A & B & C \\
1 & 2 & 3
\end{tabular}
を独自のファイルに分割することでtabular
、コンテンツではなく問題に焦点を当てることができます。すべてのファイルでこれを行うことをお勧めします。長すぎて複雑すぎる表。ジャーナルが1つのTexファイル記事を整理して書くという大変な作業を終えたら、コピーして貼り付けるだけです。
次に、この回答では次のリンクをソースとして使用します。
さて、コードに移ります。テーブルを挿入する方法は複数紹介します。問題はテキストの編成と配置に関係しているため、lipsum
テキストの入力を避けるために パッケージを使用します。\input{input_tab_A}
長いテーブルを作成するために、 のコピーを挿入することもあります。
MWEは
\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}
結果の議論
minipage
と\linewidth
これは良い結果です。それぞれnumericasというラベルがテーブルとして付けられていますが、列は1つだけです。パッケージ[H]
から使用する必要がありましfloat
たが、エレガント(フロートでは「H」オプションを使用しないのはなぜですか?)。
minipage
と\textwidth
良くありません。テーブルは確実に余白から遠く離れてしまいます。悪い解決策です。
table*
今では状況は改善され、非常に大きなテーブルでもテキストを邪魔することなく両方の列に収まるようになりました。次のページに進みますか?-- はい、これがクラスがIEEEtran
標準的な動作を定義する方法です。
table
そして\subcaptionbox
このソリューションはサブキャプションを提供します。見た目は良いですが、まさにあなたが望んでいるものではありません。サブキャプションは 1 つの列内にあります。
table*
そして\subcaptionbox
もう少し近づきました。小さいテーブルは横に並べることができますが、大きいテーブルは横に並べることができません。ただし、文字付きのサブキャプションはまだあります。最後の動きを試してみましょう。
figure*
、minipage
そして\captionof
なぜ我々に有利になるようにルールを曲げないのか?
このcaption
パッケージでは、究極のトリック、 入れるキャプション他の環境内のオブジェクト。
これで、(1) 望ましい組織化、(2) すべてのテーブルがサブテーブルではなくテーブルとしてラベル付けされる、(3) テーブルが列をまたがるがテキストをまたがらない、(4)優雅避ける[H]
。